-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
145 lines (108 loc) · 2.8 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
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kanetno
#
# file /home/mycure/kaneton/export/data/snapshot/Makefile
#
# created julien quintard [tue jun 26 11:27:22 2007]
# updated julien quintard [sat feb 5 12:11:16 2011]
#
#
# ---------- dependencies -----------------------------------------------------
#
-include environment/env.mk
#
# ---------- directives -------------------------------------------------------
#
.SILENT:
.PHONY: main initialize clean clear prototypes \
headers build install info
#
# ---------- variables --------------------------------------------------------
#
_PYTHON_ ?= $(KANETON_PYTHON)
_MAKE_ ?= $(MAKE)
#
# ---------- default rule -----------------------------------------------------
#
ifeq ($(_SIGNATURE_),kaneton)
PATHS = $(dir $(_COMPONENTS_))
main:
for path in $(PATHS) ; do \
if [ -f "$${path}/Makefile" ] ; then \
$(call env_launch,$${path}/Makefile,,) ; \
fi \
done
else
main \
clear \
prototypes \
headers \
build install \
info \
clean: initialize
$(_MAKE_) -f Makefile $@
endif
#
# ---------- environment ------------------------------------------------------
#
initialize:
cd environment/ && \
$(_PYTHON_) initialize.py && \
cd ..
#
# ---------- conditional ------------------------------------------------------
#
ifeq ($(_SIGNATURE_),kaneton)
#
# ---------- environment ------------------------------------------------------
#
clean:
$(call env_launch,$(_CLEAN_SCRIPT_),,)
#
# ---------- variables --------------------------------------------------------
#
SUBDIRS := boot environment kaneton \
license sample test tool \
$(PATHS)
#
# ---------- clear ------------------------------------------------------------
#
clear:
for d in $(SUBDIRS) ; do \
$(call env_launch,$${d}/Makefile,clear,) ; \
done
$(call env_purge,)
#
# ---------- prototypes -------------------------------------------------------
#
prototypes:
for d in $(SUBDIRS) ; do \
$(call env_launch,$${d}/Makefile,prototypes,) ; \
done
#
# ---------- headers ----------------------------------------------------------
#
headers:
for d in $(SUBDIRS) ; do \
$(call env_launch,$${d}/Makefile,headers,) ; \
done
#
# ---------- boot -------------------------------------------------------------
#
build:
$(call env_launch,$(_MBL_SCRIPT_),build,)
install: main
$(call env_launch,$(_MBL_SCRIPT_),install,)
#
# ---------- information ------------------------------------------------------
#
info:
$(call env_print,,,)
$(call env_print,"--- ",blue,$(ENV_OPTION_NO_NEWLINE))
$(call env_print,http://kaneton.opaak.org,,)
$(call env_print,,,)
endif