VirtualBox

source: kBuild/trunk/src/kmk/Makefile.kmk@ 2907

Last change on this file since 2907 was 2907, checked in by bird, 8 years ago

do fprintf too.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 14.5 KB
Line 
1# $Id: Makefile.kmk 2907 2016-09-09 22:33:26Z bird $
2## @file
3# Sub-makefile for kmk / GNU Make.
4#
5
6#
7# Copyright (c) 2004-2011 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 3 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, see <http://www.gnu.org/licenses/>
23#
24#
25
26SUB_DEPTH = ../..
27include $(KBUILD_PATH)/subheader.kmk
28
29
30#
31# Template for kmk and the kmk_* binaries in this makefile.
32#
33TEMPLATE_BIN-KMK = Template for src/gmake binaries
34TEMPLATE_BIN-KMK_EXTENDS = BIN-THREADED
35TEMPLATE_BIN-KMK_DEFS = \
36 HAVE_CONFIG_H \
37 $(TEMPLATE_BIN_DEFS) \
38 KBUILD_SVN_REV=$(KBUILD_SVN_REV) \
39 KBUILD_TYPE=\"$(KBUILD_TYPE)\"
40TEMPLATE_BIN-KMK_DEPS = \
41 $(kmk_0_OUTDIR)/config.h \
42 $(kmk_0_OUTDIR)/fts.h
43TEMPLATE_BIN-KMK_CLEAN = $(TEMPLATE_BIN-KMK_DEPS)
44TEMPLATE_BIN-KMK_DEPS.solaris = \
45 $(kmk_0_OUTDIR)/paths.h
46TEMPLATE_BIN-KMK_CLEAN.solaris = $(TEMPLATE_BIN-KMK_DEPS.solaris)
47TEMPLATE_BIN-KMK_DEPS.win = \
48 $(kmk_0_OUTDIR)/sysexits.h \
49 $(kmk_0_OUTDIR)/unistd.h \
50 $(kmk_0_OUTDIR)/paths.h \
51 $(kmk_0_OUTDIR)/grp.h \
52 $(kmk_0_OUTDIR)/pwd.h \
53 $(kmk_0_OUTDIR)/inttypes.h
54TEMPLATE_BIN-KMK_CFLAGS.win.amd64 = $(TEMPLATE_BIN-THREADED_CFLAGS.win.amd64) -wd4244 -wd4267
55TEMPLATE_BIN-KMK_CLEAN.win = $(TEMPLATE_BIN-KMK_DEPS.win)
56TEMPLATE_BIN-KMK_INCS = $(kmk_0_OUTDIR) . $(TEMPLATE_BIN-THREADED_INCS)
57ifneq ($(KBUILD_TARGET),os2)
58 TEMPLATE_BIN-KMK_INCS += glob
59endif
60TEMPLATE_BIN-KMK_LIBS = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS) $(kmkmissing_1_TARGET) $(LIB_KUTIL)
61ifdef ELECTRIC_HEAP # for electric heap (see electric.c) - windows only.
62ifeq ($(KBUILD_TARGET),win)
63 TEMPLATE_BIN-KMK_CFLAGS = $(TEMPLATE_BIN-THREADED_CFLAGS) /FI$(kmk_DEFPATH)/electric.h -DELECTRIC_HEAP=1
64else
65 TEMPLATE_BIN-KMK_CFLAGS = $(TEMPLATE_BIN-THREADED_CFLAGS) -include $(kmk_DEFPATH)/electric.h -DELECTRIC_HEAP=1
66endif
67endif
68# GCC sanitizers.
69ifdef GCC_SANITIZERS
70 TEMPLATE_BIN-KMK_CFLAGS ?= $(TEMPLATE_BIN-THREADED_CFLAGS)
71 TEMPLATE_BIN-KMK_CFLAGS += -fsanitize=address -fsanitize=undefined -static-libubsan -D GCC_ADDRESS_SANITIZER
72 TEMPLATE_BIN-KMK_LDFLAGS ?= $(TEMPLATE_BIN-THREADED_LDFLAGS)
73 TEMPLATE_BIN-KMK_LDFLAGS += -fsanitize=address -fsanitize=undefined
74endif
75
76
77#
78# A library containing the missing features needed by kmk and the
79# kmk_* binaries. Saves a bit of work later on.
80#
81LIBRARIES += kmkmissing
82kmkmissing_TEMPLATE = BIN-KMK
83kmkmissing_DEFS = KMK
84kmkmissing_NOINST = 1
85kmkmissing_SOURCES = \
86 kmkbuiltin/err.c \
87 kmkbuiltin/fts.c \
88 kmkbuiltin/setmode.c \
89 kmkbuiltin/strmode.c \
90 kmkbuiltin/kbuild_protection.c \
91 getopt.c \
92 getopt1.c \
93 electric.c
94ifneq ($(KBUILD_TARGET),os2)
95kmkmissing_SOURCES += \
96 glob/glob.c
97endif
98
99kmkmissing_SOURCES.darwin = \
100 kmkbuiltin/darwin.c \
101 glob/fnmatch.c
102
103kmkmissing_SOURCES.dragonfly = \
104 glob/fnmatch.c
105
106kmkmissing_SOURCES.freebsd = \
107 glob/fnmatch.c
108
109kmkmissing_SOURCES.haiku = \
110 kmkbuiltin/haikufakes.c \
111 glob/fnmatch.c
112
113kmkmissing_SOURCES.linux += \
114 kmkbuiltin/strlcpy.c
115
116kmkmissing_SOURCES.openbsd = \
117 kmkbuiltin/openbsd.c
118
119kmkmissing_SOURCES.solaris = \
120 kmkbuiltin/strlcpy.c \
121 kmkbuiltin/solfakes.c \
122 glob/fnmatch.c
123
124kmkmissing_SOURCES.win += \
125 kmkbuiltin/strlcpy.c \
126 kmkbuiltin/mscfakes.c \
127 glob/fnmatch.c \
128 getloadavg.c \
129 w32/subproc/misc.c \
130 w32/subproc/w32err.c \
131 w32/pathstuff.c \
132 w32/imagecache.c
133
134#
135# kmk
136#
137PROGRAMS += kmk
138
139kmk_TEMPLATE = BIN-KMK
140
141kmk_DEFS = \
142 NO_ARCHIVES \
143 EXPERIMENTAL \
144 CONFIG_WITH_TOUPPER_TOLOWER \
145 CONFIG_WITH_DEFINED \
146 CONFIG_WITH_EXPLICIT_MULTITARGET \
147 CONFIG_WITH_DOT_MUST_MAKE \
148 CONFIG_WITH_PREPEND_ASSIGNMENT \
149 CONFIG_WITH_LOCAL_VARIABLES \
150 CONFIG_WITH_2ND_TARGET_EXPANSION \
151 CONFIG_WITH_ALLOC_CACHES \
152 CONFIG_WITH_STRCACHE2 \
153 \
154 KMK \
155 KMK_HELPERS \
156 CONFIG_NO_DEFAULT_SUFFIXES \
157 CONFIG_NO_DEFAULT_PATTERN_RULES \
158 CONFIG_NO_DEFAULT_TERMINAL_RULES \
159 CONFIG_NO_DEFAULT_SUFFIX_RULES \
160 CONFIG_NO_DEFAULT_VARIABLES \
161 \
162 CONFIG_WITH_ABSPATHEX \
163 CONFIG_WITH_COMMANDS_FUNC \
164 CONFIG_WITH_DATE \
165 CONFIG_WITH_DEFINED_FUNCTIONS \
166 CONFIG_WITH_EVALPLUS \
167 CONFIG_WITH_FILE_SIZE \
168 CONFIG_WITH_LOOP_FUNCTIONS \
169 CONFIG_WITH_MATH \
170 CONFIG_WITH_NANOTS \
171 CONFIG_WITH_ROOT_FUNC \
172 CONFIG_WITH_RSORT \
173 CONFIG_WITH_STACK \
174 CONFIG_WITH_STRING_FUNCTIONS \
175 CONFIG_WITH_WHERE_FUNCTION \
176 CONFIG_WITH_WHICH \
177 CONFIG_WITH_XARGS \
178 \
179 CONFIG_WITH_EXTENDED_NOTPARALLEL \
180 CONFIG_WITH_INCLUDEDEP \
181 CONFIG_WITH_VALUE_LENGTH \
182 CONFIG_WITH_COMPARE \
183 CONFIG_WITH_SET_CONDITIONALS \
184 CONFIG_WITH_IF_CONDITIONALS \
185 CONFIG_WITH_PRINTF \
186 CONFIG_WITH_MINIMAL_STATS \
187 \
188 CONFIG_PRETTY_COMMAND_PRINTING \
189 CONFIG_WITH_PRINT_STATS_SWITCH \
190 CONFIG_WITH_PRINT_TIME_SWITCH \
191 CONFIG_WITH_RDONLY_VARIABLE_VALUE \
192 CONFIG_WITH_LAZY_DEPS_VARS \
193 CONFIG_WITH_MEMORY_OPTIMIZATIONS \
194 \
195 KBUILD_HOST=\"$(KBUILD_TARGET)\" \
196 KBUILD_HOST_ARCH=\"$(KBUILD_TARGET_ARCH)\" \
197 KBUILD_HOST_CPU=\"$(KBUILD_TARGET_CPU)\"
198# kmk_DEFS += CONFIG_WITH_COMPILER # experimental, doesn't work 101% right it seems.
199kmk_DEFS.x86 = CONFIG_WITH_OPTIMIZATION_HACKS
200kmk_DEFS.amd64 = CONFIG_WITH_OPTIMIZATION_HACKS
201kmk_DEFS.win = CONFIG_NEW_WIN32_CTRL_EVENT CONFIG_WITH_FAST_IS_SPACE
202kmk_DEFS.debug = CONFIG_WITH_MAKE_STATS
203ifdef CONFIG_WITH_MAKE_STATS
204 kmk_DEFS += CONFIG_WITH_MAKE_STATS
205endif
206ifdef CONFIG_WITH_EVAL_COMPILER
207 kmk_DEFS += CONFIG_WITH_EVAL_COMPILER
208endif
209ifdef CONFIG_WITH_COMPILE_EVERYTHING
210 kmk_DEFS += CONFIG_WITH_COMPILE_EVERYTHING
211endif
212
213kmk_SOURCES = \
214 main.c \
215 read.c \
216 hash.c \
217 strcache.c \
218 variable.c \
219 ar.c \
220 arscan.c \
221 commands.c \
222 default.c \
223 expand.c \
224 file.c \
225 function.c \
226 implicit.c \
227 job.c \
228 misc.c \
229 remake.c \
230 rule.c \
231 signame.c \
232 version.c \
233 vpath.c \
234 remote-stub.c \
235 \
236 alloccache.c \
237 expreval.c \
238 incdep.c \
239 strcache2.c \
240 kmk_cc_exec.c \
241 kbuild.c \
242 kbuild-object.c
243ifeq ($(KBUILD_TARGET),win)
244 kmk_SOURCES += dir-nt-bird.c
245else
246 kmk_SOURCES += dir.c
247endif
248
249kmk_SOURCES.win = \
250 w32/subproc/sub_proc.c
251
252kmk_DEFS.freebsd.x86 = CONFIG_WITHOUT_THREADS
253
254#kmk_LIBS.solaris = malloc
255#kmk_DEFS.solaris += HAVE_MALLINFO
256
257#
258# kmkbuiltin commands
259#
260kmk_DEFS += CONFIG_WITH_KMK_BUILTIN
261kmk_LIBS += $(LIB_KUTIL) #$(LIB_KDEP)
262kmk_SOURCES += \
263 kmkbuiltin.c \
264 kmkbuiltin/append.c \
265 kmkbuiltin/cat.c \
266 kmkbuiltin/chmod.c \
267 kmkbuiltin/cmp.c \
268 kmkbuiltin/cmp_util.c \
269 kmkbuiltin/cp.c \
270 kmkbuiltin/cp_utils.c \
271 kmkbuiltin/echo.c \
272 kmkbuiltin/expr.c \
273 kmkbuiltin/install.c \
274 kmkbuiltin/kDepIDB.c \
275 kmkbuiltin/kDepObj.c \
276 ../lib/kDep.c \
277 kmkbuiltin/md5sum.c \
278 kmkbuiltin/mkdir.c \
279 kmkbuiltin/mv.c \
280 kmkbuiltin/ln.c \
281 kmkbuiltin/printf.c \
282 kmkbuiltin/rm.c \
283 kmkbuiltin/rmdir.c \
284 $(if-expr $(KBUILD_TARGET) == win,kmkbuiltin/kSubmit.c) \
285 kmkbuiltin/sleep.c \
286 kmkbuiltin/test.c
287
288## @todo kmkbuiltin/redirect.c
289
290## Some profiling
291#kmk_SOURCES += kbuildprf.c
292#kmk_DEFS += open=prf_open read=prf_read lseek=prf_lseek close=prf_close
293##kmk_DEFS += KMK_PRF=1
294##kmkmissing_DEFS += KMK_PRF=1
295
296#
297# Standalone kmkbuiltin commands.
298#
299PROGRAMS += \
300 kmk_append \
301 kmk_cat \
302 kmk_chmod \
303 kmk_cp \
304 kmk_cmp \
305 kmk_echo \
306 kmk_expr \
307 kmk_md5sum \
308 kmk_mkdir \
309 kmk_mv \
310 kmk_install \
311 kmk_ln \
312 kmk_printf \
313 kmk_redirect \
314 kmk_rm \
315 kmk_rmdir \
316 kmk_sleep \
317 kmk_test \
318 kDepIDB \
319 kDepObj \
320
321kmk_append_TEMPLATE = BIN-KMK
322kmk_append_DEFS = kmk_builtin_append=main
323kmk_append_INCS = .
324kmk_append_SOURCES = \
325 kmkbuiltin/append.c
326
327kmk_cat_TEMPLATE = BIN-KMK
328kmk_cat_DEFS = kmk_builtin_cat=main
329kmk_cat_SOURCES = \
330 kmkbuiltin/cat.c
331
332kmk_chmod_TEMPLATE = BIN-KMK
333kmk_chmod_DEFS = kmk_builtin_chmod=main
334kmk_chmod_SOURCES = \
335 kmkbuiltin/chmod.c
336
337kmk_cmp_TEMPLATE = BIN-KMK
338kmk_cmp_DEFS = kmk_builtin_cmp=main
339kmk_cmp_SOURCES = \
340 kmkbuiltin/cmp.c \
341 kmkbuiltin/cmp_util.c
342
343kmk_cp_TEMPLATE = BIN-KMK
344kmk_cp_DEFS = kmk_builtin_cp=main
345kmk_cp_SOURCES = \
346 kmkbuiltin/cp.c \
347 kmkbuiltin/cp_utils.c \
348 kmkbuiltin/cmp_util.c
349
350kmk_echo_TEMPLATE = BIN-KMK
351kmk_echo_DEFS = kmk_builtin_echo=main
352kmk_echo_SOURCES = \
353 kmkbuiltin/echo.c
354
355kmk_expr_TEMPLATE = BIN-KMK
356kmk_expr_DEFS = kmk_builtin_expr=main
357kmk_expr_SOURCES = \
358 kmkbuiltin/expr.c
359
360kmk_install_TEMPLATE = BIN-KMK
361kmk_install_DEFS = kmk_builtin_install=main
362kmk_install_SOURCES = \
363 kmkbuiltin/install.c
364
365kmk_ln_TEMPLATE = BIN-KMK
366kmk_ln_DEFS = kmk_builtin_ln=main
367kmk_ln_SOURCES = \
368 kmkbuiltin/ln.c
369
370kmk_mkdir_TEMPLATE = BIN-KMK
371kmk_mkdir_DEFS = kmk_builtin_mkdir=main
372kmk_mkdir_SOURCES = \
373 kmkbuiltin/mkdir.c
374
375kmk_md5sum_TEMPLATE = BIN-KMK
376kmk_md5sum_DEFS = kmk_builtin_md5sum=main
377kmk_md5sum_SOURCES = \
378 kmkbuiltin/md5sum.c
379kmk_md5sum_LIBS = $(LIB_KUTIL)
380
381kmk_mv_TEMPLATE = BIN-KMK
382kmk_mv_DEFS = kmk_builtin_mv=main
383kmk_mv_SOURCES = \
384 kmkbuiltin/mv.c
385
386kmk_printf_TEMPLATE = BIN-KMK
387kmk_printf_DEFS = kmk_builtin_printf=main
388kmk_printf_SOURCES = \
389 kmkbuiltin/printf.c
390
391kmk_rm_TEMPLATE = BIN-KMK
392kmk_rm_DEFS = kmk_builtin_rm=main
393kmk_rm_SOURCES = \
394 kmkbuiltin/rm.c
395
396kmk_redirect_TEMPLATE = BIN-KMK
397kmk_redirect_DEFS = kmk_builtin_redirect=main
398kmk_redirect_SOURCES = \
399 kmkbuiltin/redirect.c
400kmk_redirect_SOURCES.win = \
401 ../lib/startuphacks-win.c
402
403kmk_rmdir_TEMPLATE = BIN-KMK
404kmk_rmdir_DEFS = kmk_builtin_rmdir=main
405kmk_rmdir_SOURCES = \
406 kmkbuiltin/rmdir.c
407
408kmk_sleep_TEMPLATE = BIN-KMK
409kmk_sleep_DEFS = kmk_builtin_sleep=main
410kmk_sleep_SOURCES = \
411 kmkbuiltin/sleep.c
412
413kmk_test_TEMPLATE = BIN-KMK
414kmk_test_DEFS = kmk_builtin_test=main
415kmk_test_SOURCES = \
416 kmkbuiltin/test.c
417
418kDepIDB_TEMPLATE = BIN-KMK
419kDepIDB_DEFS = kmk_builtin_kDepIDB=main
420kDepIDB_INCS = .
421kDepIDB_LIBS = $(LIB_KDEP) $(LIB_KUTIL)
422kDepIDB_SOURCES = \
423 kmkbuiltin/kDepIDB.c
424
425kDepObj_TEMPLATE = BIN-KMK
426kDepObj_DEFS = kmk_builtin_kDepObj=main
427kDepObj_INCS = .
428kDepObj_LIBS = $(LIB_KDEP) $(LIB_KUTIL)
429kDepObj_SOURCES = \
430 kmkbuiltin/kDepObj.c
431
432
433#
434# kmk_gmake - almost plain GNU Make.
435#
436PROGRAMS += kmk_gmake
437
438kmk_gmake_TEMPLATE = BIN-KMK
439kmk_gmake_DEFS = \
440 HAVE_CONFIG_H \
441 CONFIG_WITH_TOUPPER_TOLOWER \
442 EXPERIMENTAL
443# NO_ARCHIVES
444
445kmk_gmake_SOURCES = \
446 main.c \
447 read.c \
448 hash.c \
449 strcache.c \
450 variable.c \
451 ar.c \
452 arscan.c \
453 commands.c \
454 default.c \
455 dir.c \
456 expand.c \
457 file.c \
458 function.c \
459 implicit.c \
460 job.c \
461 misc.c \
462 remake.c \
463 rule.c \
464 signame.c \
465 version.c \
466 vpath.c \
467 remote-stub.c
468
469kmk_gmake_SOURCES.win = \
470 w32/subproc/sub_proc.c
471
472
473#
474# kmk_fmake - Faster GNU Make.
475#
476ifeq ($(USER),bird) # for experimental purposes only.
477PROGRAMS += kmk_fgmake
478endif
479
480kmk_fgmake_TEMPLATE = BIN-KMK
481kmk_fgmake_DEFS = \
482 HAVE_CONFIG_H \
483 NO_ARCHIVES \
484 CONFIG_WITH_TOUPPER_TOLOWER \
485 EXPERIMENTAL \
486 \
487 CONFIG_WITH_ALLOC_CACHES \
488 CONFIG_WITH_LAZY_DEPS_VARS \
489 CONFIG_WITH_STRCACHE2 \
490 CONFIG_WITH_VALUE_LENGTH \
491 CONFIG_WITH_RDONLY_VARIABLE_VALUE
492# TODO ?
493# CONFIG_WITH_PRINT_STATS_SWITCH \
494# CONFIG_WITH_EXTENDED_NOTPARALLEL \
495
496kmk_fgmake_SOURCES = \
497 main.c \
498 read.c \
499 hash.c \
500 strcache.c \
501 strcache2.c \
502 variable.c \
503 ar.c \
504 arscan.c \
505 commands.c \
506 default.c \
507 dir.c \
508 expand.c \
509 file.c \
510 function.c \
511 implicit.c \
512 job.c \
513 misc.c \
514 alloccache.c \
515 remake.c \
516 rule.c \
517 signame.c \
518 version.c \
519 vpath.c \
520 remote-stub.c
521
522kmk_fgmake_SOURCES.win = \
523 w32/subproc/sub_proc.c
524
525
526#
527# tstFileInfo
528#
529PROGRAMS.win += tstFileInfo
530tstFileInfo_TEMPLATE = BIN
531tstFileInfo_SOURCES = w32/tstFileInfo.c
532
533
534include $(FILE_KBUILD_SUB_FOOTER)
535
536
537#
538# Use checked in config.h instead of running ./Configure for it.
539#
540kmk_config.h.$(KBUILD_TARGET) := $(kmk_DEFPATH)/config.h.$(KBUILD_TARGET)
541$(kmk_0_OUTDIR)/config.h: $(kmk_config.h.$(KBUILD_TARGET))
542 $(MKDIR) -p $(dir $@)
543 $(CP) $^ $@
544
545#
546# Some missing headers.
547#
548$(kmk_0_OUTDIR)/fts.h: $(kmk_DEFPATH)/kmkbuiltin/ftsfake.h | $(call DIRDEP,$(kmk_0_OUTDIR))
549 $(CP) $^ $@
550
551$(kmk_0_OUTDIR)/unistd.h: | $(call DIRDEP,$(kmk_0_OUTDIR))
552 $(ECHO_EXT) > $@
553
554$(kmk_0_OUTDIR)/sysexits.h: | $(call DIRDEP,$(kmk_0_OUTDIR))
555 $(ECHO_EXT) > $@
556
557$(kmk_0_OUTDIR)/inttypes.h: | $(call DIRDEP,$(kmk_0_OUTDIR))
558 $(ECHO_EXT) > $@
559
560$(kmk_0_OUTDIR)/paths.h: | $(call DIRDEP,$(kmk_0_OUTDIR))
561 $(ECHO_EXT) > $@
562
563$(kmk_0_OUTDIR)/pwd.h: | $(call DIRDEP,$(kmk_0_OUTDIR))
564 $(ECHO_EXT) > $@
565
566$(kmk_0_OUTDIR)/grp.h: | $(call DIRDEP,$(kmk_0_OUTDIR))
567 $(ECHO_EXT) > $@
568
569
570#
571# Some tests.
572#
573parallel: parallel_1 parallel_2 parallel_3 parallel_4 parallel_5
574parallel_1 parallel_2 parallel_3 parallel_4 parallel_5:
575 echo $@_start ; sleep 1; echo $@_done
576
577my_test:
578 echo "1"
579 echo "2"
580 echo "3"
581 echo "4"
582
583
584#
585# Shell execution tests.
586#
587test_shell: test_shell_quoting test_shell_double_quoting test_shell_newline
588
589# shell double and single quoting check (was busted on windows in 3.81).
590test_shell_quoting:
591 $(ECHO_EXT) "double quoted sTrInG"
592 $(ECHO_EXT) "double quoted sTrInG" | $(SED_EXT) -e "s/sTrInG/string/g"
593 $(ECHO_EXT) 'single quoted sTrInG' | $(SED_EXT) -e 's/sTrInG/string/g'
594 $(ECHO) "This string should not be printed with double quotes."
595 $(ECHO) 'This string should not be printed with single quotes.'
596 ( echo " #define PWD \"`pwd`\""; )
597
598test_shell_double_quoting:
599 $(ECHO_EXT) "foo foo foo" | $(SED_EXT) -e \
600 "s/foo/$@/" -e \
601 "s/foo/works/" \
602 -e "s/foo/\!/"
603
604test_shell_double_quoting2:
605 $(ECHO_EXT) "foo foo foo" | $(SED_EXT) -e \
606 "s/foo/$@/" -e \
607 "s/foo/works/" \
608 -e\
609 "s/foo/\!/"
610
611# when using batch mode shell, the newline got escaped twice and spoiling everything.
612test_shell_newline:
613 $(ECHO_EXT) "foo foo foo" | $(SED_EXT) -e \
614 's/foo/$@/' -e \
615 's/foo/works/' \
616 -e 's/foo/\!/'
617
618
619test_stack:
620 $(MAKE) -f $(kmk_DEFPATH)/testcase-stack.kmk
621
622test_math:
623 $(MAKE) -f $(kmk_DEFPATH)/testcase-math.kmk
624
625test_if1of:
626 $(MAKE) -f $(kmk_DEFPATH)/testcase-if1of.kmk
627
628test_local:
629 $(MAKE) -f $(kmk_DEFPATH)/testcase-local.kmk
630
631test_includedep:
632 $(MAKE) -f $(kmk_DEFPATH)/testcase-includedep.kmk
633
634test_root:
635 $(MAKE) -f $(kmk_DEFPATH)/testcase-root.kmk
636
637test_2ndtargetexp:
638 $(MAKE) -f $(kmk_DEFPATH)/testcase-2ndtargetexp.kmk
639
640test_30_continued_on_failure_worker:
641 this_executable_does_not_exist.exe
642 echo "We shouldn't see this..."
643
644test_30_continued_on_failure:
645 $(MAKE) -f $(MAKEFILE) test_30_continued_on_failure_worker; \
646 RC=$$?; \
647 if test $${RC} -ne 2; then \
648 echo "$@: FAILED - exit code $${RC} instead of 2."; \
649 exit 1; \
650 else \
651 echo "$@: SUCCESS"; \
652 fi
653
654test_lazy_deps_vars:
655 $(MAKE) -C $(kmk_DEFPATH) -f testcase-lazy-deps-vars.kmk
656
657
658test_all: \
659 test_math \
660 test_stack \
661 test_shell \
662 test_if1of \
663 test_local \
664 test_root \
665 test_includedep \
666 test_2ndtargetexp \
667 test_30_continued_on_failure \
668 test_lazy_deps_vars
669
670
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette