VirtualBox

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

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

rewrote kmk_redirect to skip the separate process. Added chache invalidation after directory deletion for addressing kmk rebuild and fetching.

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