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 |
|
---|
26 | SUB_DEPTH = ../..
|
---|
27 | include $(KBUILD_PATH)/subheader.kmk
|
---|
28 |
|
---|
29 |
|
---|
30 | #
|
---|
31 | # Template for kmk and the kmk_* binaries in this makefile.
|
---|
32 | #
|
---|
33 | TEMPLATE_BIN-KMK = Template for src/gmake binaries
|
---|
34 | TEMPLATE_BIN-KMK_EXTENDS = BIN-THREADED
|
---|
35 | TEMPLATE_BIN-KMK_DEFS = \
|
---|
36 | HAVE_CONFIG_H \
|
---|
37 | $(TEMPLATE_BIN_DEFS) \
|
---|
38 | KBUILD_SVN_REV=$(KBUILD_SVN_REV) \
|
---|
39 | KBUILD_TYPE=\"$(KBUILD_TYPE)\"
|
---|
40 | TEMPLATE_BIN-KMK_DEPS = \
|
---|
41 | $(kmk_0_OUTDIR)/config.h \
|
---|
42 | $(kmk_0_OUTDIR)/fts.h
|
---|
43 | TEMPLATE_BIN-KMK_CLEAN = $(TEMPLATE_BIN-KMK_DEPS)
|
---|
44 | TEMPLATE_BIN-KMK_DEPS.solaris = \
|
---|
45 | $(kmk_0_OUTDIR)/paths.h
|
---|
46 | TEMPLATE_BIN-KMK_CLEAN.solaris = $(TEMPLATE_BIN-KMK_DEPS.solaris)
|
---|
47 | TEMPLATE_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
|
---|
54 | TEMPLATE_BIN-KMK_CFLAGS.win.amd64 = $(TEMPLATE_BIN-THREADED_CFLAGS.win.amd64) -wd4244 -wd4267
|
---|
55 | TEMPLATE_BIN-KMK_CLEAN.win = $(TEMPLATE_BIN-KMK_DEPS.win)
|
---|
56 | TEMPLATE_BIN-KMK_INCS = $(kmk_0_OUTDIR) . $(TEMPLATE_BIN-THREADED_INCS)
|
---|
57 | ifneq ($(KBUILD_TARGET),os2)
|
---|
58 | TEMPLATE_BIN-KMK_INCS += glob
|
---|
59 | endif
|
---|
60 | TEMPLATE_BIN-KMK_LIBS = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS) $(kmkmissing_1_TARGET) $(LIB_KUTIL)
|
---|
61 | ifdef ELECTRIC_HEAP # for electric heap (see electric.c) - windows only.
|
---|
62 | ifeq ($(KBUILD_TARGET),win)
|
---|
63 | TEMPLATE_BIN-KMK_CFLAGS = $(TEMPLATE_BIN-THREADED_CFLAGS) /FI$(kmk_DEFPATH)/electric.h -DELECTRIC_HEAP=1
|
---|
64 | else
|
---|
65 | TEMPLATE_BIN-KMK_CFLAGS = $(TEMPLATE_BIN-THREADED_CFLAGS) -include $(kmk_DEFPATH)/electric.h -DELECTRIC_HEAP=1
|
---|
66 | endif
|
---|
67 | endif
|
---|
68 | # GCC sanitizers.
|
---|
69 | ifdef 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
|
---|
74 | endif
|
---|
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 | #
|
---|
81 | LIBRARIES += kmkmissing
|
---|
82 | kmkmissing_TEMPLATE = BIN-KMK
|
---|
83 | kmkmissing_DEFS = KMK
|
---|
84 | kmkmissing_NOINST = 1
|
---|
85 | kmkmissing_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
|
---|
95 | ifneq ($(KBUILD_TARGET),os2)
|
---|
96 | kmkmissing_SOURCES += \
|
---|
97 | glob/glob.c
|
---|
98 | endif
|
---|
99 |
|
---|
100 | kmkmissing_SOURCES.darwin = \
|
---|
101 | kmkbuiltin/darwin.c \
|
---|
102 | glob/fnmatch.c
|
---|
103 |
|
---|
104 | kmkmissing_SOURCES.dragonfly = \
|
---|
105 | glob/fnmatch.c
|
---|
106 |
|
---|
107 | kmkmissing_SOURCES.freebsd = \
|
---|
108 | glob/fnmatch.c
|
---|
109 |
|
---|
110 | kmkmissing_SOURCES.haiku = \
|
---|
111 | kmkbuiltin/haikufakes.c \
|
---|
112 | glob/fnmatch.c
|
---|
113 |
|
---|
114 | kmkmissing_SOURCES.linux += \
|
---|
115 | kmkbuiltin/strlcpy.c
|
---|
116 |
|
---|
117 | kmkmissing_SOURCES.openbsd = \
|
---|
118 | kmkbuiltin/openbsd.c
|
---|
119 |
|
---|
120 | kmkmissing_SOURCES.solaris = \
|
---|
121 | kmkbuiltin/strlcpy.c \
|
---|
122 | kmkbuiltin/solfakes.c \
|
---|
123 | glob/fnmatch.c
|
---|
124 |
|
---|
125 | kmkmissing_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 | #
|
---|
138 | PROGRAMS += kmk
|
---|
139 |
|
---|
140 | kmk_TEMPLATE = BIN-KMK
|
---|
141 |
|
---|
142 | kmk_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.
|
---|
200 | kmk_DEFS.x86 = CONFIG_WITH_OPTIMIZATION_HACKS
|
---|
201 | kmk_DEFS.amd64 = CONFIG_WITH_OPTIMIZATION_HACKS
|
---|
202 | kmk_DEFS.win = CONFIG_NEW_WIN32_CTRL_EVENT CONFIG_WITH_FAST_IS_SPACE
|
---|
203 | kmk_DEFS.debug = CONFIG_WITH_MAKE_STATS
|
---|
204 | ifdef CONFIG_WITH_MAKE_STATS
|
---|
205 | kmk_DEFS += CONFIG_WITH_MAKE_STATS
|
---|
206 | endif
|
---|
207 | ifdef CONFIG_WITH_EVAL_COMPILER
|
---|
208 | kmk_DEFS += CONFIG_WITH_EVAL_COMPILER
|
---|
209 | endif
|
---|
210 | ifdef CONFIG_WITH_COMPILE_EVERYTHING
|
---|
211 | kmk_DEFS += CONFIG_WITH_COMPILE_EVERYTHING
|
---|
212 | endif
|
---|
213 |
|
---|
214 | kmk_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
|
---|
244 | ifeq ($(KBUILD_TARGET),win)
|
---|
245 | kmk_SOURCES += dir-nt-bird.c
|
---|
246 | else
|
---|
247 | kmk_SOURCES += dir.c
|
---|
248 | endif
|
---|
249 |
|
---|
250 | kmk_SOURCES.win = \
|
---|
251 | w32/subproc/sub_proc.c
|
---|
252 |
|
---|
253 | kmk_DEFS.freebsd.x86 = CONFIG_WITHOUT_THREADS
|
---|
254 |
|
---|
255 | #kmk_LIBS.solaris = malloc
|
---|
256 | #kmk_DEFS.solaris += HAVE_MALLINFO
|
---|
257 |
|
---|
258 | #
|
---|
259 | # kmkbuiltin commands
|
---|
260 | #
|
---|
261 | kmk_DEFS += CONFIG_WITH_KMK_BUILTIN
|
---|
262 | kmk_LIBS += $(LIB_KUTIL) #$(LIB_KDEP)
|
---|
263 | kmk_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 | #
|
---|
301 | PROGRAMS += \
|
---|
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 |
|
---|
323 | kmk_append_TEMPLATE = BIN-KMK
|
---|
324 | kmk_append_DEFS = kmk_builtin_append=main
|
---|
325 | kmk_append_INCS = .
|
---|
326 | kmk_append_SOURCES = \
|
---|
327 | kmkbuiltin/append.c
|
---|
328 |
|
---|
329 | kmk_cat_TEMPLATE = BIN-KMK
|
---|
330 | kmk_cat_DEFS = kmk_builtin_cat=main
|
---|
331 | kmk_cat_SOURCES = \
|
---|
332 | kmkbuiltin/cat.c
|
---|
333 |
|
---|
334 | kmk_chmod_TEMPLATE = BIN-KMK
|
---|
335 | kmk_chmod_DEFS = kmk_builtin_chmod=main
|
---|
336 | kmk_chmod_SOURCES = \
|
---|
337 | kmkbuiltin/chmod.c
|
---|
338 |
|
---|
339 | kmk_cmp_TEMPLATE = BIN-KMK
|
---|
340 | kmk_cmp_DEFS = kmk_builtin_cmp=main
|
---|
341 | kmk_cmp_SOURCES = \
|
---|
342 | kmkbuiltin/cmp.c \
|
---|
343 | kmkbuiltin/cmp_util.c
|
---|
344 |
|
---|
345 | kmk_cp_TEMPLATE = BIN-KMK
|
---|
346 | kmk_cp_DEFS = kmk_builtin_cp=main
|
---|
347 | kmk_cp_SOURCES = \
|
---|
348 | kmkbuiltin/cp.c \
|
---|
349 | kmkbuiltin/cp_utils.c \
|
---|
350 | kmkbuiltin/cmp_util.c
|
---|
351 |
|
---|
352 | kmk_echo_TEMPLATE = BIN-KMK
|
---|
353 | kmk_echo_DEFS = kmk_builtin_echo=main
|
---|
354 | kmk_echo_SOURCES = \
|
---|
355 | kmkbuiltin/echo.c
|
---|
356 |
|
---|
357 | kmk_expr_TEMPLATE = BIN-KMK
|
---|
358 | kmk_expr_DEFS = kmk_builtin_expr=main
|
---|
359 | kmk_expr_SOURCES = \
|
---|
360 | kmkbuiltin/expr.c
|
---|
361 |
|
---|
362 | kmk_install_TEMPLATE = BIN-KMK
|
---|
363 | kmk_install_DEFS = kmk_builtin_install=main
|
---|
364 | kmk_install_SOURCES = \
|
---|
365 | kmkbuiltin/install.c
|
---|
366 |
|
---|
367 | kmk_ln_TEMPLATE = BIN-KMK
|
---|
368 | kmk_ln_DEFS = kmk_builtin_ln=main
|
---|
369 | kmk_ln_SOURCES = \
|
---|
370 | kmkbuiltin/ln.c
|
---|
371 |
|
---|
372 | kmk_mkdir_TEMPLATE = BIN-KMK
|
---|
373 | kmk_mkdir_DEFS = kmk_builtin_mkdir=main
|
---|
374 | kmk_mkdir_SOURCES = \
|
---|
375 | kmkbuiltin/mkdir.c
|
---|
376 |
|
---|
377 | kmk_md5sum_TEMPLATE = BIN-KMK
|
---|
378 | kmk_md5sum_DEFS = kmk_builtin_md5sum=main
|
---|
379 | kmk_md5sum_SOURCES = \
|
---|
380 | kmkbuiltin/md5sum.c
|
---|
381 | kmk_md5sum_LIBS = $(LIB_KUTIL)
|
---|
382 |
|
---|
383 | kmk_mv_TEMPLATE = BIN-KMK
|
---|
384 | kmk_mv_DEFS = kmk_builtin_mv=main
|
---|
385 | kmk_mv_SOURCES = \
|
---|
386 | kmkbuiltin/mv.c
|
---|
387 |
|
---|
388 | kmk_printf_TEMPLATE = BIN-KMK
|
---|
389 | kmk_printf_DEFS = kmk_builtin_printf=main
|
---|
390 | kmk_printf_SOURCES = \
|
---|
391 | kmkbuiltin/printf.c
|
---|
392 |
|
---|
393 | kmk_rm_TEMPLATE = BIN-KMK
|
---|
394 | kmk_rm_DEFS = kmk_builtin_rm=main
|
---|
395 | kmk_rm_SOURCES = \
|
---|
396 | kmkbuiltin/rm.c
|
---|
397 |
|
---|
398 | kmk_redirect_TEMPLATE = BIN-KMK
|
---|
399 | kmk_redirect_SOURCES = \
|
---|
400 | kmkbuiltin/redirect.c
|
---|
401 | kmk_redirect_SOURCES.win = \
|
---|
402 | ../lib/startuphacks-win.c
|
---|
403 |
|
---|
404 | kmk_rmdir_TEMPLATE = BIN-KMK
|
---|
405 | kmk_rmdir_DEFS = kmk_builtin_rmdir=main
|
---|
406 | kmk_rmdir_SOURCES = \
|
---|
407 | kmkbuiltin/rmdir.c
|
---|
408 |
|
---|
409 | kmk_sleep_TEMPLATE = BIN-KMK
|
---|
410 | kmk_sleep_DEFS = kmk_builtin_sleep=main
|
---|
411 | kmk_sleep_SOURCES = \
|
---|
412 | kmkbuiltin/sleep.c
|
---|
413 |
|
---|
414 | kmk_test_TEMPLATE = BIN-KMK
|
---|
415 | kmk_test_DEFS = kmk_builtin_test=main
|
---|
416 | kmk_test_SOURCES = \
|
---|
417 | kmkbuiltin/test.c
|
---|
418 |
|
---|
419 | kDepIDB_TEMPLATE = BIN-KMK
|
---|
420 | kDepIDB_DEFS = kmk_builtin_kDepIDB=main
|
---|
421 | kDepIDB_INCS = .
|
---|
422 | kDepIDB_LIBS = $(LIB_KDEP) $(LIB_KUTIL)
|
---|
423 | kDepIDB_SOURCES = \
|
---|
424 | kmkbuiltin/kDepIDB.c
|
---|
425 |
|
---|
426 | kDepObj_TEMPLATE = BIN-KMK
|
---|
427 | kDepObj_DEFS = kmk_builtin_kDepObj=main
|
---|
428 | kDepObj_INCS = .
|
---|
429 | kDepObj_LIBS = $(LIB_KDEP) $(LIB_KUTIL)
|
---|
430 | kDepObj_SOURCES = \
|
---|
431 | kmkbuiltin/kDepObj.c
|
---|
432 |
|
---|
433 |
|
---|
434 | #
|
---|
435 | # kmk_gmake - almost plain GNU Make.
|
---|
436 | #
|
---|
437 | PROGRAMS += kmk_gmake
|
---|
438 |
|
---|
439 | kmk_gmake_TEMPLATE = BIN-KMK
|
---|
440 | kmk_gmake_DEFS = \
|
---|
441 | HAVE_CONFIG_H \
|
---|
442 | CONFIG_WITH_TOUPPER_TOLOWER \
|
---|
443 | EXPERIMENTAL
|
---|
444 | # NO_ARCHIVES
|
---|
445 |
|
---|
446 | kmk_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 |
|
---|
470 | kmk_gmake_SOURCES.win = \
|
---|
471 | w32/subproc/sub_proc.c
|
---|
472 |
|
---|
473 |
|
---|
474 | #
|
---|
475 | # kmk_fmake - Faster GNU Make.
|
---|
476 | #
|
---|
477 | ifeq ($(USER),bird) # for experimental purposes only.
|
---|
478 | PROGRAMS += kmk_fgmake
|
---|
479 | endif
|
---|
480 |
|
---|
481 | kmk_fgmake_TEMPLATE = BIN-KMK
|
---|
482 | kmk_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 |
|
---|
497 | kmk_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 |
|
---|
523 | kmk_fgmake_SOURCES.win = \
|
---|
524 | w32/subproc/sub_proc.c
|
---|
525 |
|
---|
526 |
|
---|
527 | #
|
---|
528 | # tstFileInfo
|
---|
529 | #
|
---|
530 | PROGRAMS.win += tstFileInfo
|
---|
531 | tstFileInfo_TEMPLATE = BIN
|
---|
532 | tstFileInfo_SOURCES = w32/tstFileInfo.c
|
---|
533 |
|
---|
534 |
|
---|
535 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
536 |
|
---|
537 |
|
---|
538 | #
|
---|
539 | # Use checked in config.h instead of running ./Configure for it.
|
---|
540 | #
|
---|
541 | kmk_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 | #
|
---|
574 | parallel: parallel_1 parallel_2 parallel_3 parallel_4 parallel_5
|
---|
575 | parallel_1 parallel_2 parallel_3 parallel_4 parallel_5:
|
---|
576 | echo $@_start ; sleep 1; echo $@_done
|
---|
577 |
|
---|
578 | my_test:
|
---|
579 | echo "1"
|
---|
580 | echo "2"
|
---|
581 | echo "3"
|
---|
582 | echo "4"
|
---|
583 |
|
---|
584 |
|
---|
585 | #
|
---|
586 | # Shell execution tests.
|
---|
587 | #
|
---|
588 | test_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).
|
---|
591 | test_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 |
|
---|
599 | test_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 |
|
---|
605 | test_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.
|
---|
613 | test_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 |
|
---|
620 | test_stack:
|
---|
621 | $(MAKE) -f $(kmk_DEFPATH)/testcase-stack.kmk
|
---|
622 |
|
---|
623 | test_math:
|
---|
624 | $(MAKE) -f $(kmk_DEFPATH)/testcase-math.kmk
|
---|
625 |
|
---|
626 | test_if1of:
|
---|
627 | $(MAKE) -f $(kmk_DEFPATH)/testcase-if1of.kmk
|
---|
628 |
|
---|
629 | test_local:
|
---|
630 | $(MAKE) -f $(kmk_DEFPATH)/testcase-local.kmk
|
---|
631 |
|
---|
632 | test_includedep:
|
---|
633 | $(MAKE) -f $(kmk_DEFPATH)/testcase-includedep.kmk
|
---|
634 |
|
---|
635 | test_root:
|
---|
636 | $(MAKE) -f $(kmk_DEFPATH)/testcase-root.kmk
|
---|
637 |
|
---|
638 | test_2ndtargetexp:
|
---|
639 | $(MAKE) -f $(kmk_DEFPATH)/testcase-2ndtargetexp.kmk
|
---|
640 |
|
---|
641 | test_30_continued_on_failure_worker:
|
---|
642 | this_executable_does_not_exist.exe
|
---|
643 | echo "We shouldn't see this..."
|
---|
644 |
|
---|
645 | test_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 |
|
---|
655 | test_lazy_deps_vars:
|
---|
656 | $(MAKE) -C $(kmk_DEFPATH) -f testcase-lazy-deps-vars.kmk
|
---|
657 |
|
---|
658 |
|
---|
659 | test_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 |
|
---|