-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
148 lines (114 loc) · 3.12 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#############################################################################
# File [ Makefile ]
# Author [ littleshamoo ]
# Synopsis [ top makefile ]
# Date [ 2011/11/30 ]
#############################################################################
include common.mk
include setup.mk
include macro.mk
.PHONY : build lib add clean distclean
.SUFFIXES :
.SECONDARY : $(SECS)
build : $(STA_OBJS) $(TOP_BINS)
@echo -n ""
lib : $(LIBS)
@echo -n ""
add :
$(call gen_add_pkg)
clean :
$(AT)for pkg in $(PKG); do \
echo " CLEAN $$pkg $(PRT_MODE)"; \
rm -Rf $(TMP_TOP)/$(MODE)/$(TMP_DEP)/$(PKG_DIR)/$$pkg/*; \
rm -Rf $(TMP_TOP)/$(MODE)/$(TMP_LNY)/$(PKG_DIR)/$$pkg/*; \
rm -Rf $(TMP_TOP)/$(MODE)/$(TMP_QT)/$(PKG_DIR)/$$pkg/*; \
rm -Rf $(TMP_TOP)/$(MODE)/$(TMP_OBJ)/$(TMP_STA)/$(PKG_DIR)/$$pkg/*; \
rm -Rf $(TMP_TOP)/$(MODE)/$(TMP_OBJ)/$(TMP_DYN)/$(PKG_DIR)/$$pkg/*; \
rm -Rf $(INC_TOP)/$$pkg/*; \
done
@echo " RM binaries $(PRT_MODE)"
$(AT)rm -f $(TOP_BINS)
$(AT)rm -f $(BINS)
libclean :
@for lib in $(STA_LIBS) $(DYN_LIBS); do \
echo " CLEAN $$lib $(PRT_MODE)"; \
rm -f $(LIB_TOP)/$(MODE)/lib$${lib}.a; \
rm -f $(LIB_TOP)/$(MODE)/lib$${lib}.so; \
done
distclean :
@echo " RM build"
$(AT)rm -Rf $(TMP_TOP)
@echo " RM library"
$(AT)rm -Rf $(LIB_TOP)
@echo " RM include"
$(AT)rm -Rf $(INC_TOP)
@echo " RM binaries"
$(AT)rm -Rf $(BIN_TOP)
$(AT)rm -f $(RM_BINS)
$(AT)for dir in $(RM_BIN_DIRS); do \
if [ -d $$dir ]; then \
rmdir --ignore-fail-on-non-empty $$dir; \
fi \
done
$(TMP_TOP)/c_rule.mk : setup.mk
@echo " GEN $(notdir $@)"
$(call check_target_dir)
$(AT)rm -f $@
$(AT)touch $@
$(call gen_c_rule)
$(TMP_TOP)/lny_rule.mk : setup.mk
@echo " GEN $(notdir $@)"
$(call check_target_dir)
$(AT)rm -f $@
$(AT)touch $@
$(call gen_lny_rule)
$(TMP_TOP)/qt_rule.mk : setup.mk
@echo " GEN $(notdir $@)"
$(call check_target_dir)
$(AT)rm -f $@
$(AT)touch $@
$(call gen_qt_rule)
$(TMP_TOP)/cu_rule.mk : setup.mk
@echo " GEN $(notdir $@)"
$(call check_target_dir)
$(AT)rm -f $@
$(AT)touch $@
$(call gen_cu_rule)
$(TMP_TOP)/ld_rule.mk : setup.mk
@echo " GEN $(notdir $@)"
$(call check_target_dir)
$(AT)rm -f $@
$(AT)touch $@
$(call gen_ld_rule)
$(TMP_TOP)/lib_rule.mk : setup.mk
@echo " GEN $(notdir $@)"
$(call check_target_dir)
$(AT)rm -f $@
$(AT)touch $@
$(call gen_lib_rule)
$(TMP_TOP)/bin_rule.mk : setup.mk
@echo " GEN $(notdir $@)"
$(call check_target_dir)
$(AT)rm -f $@
$(AT)touch $@
$(call gen_bin_rule)
ifeq "$(MAKECMDGOALS)" ""
-include $(DEPS)
-include $(TMP_TOP)/c_rule.mk
-include $(TMP_TOP)/lny_rule.mk
-include $(TMP_TOP)/qt_rule.mk
-include $(TMP_TOP)/cu_rule.mk
-include $(TMP_TOP)/ld_rule.mk
-include $(TMP_TOP)/lib_rule.mk
-include $(TMP_TOP)/bin_rule.mk
endif
ifneq "$(filter $(MAKECMDGOALS),build lib)" ""
-include $(DEPS)
-include $(TMP_TOP)/c_rule.mk
-include $(TMP_TOP)/lny_rule.mk
-include $(TMP_TOP)/qt_rule.mk
-include $(TMP_TOP)/cu_rule.mk
-include $(TMP_TOP)/ld_rule.mk
-include $(TMP_TOP)/lib_rule.mk
-include $(TMP_TOP)/bin_rule.mk
endif