-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.build
52 lines (33 loc) · 1.07 KB
/
makefile.build
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
#$(info $(OBJS))
#$(info $(SRCS))
$(OBJS): $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
$(COMPILE.c) $(OUTPUT_OPTION) $<
$(OBJS_CPP): $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(OBJ_DIR)
$(COMPILE.cpp) $(OUTPUT_OPTION) $<
.PHONY: $(TARGET_EXE)
$(TARGET_EXE): $(OBJ_TARGET_EXE) | $(OBJ_DIR)
@[ -L $@ ] || ln -sr $<
.PHONY: $(TARGET_LIB)
$(TARGET_LIB): $(OBJ_TARGET_LIB) | $(OBJ_DIR)
@[ -L $@ ] || ln -sr $<
$(TARGET_LIB_A): $(OBJ_TARGET_LIB_A) | $(OBJ_DIR)
@[ -L $@ ] || ln -sr $<
$(TARGET_LIB_SO): $(OBJ_TARGET_LIB_SO) | $(OBJ_DIR)
@[ -L $@ ] || ln -sr $<
$(OBJ_TARGET_EXE): $(OBJS) $(OBJS_CPP) | $(OBJ_DIR)
$(OBJ_TARGET_LIB): $(OBJ_TARGET_LIB)($(OBJS) $(OBJS_CPP)) | $(OBJ_DIR)
$(OBJ_TARGET_LIB_A): $(OBJ_TARGET_LIB_A)($(OBJS) $(OBJS_CPP)) | $(OBJ_DIR)
$(OBJ_TARGET_LIB_SO): $(OBJ_TARGET_LIB_SO)($(OBJS) $(OBJS_CPP)) | $(OBJ_DIR)
.PHONY: $(OBJ_DIR)
$(OBJ_DIR):
@[ -d $@ ] || mkdir -p $@
.PHONY: clean
clean:
-rm -rf $(OBJ_DIR)
.PHONY: clean_all
clean_all: clean clean_logs
-rm *.a *.so $(OBJ_DIR)
.PHONY: clean_logs
clean_logs:
-rm *.debug *.log *.trace
-include $(OBJ_DIR)/*.d