Makefile 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ##
  2. # Copyright (C) 2021 Alibaba Group Holding Limited
  3. # Author: LuChongzhi <chongzhi.lcz@alibaba-inc.com>
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License version 2 as
  7. # published by the Free Software Foundation.
  8. ##
  9. DIR_TO_ROOT=../../..
  10. include $(DIR_TO_ROOT)/build.param
  11. LIBOPENCV_INC = $(shell pkg-config --cflags opencv) -I./
  12. LIBOPENCV_LIBS = $(shell pkg-config --libs opencv)
  13. TARGET := libapp_utilities.a
  14. OUTPUT_DIR := $(DIR_TO_ROOT)/output/hal/
  15. #CFLAGS = -Wall -g -O0
  16. SRCS = $(wildcard *.cpp)
  17. OBJS = $(SRCS:.cpp=.o)
  18. all: $(TARGET)
  19. $(TARGET): $(OBJS)
  20. @mkdir -p $(OUTPUT_DIR)
  21. @echo "Linking" $@ "..."
  22. $(AR) -r -o $(OUTPUT_DIR)/$@ .obj/*.o
  23. $(OBJS): %.o:%.cpp
  24. @echo $(BUILD_LOG_START)
  25. @mkdir -p .obj
  26. @echo "Compiling" $< "..."
  27. $(CXX) $(CFLAGS) $(INCLUDE) $(LIBOPENCV_INC) $(LIBOPENCV_LIBS) -c -o .obj/$(notdir $@) $<
  28. @echo $(BUILD_LOG_END)
  29. clean:
  30. rm -rf .obj
  31. rm -f $(OUTPUT_DIR)/$(TARGET)
  32. .PHONY: clean all