1 # Switches for this Makefile:
3 # VERBOSE - set to 1 to show all commands
4 # SKIPDEPS - Skip regeneration of dependencies file
8 vomp_platform=$(shell ./select-platform)
9 # vomp_platform variable sets up the build on different platforms
10 # valid platforms are:
11 # raspberry - native compile for & on Raspberry Pi
12 # crossraspberry - cross compile for Raspberry Pi
13 # Override auto select here:
16 $(info Build system selected: $(vomp_platform))
19 # uncomment the line below if you want to build vomp application without a reboot option, automatically set for windows!
20 #VOMP_OPTIONS+= -DVOMP_HAS_EXIT
23 SYSROOT=--sysroot=$(CROSSROOT)
29 # Pictures for linux builds
30 PICTURES = -Wl,--format=binary
31 PICTURES += -Wl,other/vdrhires.png
32 PICTURES += -Wl,other/wallpaper720p.jpg
33 PICTURES += -Wl,other/properties.png
34 PICTURES += -Wl,other/radio.png
35 PICTURES += -Wl,other/timers.png
36 PICTURES += -Wl,other/tv.png
37 PICTURES += -Wl,other/recordings.png
38 PICTURES += -Wl,other/restart.png
39 PICTURES += -Wl,other/hd1080i.png
40 PICTURES += -Wl,other/hd720p.png
41 PICTURES += -Wl,other/sd576i.png
42 PICTURES += -Wl,other/txtoff.png
43 PICTURES += -Wl,other/txton.png
44 PICTURES += -Wl,other/dolbyoff.png
45 PICTURES += -Wl,other/dolbyon.png
46 PICTURES += -Wl,other/recording.png
47 PICTURES += -Wl,other/recfolder.png
48 PICTURES += -Wl,other/defposter.png
49 PICTURES += -Wl,--format=default
54 ifeq ($(vomp_platform),raspberry)
55 $(info Raspberry Pi native compiler)
66 LDFLAGS = -fuse-ld=gold $(PICTURES)
69 DEFINES += -DIPV4 -DIPV6
70 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf
71 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lswresample
72 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16
73 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
74 INCLUDES = -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/usr/include/freetype2 -I/usr/include/ImageMagick -I/usr/include/ImageMagick-6 -I/usr/include/arm-linux-gnueabihf/ImageMagick-6
75 DEFINES += -DVOMP_PLATFORM_RASPBERRY
76 CXXFLAGS_EXTRA = -Wno-psabi
82 # apt install g++-arm-linux-gnueabihf
83 # Set vomp_platform=crossraspberry above
84 ifeq ($(vomp_platform),crossraspberry)
85 DEFINES += -DIPV4 -DIPV6
86 CROSS_PREFIX=arm-linux-gnueabihf-
88 STRIP=$(CROSS_PREFIX)strip
89 CXX=$(CROSS_PREFIX)g++
92 LDFLAGS = -Wall $(PICTURES) $(SYSROOT) \
93 -Wl,-rpath-link,$(CROSSROOT)/opt/vc/lib -Wl,-rpath-link,$(CROSSROOT)/usr/lib/arm-linux-gnueabihf \
94 -L=/opt/vc/lib -L=/usr/lib/arm-linux-gnueabihf
96 LIBS = -lpthread -lstdc++ -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lfmt \
97 -lavutil -lswresample -lm -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16 -ljsoncpp
98 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
99 INCLUDES = -isystem=/usr/include/arm-linux-gnueabihf -isystem=/opt/vc/include -isystem=/usr/include/freetype2 -isystem=/usr/include/arm-linux-gnueabihf/ImageMagick-6 -isystem=/usr/include/ImageMagick-6
100 DEFINES += -DVOMP_PLATFORM_RASPBERRY -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
101 CXXFLAGS_EXTRA = $(SYSROOT) -Wno-psabi -mtune=cortex-a7 -mfloat-abi=hard -fopenmp
107 CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -Wall -Wextra -Wshadow -Werror=return-type -Wmissing-format-attribute -Wdisabled-optimization -Wmissing-declarations -Wmissing-noreturn -Winit-self -Woverloaded-virtual -Wold-style-cast -Wconversion -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
108 #CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
109 CXXFLAGS_REL = $(DEFINES) -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
111 .PHONY: clean fresh all install strip
118 $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
120 vompclient: $(OBJECTS)
122 $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(LIBS)
126 @echo STRIP vompclient
127 $(Q)$(STRIP) vompclient
129 dev: CXXFLAGS := $(CXXFLAGS_DEV)
132 release: CXXFLAGS := $(CXXFLAGS_REL)
133 release: clean vompclient strip
136 rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o
141 $(Q)$(CC) -MM $(SYSROOT) $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
144 ifneq ($(MAKECMDGOALS),clean)