#华为智能相机项目makefile, SOURCES = $(wildcard ./src/*.cpp) #指定源文件列表, HEADERS = $(wildcard ./inc/*.h) OBJS = $(patsubst %.cpp,%.o,$(SOURCES)) #patsubst是把后面文件列表中所有.c结尾的文件替换成.o结尾的文件。 SOURCES_C = $(wildcard ./src/*.c) OBJS_C = $(patsubst %.c,%.o,$(SOURCES_C)) #SOURCES_REDIS = $(wildcard ./hiredis/*.c) #OBJS_REDIS = $(patsubst %.c,%.o, $(SOURCES_REDIS)) #SOURCES_REDISR = $(wildcard ./hiredis/hiredis/*.c) #OBJS_REDISR = $(patsubst %.c,%.o, $(SOURCES_REDISR)) OBJS += $(OBJS_C) #OBJS += $(SOURCES_REDIS) #OBJS += $(SOURCES_REDISR) TOOL_PREFIX = aarch64-himix100-linux- COMPILE_TOOLS = $(TOOL_PREFIX)gcc COMPILE_TOOLS_G++ = $(TOOL_PREFIX)g++ AR = $(TOOL_PREFIX)ar RANLIB = $(TOOL_PREFIX)ranlib #TARGET_MAP = libhisdk_hi3536_single_dbg.map IFLAG = -I./inc -I./inc/opencv2/core -I./inc/opencv2 -I./ -I./rapidjson -I./rapidjson/error -I./rapidjson/internal -I./common -I./spdlog/contrib -I./spdlog/details -I./spdlog/fmt -I./spdlog/sinks CFLAGS = $(IFLAG) -O0 -Wall -D __linux #CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon-vfpv4 LDFLAGS = -L./libs -L./ TARGET = sfd LIBS += -lcurl -lopencv_imgcodecs -lopencv_imgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann #-lzlib -llibjpeg -lgomp LIBS += -lopencv_highgui -lopencv_ml -lopencv_objdetect LIBS += -lopencv_photo -lopencv_superres -lnnie -lmpi -live -ldsp -lsecurec LIBS += -lopencv_video -lopencv_videostab -lopencv_shape -lopencv_videoio -lopencv_core LIBS += -lIlmImf -llibjasper -llibpng -llibtiff -llibwebp -lzlib -llibjpeg-turbo LIBS += -lsqlite3 #-lopencv_stitching .PHONY: all all : sfd sfd : $(OBJS) $(COMPILE_TOOLS_G++) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) -g -std=c++11 -fopenmp -pthread -lm #-lstdc++ %.o:%.cpp $(COMPILE_TOOLS_G++) $(CFLAGS) -std=c++11 -c -g $^ -o $@ -lstdc++ %.o:%.c $(COMPILE_TOOLS) $(CFLAGS) -c -g $^ -o $@ -lstdc++ clean: rm -f ./src/*.o sfd @echo $(SOURCES) @echo $(SOURCES_C) @echo $(OBJS)