1 # Switches for this Makefile:
3 # VERBOSE - set to 1 to show all commands
4 # SKIPDEPS - Skip regeneration of dependencies file
8 # valid platforms are raspberry and crossraspberry
9 vomp_platform=$(shell ./select-platform)
10 $(info selected $(vomp_platform))
12 # uncomment the line below if you want to build vomp application without a reboot option, automatically set for windows!
13 #vomp_options+= -DVOMP_HAS_EXIT
21 # Pictures for linux builds
22 PICTURES = -Wl,--format=binary
23 PICTURES += -Wl,other/vdrhires.png
24 PICTURES += -Wl,other/wallpaper720p.jpg
25 PICTURES += -Wl,other/properties.png
26 PICTURES += -Wl,other/radio.png
27 PICTURES += -Wl,other/timers.png
28 PICTURES += -Wl,other/tv.png
29 PICTURES += -Wl,other/recordings.png
30 PICTURES += -Wl,other/restart.png
31 PICTURES += -Wl,other/hd1080i.png
32 PICTURES += -Wl,other/hd720p.png
33 PICTURES += -Wl,other/sd576i.png
34 PICTURES += -Wl,other/txtoff.png
35 PICTURES += -Wl,other/txton.png
36 PICTURES += -Wl,other/dolbyoff.png
37 PICTURES += -Wl,other/dolbyon.png
38 PICTURES += -Wl,other/recording.png
39 PICTURES += -Wl,other/recfolder.png
40 PICTURES += -Wl,other/defposter.png
41 PICTURES += -Wl,--format=default
43 ifeq ($(vomp_platform),raspberry)
44 $(info Raspberry Pi native compiler)
55 vomp_options += -DIPV6
56 LDFLAGS = -fuse-ld=gold $(PICTURES)
57 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf
58 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample
59 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16
60 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
62 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
63 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
67 ifeq ($(vomp_platform),crossraspberry)
68 $(info Raspberry Pi cross compiler)
69 CC=arm-linux-gnueabihf-gcc
70 STRIP=arm-linux-gnueabihf-strip
71 CXX=arm-linux-gnueabihf-g++
72 LD=arm-linux-gnueabihf-g++
73 LDFLAGS = $(PICTURES) -Xlinker --sysroot=$(CROSSROOT) -Xlinker --rpath-link=$(CROSSROOT)/usr/lib/gcc/arm-linux-gnueabihf/8 -Xlinker --rpath-link=$(CROSSROOT)/usr/lib/arm-linux-gnueabihf -Xlinker --rpath-link=$(CROSSROOT)/lib/arm-linux-gnueabihf -Xlinker --rpath-link=$(CROSSROOT)/opt/vc/lib
74 LIBPATHS = -L$(CROSSROOT)/usr/lib/gcc/arm-linux-gnueabihf/8 -L$(CROSSROOT)/opt/vc/lib -L$(CROSSROOT)/lib -L$(CROSSROOT)/usr/lib -L$(CROSSROOT)/lib/arm-linux-gnueabihf -L$(CROSSROOT)/usr/lib/arm-linux-gnueabihf -L$(CROSSROOT)/usr/local/lib
75 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample
76 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 -lm
77 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
79 INCLUDES = -I$(CROSSROOT)/opt/vc/include -I$(CROSSROOT)/opt/vc/include/interface/vcos/pthreads -I$(CROSSROOT)/usr/include -I$(CROSSROOT)/usr/include/arm-linux-gnueabihf -I$(CROSSROOT)/usr/include/freetype2 -I$(CROSSROOT)/usr/include/ImageMagick-6 -I$(CROSSROOT)/usr/include/ImageMagick -I$(CROSSROOT)/usr/include/arm-linux-gnueabihf/ImageMagick-6
80 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
81 CXXFLAGS_EXTRA = -mfloat-abi=hard
84 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 $(PLATFORM) $(vomp_options) $(INCLUDES)
85 CXXFLAGS_REL = -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) -D_GNU_SOURCE $(PLATFORM) $(vomp_options) $(INCLUDES)
87 .PHONY: clean fresh all install strip
94 $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
96 vompclient: $(OBJECTS) $(CROSSLIBS)
98 $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
101 @echo STRIP vompclient
102 $(Q)$(STRIP) vompclient
104 dev: CXXFLAGS := $(CXXFLAGS_DEV)
107 release: CXXFLAGS := $(CXXFLAGS_REL)
108 release: clean vompclient strip
111 rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o
116 $(Q)$(CC) -MM $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
119 ifneq ($(MAKECMDGOALS),clean)