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