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
28 # Pictures for linux builds
29 PICTURES = -Wl,--format=binary
30 PICTURES += -Wl,other/vdrhires.png
31 PICTURES += -Wl,other/wallpaper720p.jpg
32 PICTURES += -Wl,other/properties.png
33 PICTURES += -Wl,other/radio.png
34 PICTURES += -Wl,other/timers.png
35 PICTURES += -Wl,other/tv.png
36 PICTURES += -Wl,other/recordings.png
37 PICTURES += -Wl,other/restart.png
38 PICTURES += -Wl,other/hd1080i.png
39 PICTURES += -Wl,other/hd720p.png
40 PICTURES += -Wl,other/sd576i.png
41 PICTURES += -Wl,other/txtoff.png
42 PICTURES += -Wl,other/txton.png
43 PICTURES += -Wl,other/dolbyoff.png
44 PICTURES += -Wl,other/dolbyon.png
45 PICTURES += -Wl,other/recording.png
46 PICTURES += -Wl,other/recfolder.png
47 PICTURES += -Wl,other/defposter.png
48 PICTURES += -Wl,--format=default
50 ifeq ($(vomp_platform),raspberry)
51 $(info Raspberry Pi native compiler)
62 LDFLAGS = -fuse-ld=gold $(PICTURES)
65 VOMP_OPTIONS += -DIPV4 -DIPV6
66 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf
67 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lswresample
68 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16
69 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
70 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
71 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
72 CXXFLAGS_EXTRA = -Wno-psabi
78 # apt install g++-arm-linux-gnueabihf
79 # Set vomp_platform=crossraspberry above
80 ifeq ($(vomp_platform),crossraspberry)
81 VOMP_OPTIONS += -DIPV4 -DIPV6
82 CROSS_PREFIX=arm-linux-gnueabihf-
84 STRIP=$(CROSS_PREFIX)strip
85 CXX=$(CROSS_PREFIX)g++
88 LDFLAGS = -Wall $(PICTURES) --sysroot=$(CROSSROOT) \
89 -Wl,-rpath-link,$(CROSSROOT)/opt/vc/lib -Wl,-rpath-link,$(CROSSROOT)/usr/lib/arm-linux-gnueabihf \
90 -L=/opt/vc/lib -L=/usr/lib/arm-linux-gnueabihf
92 LIBS = -lpthread -lstdc++ -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec \
93 -lavutil -lswresample -lm -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16
94 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
95 INCLUDES = --sysroot=$(CROSSROOT) -I=/usr/include/arm-linux-gnueabihf -I=/opt/vc/include -I=/usr/include/freetype2 -I=/usr/include/arm-linux-gnueabihf/ImageMagick-6 -I=/usr/include/ImageMagick-6
96 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
97 CXXFLAGS_EXTRA = -mtune=cortex-a7 -mfloat-abi=hard -fopenmp
100 CXXFLAGS_DEV = -g -O0 -Wall -Wextra -Wshadow -Werror=return-type -Wmissing-declarations -Winit-self -Woverloaded-virtual -Wold-style-cast -Wconversion -std=c++14 $(CXXFLAGS_EXTRA) -DDEV -D_GNU_SOURCE -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 $(PLATFORM) $(VOMP_OPTIONS) $(INCLUDES)
101 CXXFLAGS_REL = -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) -D_GNU_SOURCE -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 $(PLATFORM) $(VOMP_OPTIONS) $(INCLUDES)
105 .PHONY: clean fresh all install strip
112 $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
114 vompclient: $(OBJECTS)
116 $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(LIBS)
119 @echo STRIP vompclient
120 $(Q)$(STRIP) vompclient
122 dev: CXXFLAGS := $(CXXFLAGS_DEV)
125 release: CXXFLAGS := $(CXXFLAGS_REL)
126 release: clean vompclient strip
129 rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o
134 $(Q)$(CC) -MM $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
137 ifneq ($(MAKECMDGOALS),clean)