1 | # $Id: Makefile.kmk 530 2006-09-17 20:38:57Z bird $
|
---|
2 |
|
---|
3 |
|
---|
4 | #
|
---|
5 | # kmk
|
---|
6 | #
|
---|
7 | PROGRAMS += kmk
|
---|
8 |
|
---|
9 | kmk_TEMPLATE = BIN
|
---|
10 | kmk_DEPS = $(PATH_TARGET)/config.h
|
---|
11 | kmk_INCS = $(PATH_TARGET) .
|
---|
12 | #kmk_INCS.win32 = kmkbuiltin/w32
|
---|
13 |
|
---|
14 | kmk_DEFS = \
|
---|
15 | HAVE_CONFIG_H \
|
---|
16 | NO_ARCHIVES \
|
---|
17 | CONFIG_NO_DEFAULT_SUFFIXES \
|
---|
18 | CONFIG_NO_DEFAULT_PATTERN_RULES \
|
---|
19 | CONFIG_NO_DEFAULT_TERMINAL_RULES \
|
---|
20 | CONFIG_NO_DEFAULT_SUFFIX_RULES \
|
---|
21 | CONFIG_NO_DEFAULT_VARIABLES \
|
---|
22 | CONFIG_WITH_EXTENDED_NOTPARALLEL \
|
---|
23 | CONFIG_WITH_INCLUDEDEP \
|
---|
24 | CONFIG_WITH_TOUPPER_TOLOWER \
|
---|
25 | CONFIG_WITH_VALUE_LENGTH \
|
---|
26 | CONFIG_WITH_COMPARE \
|
---|
27 | KMK \
|
---|
28 | CONFIG_WITH_OPTIMIZATION_HACKS \
|
---|
29 | VARIABLE_HASH
|
---|
30 |
|
---|
31 | kmk_SOURCES = \
|
---|
32 | main.c \
|
---|
33 | read.c \
|
---|
34 | hash.c \
|
---|
35 | strcache.c \
|
---|
36 | variable.c \
|
---|
37 | ar.c \
|
---|
38 | arscan.c \
|
---|
39 | commands.c \
|
---|
40 | default.c \
|
---|
41 | dir.c \
|
---|
42 | expand.c \
|
---|
43 | file.c \
|
---|
44 | function.c \
|
---|
45 | implicit.c \
|
---|
46 | job.c \
|
---|
47 | misc.c \
|
---|
48 | remake.c \
|
---|
49 | rule.c \
|
---|
50 | signame.c \
|
---|
51 | version.c \
|
---|
52 | vpath.c \
|
---|
53 | remote-stub.c \
|
---|
54 | kbuild.c
|
---|
55 |
|
---|
56 | kmk_SOURCES.win32 = \
|
---|
57 | getopt.c \
|
---|
58 | getopt1.c \
|
---|
59 | getloadavg.c \
|
---|
60 | w32/subproc/misc.c \
|
---|
61 | w32/subproc/sub_proc.c \
|
---|
62 | w32/subproc/w32err.c \
|
---|
63 | glob/glob.c \
|
---|
64 | glob/fnmatch.c \
|
---|
65 | w32/compat/dirent.c \
|
---|
66 | w32/pathstuff.c
|
---|
67 |
|
---|
68 | kmk_SOURCES.freebsd = \
|
---|
69 | glob/glob.c \
|
---|
70 | glob/fnmatch.c
|
---|
71 |
|
---|
72 | #
|
---|
73 | # kmkbuiltin commands
|
---|
74 | #
|
---|
75 | kmk_DEFS += CONFIG_WITH_KMK_BUILTIN
|
---|
76 | kmk_SOURCES += \
|
---|
77 | kmkbuiltin.c \
|
---|
78 | kmkbuiltin/append.c \
|
---|
79 | kmkbuiltin/cp.c \
|
---|
80 | kmkbuiltin/cp_utils.c \
|
---|
81 | kmkbuiltin/echo.c \
|
---|
82 | kmkbuiltin/install.c \
|
---|
83 | kmkbuiltin/mkdir.c \
|
---|
84 | kmkbuiltin/ln.c \
|
---|
85 | kmkbuiltin/rm.c \
|
---|
86 | \
|
---|
87 | kmkbuiltin/err.c \
|
---|
88 | kmkbuiltin/setmode.c \
|
---|
89 | kmkbuiltin/strmode.c \
|
---|
90 | kmkbuiltin/strlcpy.c
|
---|
91 |
|
---|
92 | kmk_SOURCES.win32 += \
|
---|
93 | kmkbuiltin/mscfakes.c \
|
---|
94 | kmkbuiltin/fts.c
|
---|
95 |
|
---|
96 |
|
---|
97 | #
|
---|
98 | # Standalone kmkbuiltin commands.
|
---|
99 | #
|
---|
100 | PROGRAMS += kmk_append kmk_cp kmk_echo kmk_mkdir kmk_install kmk_ln kmk_rm
|
---|
101 |
|
---|
102 | kmk_append_TEMPLATE = BIN
|
---|
103 | kmk_append_DEFS = kmk_builtin_append=main
|
---|
104 | kmk_append_INCS = .
|
---|
105 | kmk_append_SOURCES = \
|
---|
106 | kmkbuiltin/append.c \
|
---|
107 | kmkbuiltin/err.c
|
---|
108 |
|
---|
109 | kmk_cp_TEMPLATE = BIN
|
---|
110 | kmk_cp_DEFS = kmk_builtin_cp=main
|
---|
111 | kmk_cp_SOURCES = \
|
---|
112 | kmkbuiltin/cp.c \
|
---|
113 | kmkbuiltin/cp_utils.c \
|
---|
114 | kmkbuiltin/strlcpy.c \
|
---|
115 | kmkbuiltin/err.c
|
---|
116 | kmk_cp_INCS.win32 = $(PATH_TARGET) .
|
---|
117 | kmk_cp_DEFS.win32 = HAVE_CONFIG_H
|
---|
118 | kmk_cp_SOURCES.win32 = \
|
---|
119 | kmkbuiltin/mscfakes.c \
|
---|
120 | kmkbuiltin/fts.c \
|
---|
121 | w32/compat/dirent.c \
|
---|
122 | getopt.c \
|
---|
123 | getopt1.c
|
---|
124 |
|
---|
125 | kmk_echo_TEMPLATE = BIN
|
---|
126 | kmk_echo_DEFS = kmk_builtin_echo=main
|
---|
127 | kmk_echo_SOURCES = \
|
---|
128 | kmkbuiltin/echo.c
|
---|
129 | kmk_echo_SOURCES.win32 = \
|
---|
130 | kmkbuiltin/mscfakes.c \
|
---|
131 | kmkbuiltin/err.c
|
---|
132 |
|
---|
133 | kmk_install_TEMPLATE = BIN
|
---|
134 | kmk_install_DEFS = kmk_builtin_install=main
|
---|
135 | kmk_install_SOURCES = \
|
---|
136 | kmkbuiltin/install.c \
|
---|
137 | kmkbuiltin/err.c \
|
---|
138 | kmkbuiltin/strmode.c \
|
---|
139 | kmkbuiltin/setmode.c
|
---|
140 | kmk_install_INCS.win32 = $(PATH_TARGET) .
|
---|
141 | kmk_install_DEFS.win32 = HAVE_CONFIG_H
|
---|
142 | kmk_install_SOURCES.win32 = \
|
---|
143 | kmkbuiltin/mscfakes.c \
|
---|
144 | getopt.c \
|
---|
145 | getopt1.c
|
---|
146 |
|
---|
147 | kmk_ln_TEMPLATE = BIN
|
---|
148 | kmk_ln_DEFS = kmk_builtin_ln=main
|
---|
149 | kmk_ln_SOURCES = \
|
---|
150 | kmkbuiltin/ln.c \
|
---|
151 | kmkbuiltin/err.c
|
---|
152 | kmk_ln_INCS.win32 = $(PATH_TARGET) .
|
---|
153 | kmk_ln_DEFS.win32 = HAVE_CONFIG_H
|
---|
154 | kmk_ln_SOURCES.win32 = \
|
---|
155 | kmkbuiltin/mscfakes.c\
|
---|
156 | getopt.c \
|
---|
157 | getopt1.c
|
---|
158 |
|
---|
159 | kmk_mkdir_TEMPLATE = BIN
|
---|
160 | kmk_mkdir_DEFS = kmk_builtin_mkdir=main
|
---|
161 | kmk_mkdir_SOURCES = \
|
---|
162 | kmkbuiltin/mkdir.c \
|
---|
163 | kmkbuiltin/err.c \
|
---|
164 | kmkbuiltin/setmode.c
|
---|
165 | kmk_mkdir_INCS.win32 = $(PATH_TARGET) .
|
---|
166 | kmk_mkdir_DEFS.win32 = HAVE_CONFIG_H
|
---|
167 | kmk_mkdir_SOURCES.win32 = \
|
---|
168 | kmkbuiltin/mscfakes.c \
|
---|
169 | getopt.c \
|
---|
170 | getopt1.c
|
---|
171 |
|
---|
172 | kmk_rm_TEMPLATE = BIN
|
---|
173 | kmk_rm_DEFS = kmk_builtin_rm=main
|
---|
174 | kmk_rm_SOURCES = \
|
---|
175 | kmkbuiltin/rm.c \
|
---|
176 | kmkbuiltin/err.c \
|
---|
177 | kmkbuiltin/strmode.c
|
---|
178 | kmk_rm_INCS.win32 = $(PATH_TARGET) .
|
---|
179 | kmk_rm_DEFS.win32 = HAVE_CONFIG_H
|
---|
180 | kmk_rm_SOURCES.win32 = \
|
---|
181 | kmkbuiltin/mscfakes.c\
|
---|
182 | getopt.c \
|
---|
183 | getopt1.c
|
---|
184 |
|
---|
185 |
|
---|
186 | #
|
---|
187 | # kmk_gmake - almost plain GNU Make.
|
---|
188 | #
|
---|
189 | PROGRAMS += kmk_gmake
|
---|
190 | kmk_gmake_TEMPLATE = BIN
|
---|
191 | kmk_gmake_DEPS = $(PATH_TARGET)/config.h
|
---|
192 | kmk_gmake_INCS = $(PATH_TARGET) .
|
---|
193 |
|
---|
194 | kmk_gmake_DEFS = \
|
---|
195 | HAVE_CONFIG_H \
|
---|
196 | NO_ARCHIVES \
|
---|
197 | CONFIG_WITH_TOUPPER_TOLOWER
|
---|
198 |
|
---|
199 | kmk_gmake_SOURCES = \
|
---|
200 | main.c \
|
---|
201 | read.c \
|
---|
202 | hash.c \
|
---|
203 | strcache.c \
|
---|
204 | variable.c \
|
---|
205 | ar.c \
|
---|
206 | arscan.c \
|
---|
207 | commands.c \
|
---|
208 | default.c \
|
---|
209 | dir.c \
|
---|
210 | expand.c \
|
---|
211 | file.c \
|
---|
212 | function.c \
|
---|
213 | implicit.c \
|
---|
214 | job.c \
|
---|
215 | misc.c \
|
---|
216 | remake.c \
|
---|
217 | rule.c \
|
---|
218 | signame.c \
|
---|
219 | version.c \
|
---|
220 | vpath.c \
|
---|
221 | remote-stub.c
|
---|
222 |
|
---|
223 | kmk_gmake_SOURCES.win32 = \
|
---|
224 | getopt.c \
|
---|
225 | getopt1.c \
|
---|
226 | getloadavg.c \
|
---|
227 | w32/subproc/misc.c \
|
---|
228 | w32/subproc/sub_proc.c \
|
---|
229 | w32/subproc/w32err.c \
|
---|
230 | glob/glob.c \
|
---|
231 | glob/fnmatch.c \
|
---|
232 | w32/compat/dirent.c \
|
---|
233 | w32/pathstuff.c
|
---|
234 |
|
---|
235 | kmk_gmake_SOURCES.freebsd = \
|
---|
236 | glob/glob.c \
|
---|
237 | glob/fnmatch.c
|
---|
238 |
|
---|
239 |
|
---|
240 |
|
---|
241 | DEPTH = ../..
|
---|
242 | include $(PATH_KBUILD)/rules.kmk
|
---|
243 |
|
---|
244 |
|
---|
245 | #
|
---|
246 | # Use checked in config.h instead of running ./Configure for it.
|
---|
247 | #
|
---|
248 | config.h.$(BUILD_TARGET) := config.h.$(BUILD_TARGET)
|
---|
249 | config.h.win := config.h.W32
|
---|
250 | config.h.win32 := config.h.W32
|
---|
251 | config.h.win64 := config.h.W32
|
---|
252 | config.h.nt := config.h.W32
|
---|
253 |
|
---|
254 | $(PATH_TARGET)/config.h: $(config.h.$(BUILD_TARGET))
|
---|
255 | $(MKDIR) -p $(dir $@)
|
---|
256 | $(CP) $^ $@
|
---|
257 |
|
---|
258 |
|
---|
259 | #
|
---|
260 | # Some tests.
|
---|
261 | #
|
---|
262 | parallel: parallel_1 parallel_2 parallel_3 parallel_4 parallel_5
|
---|
263 | parallel_1 parallel_2 parallel_3 parallel_4 parallel_5:
|
---|
264 | echo $@_start ; sleep 1; echo $@_done
|
---|
265 |
|
---|
266 | test:
|
---|
267 | echo "1"
|
---|
268 | echo "2"
|
---|
269 | echo "3"
|
---|
270 | echo "4"
|
---|
271 |
|
---|
272 | # shell double and single quoting check.
|
---|
273 | test_shell_quoting:
|
---|
274 | $(ECHO_EXT) "double quoted sTrInG" | $(SED_EXT) -e "s/sTrInG/string/g"
|
---|
275 | $(ECHO_EXT) 'single quoted sTrInG' | $(SED_EXT) -e 's/sTrInG/string/g'
|
---|
276 | $(ECHO) "This string should not be printed with double quotes."
|
---|
277 | $(ECHO) 'This string should not be printed with single quotes.'
|
---|