]> git.vomp.tv Git - vompclient.git/blob - GNUmakefile
Pictures back to GNUmakefile, nmake didn't understand it
[vompclient.git] / GNUmakefile
1 # Switches for this Makefile:
2
3 # VERBOSE - set to 1 to show all commands
4 # SKIPDEPS - Skip regeneration of dependencies file
5
6 include objects.mk
7
8 # valid platforms are raspberry and crossraspberry
9 vomp_platform=$(shell ./select-platform)
10 $(info selected $(vomp_platform))
11
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
14
15 ifndef VERBOSE
16 Q = @
17 endif
18
19 # Pictures for linux builds
20 PICTURES = -Wl,--format=binary
21 PICTURES += -Wl,other/vdrhires.png
22 PICTURES += -Wl,other/wallpaper720p.jpg
23 PICTURES += -Wl,other/properties.png
24 PICTURES += -Wl,other/radio.png
25 PICTURES += -Wl,other/timers.png
26 PICTURES += -Wl,other/tv.png
27 PICTURES += -Wl,other/recordings.png
28 PICTURES += -Wl,other/restart.png
29 PICTURES += -Wl,other/hd1080i.png
30 PICTURES += -Wl,other/hd720p.png
31 PICTURES += -Wl,other/sd576i.png
32 PICTURES += -Wl,other/txtoff.png
33 PICTURES += -Wl,other/txton.png
34 PICTURES += -Wl,other/dolbyoff.png
35 PICTURES += -Wl,other/dolbyon.png
36 PICTURES += -Wl,other/recording.png
37 PICTURES += -Wl,other/recfolder.png
38 PICTURES += -Wl,other/defposter.png
39 PICTURES += -Wl,--format=default
40
41 ifeq ($(vomp_platform),raspberry)
42 $(info Raspberry Pi native compiler)
43 CC=clang-9
44 STRIP=strip
45 CXX=clang++-9
46 LD=clang++-9
47 vomp_options += -DIPV6
48 LDFLAGS = -fuse-ld=gold $(PICTURES)
49 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf
50 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample
51 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16
52 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
53 CROSSLIBS =
54 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
55 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
56 CXXFLAGS_EXTRA =
57 endif
58
59 ifeq ($(vomp_platform),crossraspberry)
60 $(info Raspberry Pi cross compiler)
61 CC=arm-linux-gnueabi-gcc-4.7
62 STRIP=arm-linux-gnueabi-strip
63 CXX=arm-linux-gnueabi-g++-4.7
64 LD=arm-linux-gnueabi-g++-4.7
65 LDFLAGS = $(PICTURES) -Wl,--verbose -Xlinker --rpath-link=rpi-root/usr/lib/arm-linux-gnueabihf -Xlinker --rpath-link=rpi-root/lib/arm-linux-gnueabihf -Xlinker --rpath-link=rpi-root/opt/vc/lib
66 LIBPATHS = -Lrpi-root/opt/vc/lib -Lrpi-root/lib -Lrpi-root/usr/lib -Lrpi-root/lib/arm-linux-gnueabihf -Lrpi-root/usr/lib/arm-linux-gnueabihf -Lrpi-root/usr/local/lib
67 LIBS = -lpthread -lrt -lEGL -lOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample -ldl -lfontconfig
68 LIBS += -lfreetype -lMagick++-6.Q16
69 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
70 CROSSLIBS =
71 INCLUDES = -Irpi-root/opt/vc/include -Irpi-root/opt/vc/include/interface/vcos/pthreads -Irpi-root/usr/include -Irpi-root/usr/include/freetype2 -Irpi-root/usr/include/ImageMagick-6  -Irpi-root/usr/include/ImageMagick  -Irpi-root/usr/include/arm-linux-gnueabihf/ImageMagick-6
72 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
73 CXXFLAGS_EXTRA = -mfloat-abi=hard
74 endif
75
76 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)
77 CXXFLAGS_REL = -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) -D_GNU_SOURCE $(PLATFORM) $(vomp_options) $(INCLUDES)
78
79 .PHONY: clean fresh all install strip
80
81 default: dev
82 fresh:   clean default
83
84 %.o: %.cc
85         @echo CC $@
86         $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
87
88 vompclient: $(OBJECTS) $(CROSSLIBS)
89         @echo LD vompclient
90         $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
91
92 strip:
93         @echo STRIP vompclient
94         $(Q)$(STRIP) vompclient
95
96 dev: CXXFLAGS := $(CXXFLAGS_DEV)
97 dev: vompclient
98
99 release: CXXFLAGS := $(CXXFLAGS_REL)
100 release: clean vompclient strip
101
102 clean:
103         rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o
104
105 ifndef SKIPDEPS
106 deps: GNUmakefile
107         @echo "DEPS"
108         $(Q)$(CC) -MM $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
109 endif
110
111 ifneq ($(MAKECMDGOALS),clean)
112 include deps
113 endif