]> git.vomp.tv Git - vompclient.git/blob - GNUmakefile
Rework master loop
[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 CROSSROOT=
16
17 ifndef VERBOSE
18 Q = @
19 endif
20
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
42
43 ifeq ($(vomp_platform),raspberry)
44 $(info Raspberry Pi native compiler)
45 CC=gcc
46 STRIP=strip
47 CXX=g++
48 LD=g++
49
50 #CC=clang-9
51 #STRIP=strip
52 #CXX=clang++-9
53 #LD=clang++-9
54
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)
61 CROSSLIBS =
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
64 CXXFLAGS_EXTRA =
65 endif
66
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)
78 CROSSLIBS =
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
82 endif
83
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)
86
87 .PHONY: clean fresh all install strip
88
89 default: dev
90 fresh:   clean default
91
92 %.o: %.cc
93         @echo CC $@
94         $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
95
96 vompclient: $(OBJECTS) $(CROSSLIBS)
97         @echo LD vompclient
98         $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
99
100 strip:
101         @echo STRIP vompclient
102         $(Q)$(STRIP) vompclient
103
104 dev: CXXFLAGS := $(CXXFLAGS_DEV)
105 dev: vompclient
106
107 release: CXXFLAGS := $(CXXFLAGS_REL)
108 release: clean vompclient strip
109
110 clean:
111         rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o
112
113 ifndef SKIPDEPS
114 deps: GNUmakefile
115         @echo "DEPS"
116         $(Q)$(CC) -MM $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
117 endif
118
119 ifneq ($(MAKECMDGOALS),clean)
120 include deps
121 endif