1 | # $Id: Makefile.kmk 1724 2008-09-05 00:34:53Z bird $
|
---|
2 | ## @file
|
---|
3 | # Sub-makefile for kmk / GNU Make.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2004-2008 knut st. osmundsen <[email protected]>
|
---|
8 | #
|
---|
9 | # This file is part of kBuild.
|
---|
10 | #
|
---|
11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # kBuild is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with kBuild; if not, write to the Free Software
|
---|
23 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
24 | #
|
---|
25 | #
|
---|
26 |
|
---|
27 | SUB_DEPTH = ../..
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 |
|
---|
31 | #
|
---|
32 | # Template for kmk and the kmk_* binaries in this makefile.
|
---|
33 | #
|
---|
34 | TEMPLATE_BIN-KMK = Template for src/gmake binaries
|
---|
35 | TEMPLATE_BIN-KMK_EXTENDS = BIN
|
---|
36 | TEMPLATE_BIN-KMK_DEFS = \
|
---|
37 | HAVE_CONFIG_H \
|
---|
38 | $(TEMPLATE_BIN_DEFS) \
|
---|
39 | KBUILD_SVN_REV=$(KBUILD_SVN_REV)
|
---|
40 | TEMPLATE_BIN-KMK_DEPS = $(PATH_kmk)/config.h
|
---|
41 | TEMPLATE_BIN-KMK_CLEAN = $(TEMPLATE_BIN-KMK_DEPS)
|
---|
42 | TEMPLATE_BIN-KMK_DEPS.solaris = \
|
---|
43 | $(PATH_kmk)/fts.h \
|
---|
44 | $(PATH_kmk)/paths.h
|
---|
45 | TEMPLATE_BIN-KMK_CLEAN.solaris = $(TEMPLATE_BIN-KMK_DEPS.solaris)
|
---|
46 | TEMPLATE_BIN-KMK_DEPS.win = \
|
---|
47 | $(PATH_kmk)/fts.h \
|
---|
48 | $(PATH_kmk)/sysexits.h \
|
---|
49 | $(PATH_kmk)/unistd.h \
|
---|
50 | $(PATH_kmk)/paths.h \
|
---|
51 | $(PATH_kmk)/grp.h \
|
---|
52 | $(PATH_kmk)/pwd.h \
|
---|
53 | $(PATH_kmk)/inttypes.h
|
---|
54 | TEMPLATE_BIN-KMK_CFLAGS.win.amd64 = $(TEMPLATE_BIN_CFLAGS.win.amd64) -wd4244 -wd4267
|
---|
55 | TEMPLATE_BIN-KMK_CLEAN.win = $(TEMPLATE_BIN-KMK_DEPS.win)
|
---|
56 | TEMPLATE_BIN-KMK_INCS = $(PATH_kmk) . $(TEMPLATE_BIN_INCS)
|
---|
57 | TEMPLATE_BIN-KMK_INCS.darwin = glob
|
---|
58 | TEMPLATE_BIN-KMK_INCS.dragonfly = glob
|
---|
59 | TEMPLATE_BIN-KMK_INCS.freebsd = glob
|
---|
60 | TEMPLATE_BIN-KMK_INCS.solaris = glob
|
---|
61 | TEMPLATE_BIN-KMK_LIBS = $(TEMPLATE_BIN_LIBS) $(TARGET_kmkmissing) $(LIB_KUTIL)
|
---|
62 | ifdef ELECTRIC_HEAP # for electric heap (see electric.c) - windows only.
|
---|
63 | ifeq ($(KBUILD_TARGET),win)
|
---|
64 | TEMPLATE_BIN-KMK_CFLAGS = $(TEMPLATE_BIN_CFLAGS) /FI$(kmk_PATH)/electric.h -DELECTRIC_HEAP=1
|
---|
65 | else
|
---|
66 | TEMPLATE_BIN-KMK_CFLAGS = $(TEMPLATE_BIN_CFLAGS) -include $(kmk_PATH)/electric.h -DELECTRIC_HEAP=1
|
---|
67 | endif
|
---|
68 | endif
|
---|
69 |
|
---|
70 |
|
---|
71 | #
|
---|
72 | # A library containing the missing features needed by kmk and the
|
---|
73 | # kmk_* binaries. Saves a bit of work later on.
|
---|
74 | #
|
---|
75 | LIBRARIES += kmkmissing
|
---|
76 | kmkmissing_TEMPLATE = BIN-KMK
|
---|
77 | kmkmissing_DEFS = KMK
|
---|
78 | kmkmissing_NOINST = 1
|
---|
79 | kmkmissing_SOURCES = \
|
---|
80 | kmkbuiltin/err.c \
|
---|
81 | kmkbuiltin/setmode.c \
|
---|
82 | kmkbuiltin/strmode.c \
|
---|
83 | kmkbuiltin/kbuild_version.c \
|
---|
84 | kmkbuiltin/kbuild_protection.c \
|
---|
85 | getopt.c \
|
---|
86 | getopt1.c \
|
---|
87 | electric.c
|
---|
88 |
|
---|
89 | kmkmissing_SOURCES.darwin = \
|
---|
90 | kmkbuiltin/darwin.c \
|
---|
91 | glob/glob.c \
|
---|
92 | glob/fnmatch.c
|
---|
93 |
|
---|
94 | kmkmissing_SOURCES.dragonfly = \
|
---|
95 | glob/glob.c \
|
---|
96 | glob/fnmatch.c
|
---|
97 |
|
---|
98 | kmkmissing_SOURCES.freebsd = \
|
---|
99 | glob/glob.c \
|
---|
100 | glob/fnmatch.c
|
---|
101 |
|
---|
102 | kmkmissing_SOURCES.linux += \
|
---|
103 | kmkbuiltin/strlcpy.c
|
---|
104 |
|
---|
105 | kmkmissing_SOURCES.solaris = \
|
---|
106 | kmkbuiltin/strlcpy.c \
|
---|
107 | kmkbuiltin/solfakes.c \
|
---|
108 | kmkbuiltin/fts.c \
|
---|
109 | glob/glob.c \
|
---|
110 | glob/fnmatch.c
|
---|
111 |
|
---|
112 | kmkmissing_SOURCES.win += \
|
---|
113 | kmkbuiltin/strlcpy.c \
|
---|
114 | kmkbuiltin/mscfakes.c \
|
---|
115 | kmkbuiltin/fts.c \
|
---|
116 | glob/glob.c \
|
---|
117 | glob/fnmatch.c \
|
---|
118 | getloadavg.c \
|
---|
119 | w32/subproc/misc.c \
|
---|
120 | w32/subproc/sub_proc.c \
|
---|
121 | w32/subproc/w32err.c \
|
---|
122 | w32/compat/dirent.c \
|
---|
123 | w32/pathstuff.c
|
---|
124 |
|
---|
125 | #
|
---|
126 | # kmk
|
---|
127 | #
|
---|
128 | PROGRAMS += kmk
|
---|
129 |
|
---|
130 | kmk_TEMPLATE = BIN-KMK
|
---|
131 |
|
---|
132 | kmk_DEFS = \
|
---|
133 | NO_ARCHIVES \
|
---|
134 | EXPERIMENTAL \
|
---|
135 | CONFIG_WITH_TOUPPER_TOLOWER \
|
---|
136 | CONFIG_WITH_DEFINED \
|
---|
137 | CONFIG_WITH_EXPLICIT_MULTITARGET \
|
---|
138 | CONFIG_WITH_PREPEND_ASSIGNMENT \
|
---|
139 | CONFIG_WITH_LOCAL_VARIABLES \
|
---|
140 | CONFIG_WITH_2ND_TARGET_EXPANSION \
|
---|
141 | \
|
---|
142 | KMK \
|
---|
143 | KMK_HELPERS \
|
---|
144 | VARIABLE_HASH \
|
---|
145 | CONFIG_NO_DEFAULT_SUFFIXES \
|
---|
146 | CONFIG_NO_DEFAULT_PATTERN_RULES \
|
---|
147 | CONFIG_NO_DEFAULT_TERMINAL_RULES \
|
---|
148 | CONFIG_NO_DEFAULT_SUFFIX_RULES \
|
---|
149 | CONFIG_NO_DEFAULT_VARIABLES \
|
---|
150 | CONFIG_WITH_EXTENDED_NOTPARALLEL \
|
---|
151 | CONFIG_WITH_INCLUDEDEP \
|
---|
152 | CONFIG_WITH_VALUE_LENGTH \
|
---|
153 | CONFIG_WITH_RSORT \
|
---|
154 | CONFIG_WITH_ABSPATHEX \
|
---|
155 | CONFIG_WITH_COMPARE \
|
---|
156 | CONFIG_WITH_STACK \
|
---|
157 | CONFIG_WITH_MATH \
|
---|
158 | CONFIG_WITH_XARGS \
|
---|
159 | CONFIG_WITH_NANOTS \
|
---|
160 | CONFIG_WITH_SET_CONDITIONALS \
|
---|
161 | CONFIG_WITH_IF_CONDITIONALS \
|
---|
162 | CONFIG_WITH_DATE \
|
---|
163 | CONFIG_WITH_FILE_SIZE \
|
---|
164 | CONFIG_WITH_WHICH \
|
---|
165 | CONFIG_WITH_EVALPLUS \
|
---|
166 | CONFIG_WITH_MAKE_STATS \
|
---|
167 | CONFIG_WITH_COMMANDS_FUNC \
|
---|
168 | CONFIG_PRETTY_COMMAND_PRINTING \
|
---|
169 | \
|
---|
170 | KBUILD_HOST=\"$(KBUILD_TARGET)\" \
|
---|
171 | KBUILD_HOST_ARCH=\"$(KBUILD_TARGET_ARCH)\" \
|
---|
172 | KBUILD_HOST_CPU=\"$(KBUILD_TARGET_CPU)\"
|
---|
173 | kmk_DEFS.x86 = CONFIG_WITH_OPTIMIZATION_HACKS
|
---|
174 | kmk_DEFS.amd64 = CONFIG_WITH_OPTIMIZATION_HACKS
|
---|
175 | kmk_DEFS.win = CONFIG_NEW_WIN32_CTRL_EVENT
|
---|
176 |
|
---|
177 | kmk_SOURCES = \
|
---|
178 | main.c \
|
---|
179 | read.c \
|
---|
180 | expreval.c \
|
---|
181 | hash.c \
|
---|
182 | strcache.c \
|
---|
183 | variable.c \
|
---|
184 | ar.c \
|
---|
185 | arscan.c \
|
---|
186 | commands.c \
|
---|
187 | default.c \
|
---|
188 | dir.c \
|
---|
189 | expand.c \
|
---|
190 | file.c \
|
---|
191 | function.c \
|
---|
192 | implicit.c \
|
---|
193 | job.c \
|
---|
194 | misc.c \
|
---|
195 | remake.c \
|
---|
196 | rule.c \
|
---|
197 | signame.c \
|
---|
198 | version.c \
|
---|
199 | vpath.c \
|
---|
200 | remote-stub.c \
|
---|
201 | kbuild.c
|
---|
202 |
|
---|
203 | #
|
---|
204 | # kmkbuiltin commands
|
---|
205 | #
|
---|
206 | kmk_DEFS += CONFIG_WITH_KMK_BUILTIN
|
---|
207 | kmk_LIBS += $(LIB_KUTIL) $(LIB_KDEP)
|
---|
208 | kmk_SOURCES += \
|
---|
209 | kmkbuiltin.c \
|
---|
210 | kmkbuiltin/append.c \
|
---|
211 | kmkbuiltin/cat.c \
|
---|
212 | kmkbuiltin/chmod.c \
|
---|
213 | kmkbuiltin/cmp.c \
|
---|
214 | kmkbuiltin/cmp_util.c \
|
---|
215 | kmkbuiltin/cp.c \
|
---|
216 | kmkbuiltin/cp_utils.c \
|
---|
217 | kmkbuiltin/echo.c \
|
---|
218 | kmkbuiltin/expr.c \
|
---|
219 | kmkbuiltin/install.c \
|
---|
220 | kmkbuiltin/kDepIDB.c \
|
---|
221 | kmkbuiltin/md5sum.c \
|
---|
222 | kmkbuiltin/mkdir.c \
|
---|
223 | kmkbuiltin/mv.c \
|
---|
224 | kmkbuiltin/ln.c \
|
---|
225 | kmkbuiltin/printf.c \
|
---|
226 | kmkbuiltin/rm.c \
|
---|
227 | kmkbuiltin/rmdir.c \
|
---|
228 | kmkbuiltin/test.c \
|
---|
229 |
|
---|
230 | ## @todo kmkbuiltin/redirect.c
|
---|
231 |
|
---|
232 | ## Some profiling
|
---|
233 | #kmk_SOURCES += kbuildprf.c
|
---|
234 | #kmk_DEFS += open=prf_open read=prf_read lseek=prf_lseek close=prf_close
|
---|
235 | ##kmk_DEFS += KMK_PRF=1
|
---|
236 | ##kmkmissing_DEFS += KMK_PRF=1
|
---|
237 |
|
---|
238 | #
|
---|
239 | # Standalone kmkbuiltin commands.
|
---|
240 | #
|
---|
241 | PROGRAMS += \
|
---|
242 | kmk_append \
|
---|
243 | kmk_cat \
|
---|
244 | kmk_chmod \
|
---|
245 | kmk_cp \
|
---|
246 | kmk_cmp \
|
---|
247 | kmk_echo \
|
---|
248 | kmk_expr \
|
---|
249 | kmk_md5sum \
|
---|
250 | kmk_mkdir \
|
---|
251 | kmk_mv \
|
---|
252 | kmk_install \
|
---|
253 | kmk_ln \
|
---|
254 | kmk_printf \
|
---|
255 | kmk_redirect \
|
---|
256 | kmk_rm \
|
---|
257 | kmk_rmdir \
|
---|
258 | kmk_test \
|
---|
259 | kDepIDB \
|
---|
260 |
|
---|
261 | kmk_append_TEMPLATE = BIN-KMK
|
---|
262 | kmk_append_DEFS = kmk_builtin_append=main
|
---|
263 | kmk_append_INCS = .
|
---|
264 | kmk_append_SOURCES = \
|
---|
265 | kmkbuiltin/append.c
|
---|
266 |
|
---|
267 | kmk_cat_TEMPLATE = BIN-KMK
|
---|
268 | kmk_cat_DEFS = kmk_builtin_cat=main
|
---|
269 | kmk_cat_SOURCES = \
|
---|
270 | kmkbuiltin/cat.c
|
---|
271 |
|
---|
272 | kmk_chmod_TEMPLATE = BIN-KMK
|
---|
273 | kmk_chmod_DEFS = kmk_builtin_chmod=main
|
---|
274 | kmk_chmod_SOURCES = \
|
---|
275 | kmkbuiltin/chmod.c
|
---|
276 |
|
---|
277 | kmk_cmp_TEMPLATE = BIN-KMK
|
---|
278 | kmk_cmp_DEFS = kmk_builtin_cmp=main
|
---|
279 | kmk_cmp_SOURCES = \
|
---|
280 | kmkbuiltin/cmp.c \
|
---|
281 | kmkbuiltin/cmp_util.c
|
---|
282 |
|
---|
283 | kmk_cp_TEMPLATE = BIN-KMK
|
---|
284 | kmk_cp_DEFS = kmk_builtin_cp=main
|
---|
285 | kmk_cp_SOURCES = \
|
---|
286 | kmkbuiltin/cp.c \
|
---|
287 | kmkbuiltin/cp_utils.c \
|
---|
288 | kmkbuiltin/cmp_util.c
|
---|
289 |
|
---|
290 | kmk_echo_TEMPLATE = BIN-KMK
|
---|
291 | kmk_echo_DEFS = kmk_builtin_echo=main
|
---|
292 | kmk_echo_SOURCES = \
|
---|
293 | kmkbuiltin/echo.c
|
---|
294 |
|
---|
295 | kmk_expr_TEMPLATE = BIN-KMK
|
---|
296 | kmk_expr_DEFS = kmk_builtin_expr=main
|
---|
297 | kmk_expr_SOURCES = \
|
---|
298 | kmkbuiltin/expr.c
|
---|
299 |
|
---|
300 | kmk_install_TEMPLATE = BIN-KMK
|
---|
301 | kmk_install_DEFS = kmk_builtin_install=main
|
---|
302 | kmk_install_SOURCES = \
|
---|
303 | kmkbuiltin/install.c
|
---|
304 |
|
---|
305 | kmk_ln_TEMPLATE = BIN-KMK
|
---|
306 | kmk_ln_DEFS = kmk_builtin_ln=main
|
---|
307 | kmk_ln_SOURCES = \
|
---|
308 | kmkbuiltin/ln.c
|
---|
309 |
|
---|
310 | kmk_mkdir_TEMPLATE = BIN-KMK
|
---|
311 | kmk_mkdir_DEFS = kmk_builtin_mkdir=main
|
---|
312 | kmk_mkdir_SOURCES = \
|
---|
313 | kmkbuiltin/mkdir.c
|
---|
314 |
|
---|
315 | kmk_md5sum_TEMPLATE = BIN-KMK
|
---|
316 | kmk_md5sum_DEFS = kmk_builtin_md5sum=main
|
---|
317 | kmk_md5sum_SOURCES = \
|
---|
318 | kmkbuiltin/md5sum.c
|
---|
319 | kmk_md5sum_LIBS = $(LIB_KUTIL)
|
---|
320 |
|
---|
321 | kmk_mv_TEMPLATE = BIN-KMK
|
---|
322 | kmk_mv_DEFS = kmk_builtin_mv=main
|
---|
323 | kmk_mv_SOURCES = \
|
---|
324 | kmkbuiltin/mv.c
|
---|
325 |
|
---|
326 | kmk_printf_TEMPLATE = BIN-KMK
|
---|
327 | kmk_printf_DEFS = kmk_builtin_printf=main
|
---|
328 | kmk_printf_SOURCES = \
|
---|
329 | kmkbuiltin/printf.c
|
---|
330 |
|
---|
331 | kmk_rm_TEMPLATE = BIN-KMK
|
---|
332 | kmk_rm_DEFS = kmk_builtin_rm=main
|
---|
333 | kmk_rm_SOURCES = \
|
---|
334 | kmkbuiltin/rm.c
|
---|
335 |
|
---|
336 | kmk_redirect_TEMPLATE = BIN-KMK
|
---|
337 | kmk_redirect_DEFS = kmk_builtin_redirect=main
|
---|
338 | kmk_redirect_SOURCES = \
|
---|
339 | kmkbuiltin/redirect.c
|
---|
340 |
|
---|
341 | kmk_rmdir_TEMPLATE = BIN-KMK
|
---|
342 | kmk_rmdir_DEFS = kmk_builtin_rmdir=main
|
---|
343 | kmk_rmdir_SOURCES = \
|
---|
344 | kmkbuiltin/rmdir.c
|
---|
345 |
|
---|
346 | kmk_test_TEMPLATE = BIN-KMK
|
---|
347 | kmk_test_DEFS = kmk_builtin_test=main
|
---|
348 | kmk_test_SOURCES = \
|
---|
349 | kmkbuiltin/test.c
|
---|
350 |
|
---|
351 | kDepIDB_TEMPLATE = BIN-KMK
|
---|
352 | kDepIDB_DEFS = kmk_builtin_kDepIDB=main
|
---|
353 | kDepIDB_INCS = .
|
---|
354 | kDepIDB_LIBS = $(LIB_KDEP)
|
---|
355 | kDepIDB_SOURCES = \
|
---|
356 | kmkbuiltin/kDepIDB.c
|
---|
357 |
|
---|
358 |
|
---|
359 | #
|
---|
360 | # kmk_gmake - almost plain GNU Make.
|
---|
361 | #
|
---|
362 | PROGRAMS += kmk_gmake
|
---|
363 |
|
---|
364 | kmk_gmake_TEMPLATE = BIN-KMK
|
---|
365 | kmk_gmake_DEFS = \
|
---|
366 | HAVE_CONFIG_H \
|
---|
367 | NO_ARCHIVES \
|
---|
368 | CONFIG_WITH_TOUPPER_TOLOWER \
|
---|
369 | EXPERIMENTAL
|
---|
370 |
|
---|
371 | kmk_gmake_SOURCES = \
|
---|
372 | main.c \
|
---|
373 | read.c \
|
---|
374 | hash.c \
|
---|
375 | strcache.c \
|
---|
376 | variable.c \
|
---|
377 | ar.c \
|
---|
378 | arscan.c \
|
---|
379 | commands.c \
|
---|
380 | default.c \
|
---|
381 | dir.c \
|
---|
382 | expand.c \
|
---|
383 | file.c \
|
---|
384 | function.c \
|
---|
385 | implicit.c \
|
---|
386 | job.c \
|
---|
387 | misc.c \
|
---|
388 | remake.c \
|
---|
389 | rule.c \
|
---|
390 | signame.c \
|
---|
391 | version.c \
|
---|
392 | vpath.c \
|
---|
393 | remote-stub.c
|
---|
394 |
|
---|
395 |
|
---|
396 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
397 |
|
---|
398 |
|
---|
399 | #
|
---|
400 | # Use checked in config.h instead of running ./Configure for it.
|
---|
401 | #
|
---|
402 | kmk_config.h.$(KBUILD_TARGET) := $(kmk_PATH)/config.h.$(KBUILD_TARGET)
|
---|
403 | $(PATH_kmk)/config.h: $(kmk_config.h.$(KBUILD_TARGET))
|
---|
404 | $(MKDIR) -p $(dir $@)
|
---|
405 | $(CP) $^ $@
|
---|
406 |
|
---|
407 | #
|
---|
408 | # Some missing headers.
|
---|
409 | #
|
---|
410 | $(PATH_kmk)/fts.h: $(kmk_PATH)/kmkbuiltin/ftsfake.h | $(call DIRDEP,$(PATH_kmk))
|
---|
411 | $(CP) $^ $@
|
---|
412 |
|
---|
413 | $(PATH_kmk)/unistd.h: | $(call DIRDEP,$(PATH_kmk))
|
---|
414 | $(ECHO_EXT) > $@
|
---|
415 |
|
---|
416 | $(PATH_kmk)/sysexits.h: | $(call DIRDEP,$(PATH_kmk))
|
---|
417 | $(ECHO_EXT) > $@
|
---|
418 |
|
---|
419 | $(PATH_kmk)/inttypes.h: | $(call DIRDEP,$(PATH_kmk))
|
---|
420 | $(ECHO_EXT) > $@
|
---|
421 |
|
---|
422 | $(PATH_kmk)/paths.h: | $(call DIRDEP,$(PATH_kmk))
|
---|
423 | $(ECHO_EXT) > $@
|
---|
424 |
|
---|
425 | $(PATH_kmk)/pwd.h: | $(call DIRDEP,$(PATH_kmk))
|
---|
426 | $(ECHO_EXT) > $@
|
---|
427 |
|
---|
428 | $(PATH_kmk)/grp.h: | $(call DIRDEP,$(PATH_kmk))
|
---|
429 | $(ECHO_EXT) > $@
|
---|
430 |
|
---|
431 |
|
---|
432 | #
|
---|
433 | # Some tests.
|
---|
434 | #
|
---|
435 | parallel: parallel_1 parallel_2 parallel_3 parallel_4 parallel_5
|
---|
436 | parallel_1 parallel_2 parallel_3 parallel_4 parallel_5:
|
---|
437 | echo $@_start ; sleep 1; echo $@_done
|
---|
438 |
|
---|
439 | test:
|
---|
440 | echo "1"
|
---|
441 | echo "2"
|
---|
442 | echo "3"
|
---|
443 | echo "4"
|
---|
444 |
|
---|
445 |
|
---|
446 | #
|
---|
447 | # Shell execution tests.
|
---|
448 | #
|
---|
449 | test_shell: test_shell_quoting test_shell_double_quoting test_shell_newline
|
---|
450 |
|
---|
451 | # shell double and single quoting check (was busted on windows in 3.81).
|
---|
452 | test_shell_quoting:
|
---|
453 | $(ECHO_EXT) "double quoted sTrInG"
|
---|
454 | $(ECHO_EXT) "double quoted sTrInG" | $(SED_EXT) -e "s/sTrInG/string/g"
|
---|
455 | $(ECHO_EXT) 'single quoted sTrInG' | $(SED_EXT) -e 's/sTrInG/string/g'
|
---|
456 | $(ECHO) "This string should not be printed with double quotes."
|
---|
457 | $(ECHO) 'This string should not be printed with single quotes.'
|
---|
458 | ( echo " #define PWD \"`pwd`\""; )
|
---|
459 |
|
---|
460 | test_shell_double_quoting:
|
---|
461 | $(ECHO_EXT) "foo foo foo" | $(SED_EXT) -e \
|
---|
462 | "s/foo/$@/" -e \
|
---|
463 | "s/foo/works/" \
|
---|
464 | -e "s/foo/\!/"
|
---|
465 |
|
---|
466 | test_shell_double_quoting2:
|
---|
467 | $(ECHO_EXT) "foo foo foo" | $(SED_EXT) -e \
|
---|
468 | "s/foo/$@/" -e \
|
---|
469 | "s/foo/works/" \
|
---|
470 | -e\
|
---|
471 | "s/foo/\!/"
|
---|
472 |
|
---|
473 | # when using batch mode shell, the newline got escaped twice and spoiling everything.
|
---|
474 | test_shell_newline:
|
---|
475 | $(ECHO_EXT) "foo foo foo" | $(SED_EXT) -e \
|
---|
476 | 's/foo/$@/' -e \
|
---|
477 | 's/foo/works/' \
|
---|
478 | -e 's/foo/\!/'
|
---|
479 |
|
---|
480 |
|
---|
481 | test_stack:
|
---|
482 | $(MAKE) -f $(kmk_PATH)/testcase-stack.kmk
|
---|
483 |
|
---|
484 | test_math:
|
---|
485 | $(MAKE) -f $(kmk_PATH)/testcase-math.kmk
|
---|
486 |
|
---|
487 | test_if1of:
|
---|
488 | $(MAKE) -f $(kmk_PATH)/testcase-if1of.kmk
|
---|
489 |
|
---|
490 | test_local:
|
---|
491 | $(MAKE) -f $(kmk_PATH)/testcase-local.kmk
|
---|
492 |
|
---|
493 | test_includedep:
|
---|
494 | $(MAKE) -f $(kmk_PATH)/testcase-includedep.kmk
|
---|
495 |
|
---|
496 | test_2ndtargetexp:
|
---|
497 | $(MAKE) -f $(kmk_PATH)/testcase-2ndtargetexp.kmk
|
---|
498 |
|
---|
499 | test_30_continued_on_failure_worker:
|
---|
500 | this_executable_does_not_exist.exe
|
---|
501 | echo "We shouldn't see this..."
|
---|
502 |
|
---|
503 | test_30_continued_on_failure:
|
---|
504 | $(MAKE) -f $(MAKEFILE) test_30_continued_on_failure_worker; \
|
---|
505 | RC=$$?; \
|
---|
506 | if test $${RC} -ne 2; then \
|
---|
507 | echo "$@: FAILED - exit code $${RC} instead of 2."; \
|
---|
508 | exit 1; \
|
---|
509 | else \
|
---|
510 | echo "$@: SUCCESS"; \
|
---|
511 | fi
|
---|
512 |
|
---|
513 |
|
---|
514 | test_all: test_math test_stack test_shell test_if1of test_local test_includedep test_2ndtargetexp test_30_continued_on_failure
|
---|
515 |
|
---|