-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
63 lines (47 loc) · 1.67 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# demo makefile
#
PRJ_NAME := build-demo
ROOT_PATH := ..
MAKE_PATH := $(ROOT_PATH)/project/make
CC_OVERRIDE := yes
ifeq ($(OS),Windows_NT)
CC :=$(ROOT_PATH)/../../artifacts/clang/clang.exe
else
CC :=$(ROOT_PATH)/../../artifacts/clang/clang
endif
# CC?=clang
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
skip_goals = clean cleanout cleanall
include $(MAKE_PATH)/make_flags.mak
include $(MAKE_PATH)/make.mak
src_paths := \
$(ROOT_PATH)/pkg_a/module_a \
$(ROOT_PATH)/pkg_b/module_b \
$(ROOT_PATH)/pkg_b/module_c \
$(ROOT_PATH)/pkg_b/module_fix \
$(ROOT_PATH)/subfolder/pkg_c/module_sub_a \
$(ROOT_PATH)/subfolder/pkg_c/module_sub_b \
$(ROOT_PATH)/subfolder/pkg_c/module_untidy \
$(ROOT_PATH)/project/src
inc_dirs = $(foreach inc_path, $(sort $(src_paths)), -I $(inc_path))
c_files = $(foreach src_path, $(src_paths), $(wildcard $(src_path)/*.c))
C_FLAGS := $(_C_FLAGS)
INCS := $(inc_dirs)
$(foreach src, $(c_files),\
$(eval $(call create_rules_c,\
$(patsubst %$(suffix $(src)),$(BLD_PATH_OBJ)/%.o,$(notdir $(src))),$(src))) )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
.DEFAULT_GOAL := all
.PHONY: all prebuild postbuild clean
# full build process
all : prebuild $(OBJECTS) postbuild
prebuild :
$(silent)$(ECHO) '. building $(PRJ_NAME) '
postbuild : prebuild
$(silent)$(ECHO) '. '
$(silent)$(ECHO) '. make done for $(PRJ_NAME). '
$(silent)$(ECHO) '. '
clean:
$(silent)$(ECHO) "### removing directories $(BLD_ROOT)"
$(silent)$(RM) -rf $(BLD_ROOT)