]> git.vomp.tv Git - vompclient.git/blob - GNUmakefile
OSDOpenVG: Render on demand: Fix backing out of a view render race
[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 LDFLAGS = -fuse-ld=gold $(PICTURES)
56 #-fuse-ld=gold
57
58 vomp_options += -DIPV4 -DIPV6
59 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf
60 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lswresample
61 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16
62 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
63 CROSSLIBS =
64 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
65 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
66 CXXFLAGS_EXTRA = -Wno-psabi
67 endif
68
69 ifeq ($(vomp_platform),crossraspberry)
70 $(info Raspberry Pi cross compiler)
71 CC=arm-linux-gnueabihf-gcc
72 STRIP=arm-linux-gnueabihf-strip
73 CXX=arm-linux-gnueabihf-g++
74 LD=arm-linux-gnueabihf-g++
75 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
76 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
77 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lswresample
78 LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 -lm
79 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY)
80 CROSSLIBS =
81 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
82 PLATFORM = -DVOMP_PLATFORM_RASPBERRY
83 CXXFLAGS_EXTRA = -mfloat-abi=hard
84 endif
85
86 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)
87 CXXFLAGS_REL = -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) -D_GNU_SOURCE $(PLATFORM) $(vomp_options) $(INCLUDES)
88
89 .PHONY: clean fresh all install strip
90
91 default: dev
92 fresh:   clean default
93
94 %.o: %.cc
95         @echo CC $@
96         $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
97
98 vompclient: $(OBJECTS) $(CROSSLIBS)
99         @echo LD vompclient
100         $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
101
102 strip:
103         @echo STRIP vompclient
104         $(Q)$(STRIP) vompclient
105
106 dev: CXXFLAGS := $(CXXFLAGS_DEV)
107 dev: vompclient
108
109 release: CXXFLAGS := $(CXXFLAGS_REL)
110 release: clean vompclient strip
111
112 clean:
113         rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o
114
115 ifndef SKIPDEPS
116 deps: GNUmakefile
117         @echo "DEPS"
118         $(Q)$(CC) -MM $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
119 endif
120
121 ifneq ($(MAKECMDGOALS),clean)
122 include deps
123 endif