-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
102 lines (85 loc) · 2.36 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
include make.cfg
COLOR_OBJ = $(COLOR_CYAN)
COLOR_TAG = $(COLOR_YELLOW)
COLOR_TXT = $(COLOR_GREEN)
############################################################################
MAKE=make
RM=@rm -rf
BUILD_PWD=$(shell pwd)
DEMO_SRCDIR=$(BUILD_PWD)/demo
CORE_SRCDIR=$(BUILD_PWD)/core
ENCODING_SRCDIR=$(BUILD_PWD)/encoding
SOCKET_SRCDIR=$(BUILD_PWD)/socket
TYPE_SRCDIR=$(BUILD_PWD)/type
LOGGER_SRCDIR=$(BUILD_PWD)/logger
DLIST_SRCDIR=$(BUILD_PWD)/dlist
LIB_SRCDIR_LIST=$(CORE_SRCDIR) $(ENCODING_SRCDIR) $(SOCKET_SRCDIR) $(TYPE_SRCDIR) $(DLIST_SRCDIR) $(DEMO_SRCDIR)
############################################################################
all: prepare
@for DIR in $(LIB_SRCDIR_LIST); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
prepare:
@echo $(BUILD_PWD)
@-if [ ! -d $(LIB_ROOT_DIR) ];then mkdir $(LIB_ROOT_DIR); fi
@-if [ ! -d $(BIN_ROOT_DIR) ];then mkdir $(BIN_ROOT_DIR); fi
cores: prepare
@for DIR in $(CORE_SRCDIR); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
encodings: prepare
@for DIR in $(ENCODING_SRCDIR); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
sockets: prepare
@for DIR in $(SOCKET_SRCDIR); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
types: prepare
@for DIR in $(TYPE_SRCDIR); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
loggers: prepare
@for DIR in $(LOGGER_SRCDIR); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
dlist: prepare
@for DIR in $(DLIST_SRCDIR); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
demo: prepare
@for DIR in $(DEMO_SRCDIR); do \
cd $$DIR; \
$(MAKE) all || exit "$$?"; \
cd $(BUILD_PWD); \
done
clean: prepare
@for DIR in $(LIB_SRCDIR_LIST); do \
cd $$DIR; \
$(MAKE) clean || exit "$$?"; \
cd $(BUILD_PWD); \
done
distclean:
@for DIR in $(LIB_SRCDIR_LIST); do \
cd $$DIR; \
$(MAKE) distclean || exit "$$?"; \
cd $(BUILD_PWD); \
done
-$(RM) $(LIB_ROOT_DIR)
-$(RM) $(BIN_ROOT_DIR)
rebuild: distclean all
.PHONY: all prepare clean distclean rebuild demo types sockets encodings cores