-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
39 lines (25 loc) · 741 Bytes
/
makefile
File metadata and controls
39 lines (25 loc) · 741 Bytes
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
# makefile
OUT_PATH = $(abspath ./output)
SRC_PATH = $(abspath ./calc)
FINALL_TAG = $(OUT_PATH)/hello
all: $(FINALL_TAG)
SRC_LIST :=
include ./script/tool.mk
-include $(shell find $(SRC_PATH) -name local.mk)
SRC_O := $(patsubst %, %.o, $(SRC_LIST))
ifeq ($(CHECK),)
SRC_CPPCHECK := $(patsubst %, %_cppcheck, $(SRC_LIST))
else
SRC_CPPCHECK := $(patsubst %, %_cppcheck, $(CHECK))
endif
$(FINALL_TAG): $(patsubst %, $(OUT_PATH)/%, $(SRC_O))
gcc $^ -o $@ -g
cppcheck: $(SRC_CPPCHECK)
cppcheck_all:
cppcheck --enable=all --suppress=missingIncludeSystem \
$(patsubst %, -I $(SRC_PATH)/%, $(SRC_LIST)) $(patsubst %, $(SRC_PATH)/%, $(SRC_LIST))
.PHONY: all clean debug
clean:
rm $(OUT_PATH)/*
debug:
@echo DEBUG: $(MOUDLE_DIR)