ARC solution
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

78 行
1.3 KiB

  1. #
  2. # Makefile
  3. # Ilja Kartašov, 2019-03-02 17:32
  4. #
  5. .POSIX:
  6. # Project directories
  7. SRC_DIR ?= src
  8. SDK_DIR ?= sdk
  9. CSTUFF_DIR ?= cStuff
  10. OUT_DIR ?= ./build
  11. # Project definition
  12. include project.mk
  13. # CFLAGS
  14. CFLAGS := \
  15. $(PROJECT_INCLUDES) \
  16. -std=c99 \
  17. -pedantic \
  18. -Wall \
  19. -Wmissing-prototypes \
  20. -Wstrict-prototypes \
  21. -Wold-style-definition \
  22. -O2 \
  23. -s \
  24. -fvisibility=hidden \
  25. -DVERSION_MAJOR=$(PROJECT_VERSION_MAJOR) \
  26. -DVERSION_MINOR=$(PROJECT_VERSION_MINOR) \
  27. -DVERSION_TWEAK=$(PROJECT_VERSION_TWEAK) \
  28. -DVERSION_LABEL=$(PROJECT_VERSION_LABEL) \
  29. $(PROJECT_CFLAGS) \
  30. $(CFLAGS) \
  31. LDFLAGS := \
  32. $(PROJECT_LIBRARIES) \
  33. $(LDFLAGS) \
  34. $(PROJECT_LDFLAGS) \
  35. SOURCE_LIST := $(wildcard $(PROJECT_SOURCES))
  36. OBJECT_FILES := $(addprefix $(OUT_DIR)/o_, ${SOURCE_LIST:.c=.o})
  37. project: dirs $(OBJECT_FILES)
  38. $(info linking target: $@)
  39. @$(CC) -o $(OUT_DIR)/$(PROJECT_NAME) $(OBJECT_FILES) $(LDFLAGS)
  40. $(info done: $@)
  41. build/o_%.o: %.c
  42. $(info compiling file: $<)
  43. @$(CC) $(CFLAGS) -c $< -o $@
  44. dirs:
  45. $(info preparing: build folders)
  46. @mkdir -p $(OUT_DIR)/o_$(SRC_DIR)
  47. @mkdir -p $(OUT_DIR)/o_$(CSTUFF_DIR)
  48. @mkdir -p $(OUT_DIR)/o_$(SDK_DIR)/components
  49. @mkdir -p $(OUT_DIR)/o_$(SDK_DIR)/mods
  50. clean:
  51. $(info cleaning: build files)
  52. @rm -Rf $(OUT_DIR)
  53. @rm -Rf ./vgcore.*
  54. all: project
  55. default: project
  56. .PHONY: all dirs clean
  57. # vim:ft=make
  58. #