forked from noodle1983/framework-nd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (76 loc) · 2.29 KB
/
Copy pathMakefile
File metadata and controls
87 lines (76 loc) · 2.29 KB
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
#########################################
# top dir #
#########################################
PROJBASE=$(CURDIR)
#########################################
# target #
#########################################
TARGET=libBase
SUBDIR= Log \
Config \
Processor \
Net \
Message \
Fsm \
Script \
Data \
DesignPattern \
Utility \
WinPort \
DBI \
LibTest \
RELEASE_DIR = $(PROJBASE)/release
#########################################
# rules #
#########################################
include build/makefile.compiler
#########################################
# header and lib dependancy #
#########################################
SHARED_LIB_DIR=
SHARED_LIB=-lrt
include $(PROJBASE)/build/makefile.boost.header
include $(PROJBASE)/build/makefile.staticlib.boost.thread.linux
include $(PROJBASE)/build/makefile.staticlib.libevent.linux
include $(PROJBASE)/build/makefile.staticlib.log4cplus.linux
include $(PROJBASE)/build/makefile.staticlib.lua.linux
#########################################
# rules #
#########################################
all: $(SUBDIR)
@for DIR in $(SUBDIR); \
do \
make -C $$DIR || exit -1; \
done
test: release $(SUBDIR) $(OUTDIR)
@for DIR in $(SUBDIR); \
do \
make test -C $$DIR || exit -1; \
done
clean: $(SUBDIR)
@rm -rf $(RELEASE_DIR)
@for DIR in $(SUBDIR); \
do \
make clean -C $$DIR || exit -1; \
done
OBJECT_LIST_FILES = $(addprefix $(PROJBASE)/.lib/, $(addsuffix .objectlist, $(SUBDIR)))
ALL_OBJECT_LIST = `cat $(OBJECT_LIST_FILES)`
release: all
@rm -rf $(RELEASE_DIR)
@mkdir $(RELEASE_DIR) \
$(RELEASE_DIR)/include \
$(RELEASE_DIR)/lib
@for DIR in $(SUBDIR); \
do \
if [ -d "$(PROJBASE)/$$DIR/include" ]; then \
cd $(RELEASE_DIR)/include/ && \
cp ../../$$DIR/include/* . && \
cd $(PROJBASE) ; \
fi; \
done
cd $(RELEASE_DIR)/lib && \
$(AR) $(ARFLAGS) $(TARGET).a $(ALL_OBJECT_LIST) && \
$(RANLIB) $(TARGET).a \
#$(CC) $(SHAREDFLAG) -o $(TARGET).so $(ALL_OBJECT_LIST) $(STATIC_LIB) $(SHSRED_LIB)
cd $(PROJBASE)
.PHONY:all test clean release