# Switches for this Makefile: # VERBOSE - set to 1 to show all commands # SKIPDEPS - Skip regeneration of dependencies file include objects.mk vomp_platform=$(shell ./select-platform) # vomp_platform variable sets up the build on different platforms # valid platforms are: # raspberry - native compile for & on Raspberry Pi # crossraspberry - cross compile for Raspberry Pi # Override auto select here: # vomp_platform= $(info Build system selected: $(vomp_platform)) CROSSROOT=/pi-root # uncomment the line below if you want to build vomp application without a reboot option, automatically set for windows! #VOMP_OPTIONS+= -DVOMP_HAS_EXIT ifndef VERBOSE Q = @ endif # Pictures for linux builds PICTURES = -Wl,--format=binary PICTURES += -Wl,other/vdrhires.png PICTURES += -Wl,other/wallpaper720p.jpg PICTURES += -Wl,other/properties.png PICTURES += -Wl,other/radio.png PICTURES += -Wl,other/timers.png PICTURES += -Wl,other/tv.png PICTURES += -Wl,other/recordings.png PICTURES += -Wl,other/restart.png PICTURES += -Wl,other/hd1080i.png PICTURES += -Wl,other/hd720p.png PICTURES += -Wl,other/sd576i.png PICTURES += -Wl,other/txtoff.png PICTURES += -Wl,other/txton.png PICTURES += -Wl,other/dolbyoff.png PICTURES += -Wl,other/dolbyon.png PICTURES += -Wl,other/recording.png PICTURES += -Wl,other/recfolder.png PICTURES += -Wl,other/defposter.png PICTURES += -Wl,--format=default DEFINES=-D_GNU_SOURCE ifeq ($(vomp_platform),raspberry) $(info Raspberry Pi native compiler) CC=gcc STRIP=strip CXX=g++ LD=g++ #CC=clang-9 #STRIP=strip #CXX=clang++-9 #LD=clang++-9 LDFLAGS = $(PICTURES) #-fuse-ld=gold DEFINES += -DIPV4 -DIPV6 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec \ -lavutil -lswresample -ljsoncpp -lfmt -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY) 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 DEFINES += -DVOMP_PLATFORM_RASPBERRY CXXFLAGS_EXTRA = -Wno-psabi endif # Debian 10 x64 # apt install g++-arm-linux-gnueabihf # Set vomp_platform=crossraspberry above ifeq ($(vomp_platform),crossraspberry) SYSROOT= --sysroot=$(CROSSROOT) DEFINES += -DIPV4 -DIPV6 CROSS_PREFIX=arm-linux-gnueabihf- CC=$(CROSS_PREFIX)gcc STRIP=$(CROSS_PREFIX)strip CXX=$(CROSS_PREFIX)g++ LD=$(CROSS_PREFIX)g++ LDFLAGS = -Wall $(PICTURES) $(SYSROOT) \ -Wl,-rpath-link,$(CROSSROOT)/opt/vc/lib -Wl,-rpath-link,$(CROSSROOT)/usr/lib/arm-linux-gnueabihf LIBPATHS = -L=/opt/vc/lib -L=/usr/lib/arm-linux-gnueabihf LIBS = -lpthread -lstdc++ -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec \ -lfmt -lavutil -lswresample -lm -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 -lMagickWand-6.Q16 \ -lMagickCore-6.Q16 -ljsoncpp OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY) INCLUDES = -isystem=/usr/include/arm-linux-gnueabihf -isystem=/opt/vc/include -isystem=/usr/include/freetype2 -isystem=/usr/include/arm-linux-gnueabihf/ImageMagick-6 -isystem=/usr/include/ImageMagick-6 DEFINES += -DVOMP_PLATFORM_RASPBERRY -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 CXXFLAGS_EXTRA = $(SYSROOT) -Wno-psabi -mtune=cortex-a7 -mfloat-abi=hard -fopenmp endif CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -Wall -Wextra -Wshadow -Werror=return-type -Wmissing-format-attribute -Wdisabled-optimization -Wmissing-declarations -Wmissing-noreturn -Winit-self -Woverloaded-virtual -Wold-style-cast -Wconversion -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES) #CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES) CXXFLAGS_REL = $(DEFINES) -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES) .PHONY: clean fresh all install strip default: dev fresh: clean default %.o: %.cc @echo CC $@ $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $< vompclient: $(OBJECTS) @echo LD vompclient $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(LIBS) @echo Done strip: @echo STRIP vompclient $(Q)$(STRIP) vompclient dev: CXXFLAGS := $(CXXFLAGS_DEV) dev: vompclient release: CXXFLAGS := $(CXXFLAGS_REL) release: clean vompclient strip clean: rm -f *.o deps vompclient *~ fonts/*.o fonts/*~ teletxt/*.o ifndef SKIPDEPS deps: GNUmakefile @echo "DEPS" $(Q)$(CC) -MM $(SYSROOT) $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps endif ifneq ($(MAKECMDGOALS),clean) include deps endif