-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (47 loc) · 1.48 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
#######################################################
# #
# Makefile #
# #
# Sean<SeanInApril@163.com> #
# #
# Usage: this file is part of project Chameleon #
# #
#######################################################
#######################################################
# entry of all #
#######################################################
include global.cfg
LIB_MODULES := $(foreach n,$(MODULES),lib/lib$(n).a)
TOPDIR := $(shell pwd)
.PHONY: all clean modules link
all: modules link
ifneq ($(modules),)
MODULES_TOBE_BUILT := $(modules)
else
MODULES_TOBE_BUILT := $(MODULES)
endif
modules:
@echo "build modules start..."
@for each_module in $(MODULES_TOBE_BUILT); \
do \
make -w -C $$each_module/src module_name=$$each_module top_dir=$(TOPDIR) -I$(TOPDIR); \
done
@echo "build modules end!"
ifneq ($(modules),)
link:
@echo "build modules only"
else
link: $(TARGET)
endif
$(TARGET): $(LIB_MODULES)
@echo "link start..."
$(LD) $^ -o $@
@echo "link end!"
clean:
@echo "clean start..."
@for each_module in $(MODULES); \
do \
make -w -C $$each_module/src clean module_name=$$each_module top_dir=$(TOPDIR) -I$(TOPDIR); \
done
rm -f $(TARGET)
@echo "clean end!"