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)
49 vomp_options += -DIPV6
50 LDFLAGS = -fuse-ld=gold $(PICTURES)
51 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf
52 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample
53 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16
54 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
56 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
57 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
61 ifeq ($(vomp_platform),crossraspberry)
62 $(info Raspberry Pi cross compiler)
63 CC=arm-linux-gnueabihf-gcc
64 STRIP=arm-linux-gnueabihf-strip
65 CXX=arm-linux-gnueabihf-g++
66 LD=arm-linux-gnueabihf-g++
67 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
68 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
69 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample
70 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 -lm
71 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
73 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
74 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
75 CXXFLAGS_EXTRA = -mfloat-abi=hard
78 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)
79 CXXFLAGS_REL = -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) -D_GNU_SOURCE $(PLATFORM) $(vomp_options) $(INCLUDES)
81 .PHONY: clean fresh all install strip
88 $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
90 vompclient: $(OBJECTS) $(CROSSLIBS)
92 $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
95 @echo STRIP vompclient
96 $(Q)$(STRIP) vompclient
98 dev: CXXFLAGS := $(CXXFLAGS_DEV)
101 release: CXXFLAGS := $(CXXFLAGS_REL)
102 release: clean vompclient strip
105 rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o
110 $(Q)$(CC) -MM $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
113 ifneq ($(MAKECMDGOALS),clean)