# Switches for this Makefile: # VERBOSE - set to 1 to show all commands # SKIPDEPS - Skip regeneration of dependencies file include objects.mk # valid platforms are raspberry and crossraspberry vomp_platform=$(shell ./select-platform) $(info selected $(vomp_platform)) # uncomment the line below if you want to build vomp application without a reboot option, automatically set for windows! #vomp_options+= -DVOMP_HAS_EXIT CROSSROOT= 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 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 = -fuse-ld=gold $(PICTURES) #-fuse-ld=gold vomp_options += -DIPV6 LIBPATHS = -L/opt/vc/lib -L/usr/lib/arm-linux-gnueabihf LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY) CROSSLIBS = 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 PLATFORM = -DVOMP_PLATFORM_RASPBERRY CXXFLAGS_EXTRA = -Wno-psabi endif ifeq ($(vomp_platform),crossraspberry) $(info Raspberry Pi cross compiler) CC=arm-linux-gnueabihf-gcc STRIP=arm-linux-gnueabihf-strip CXX=arm-linux-gnueabihf-g++ LD=arm-linux-gnueabihf-g++ 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 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 LIBS = -lpthread -lrt -lbrcmEGL -lbrcmOpenVG -lopenmaxil -lbcm_host -lavformat -lavcodec -lavutil -lavresample LIBS += -ldl -lfontconfig -lfreetype -lMagick++-6.Q16 -lm OBJECTS = $(OBJ_COMMON) $(OBJ_RASPBERRY) CROSSLIBS = 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 PLATFORM = -DVOMP_PLATFORM_RASPBERRY CXXFLAGS_EXTRA = -mfloat-abi=hard endif 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) CXXFLAGS_REL = -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) -D_GNU_SOURCE $(PLATFORM) $(vomp_options) $(INCLUDES) .PHONY: clean fresh all install strip default: dev fresh: clean default %.o: %.cc @echo CC $@ $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $< vompclient: $(OBJECTS) $(CROSSLIBS) @echo LD vompclient $(Q)$(LD) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS) 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 $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps endif ifneq ($(MAKECMDGOALS),clean) include deps endif