1 | # This is a -*-Makefile-*-, or close enough
|
---|
2 | #
|
---|
3 | # Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
---|
4 | # This file is part of GNU Make.
|
---|
5 | #
|
---|
6 | # GNU Make is free software; you can redistribute it and/or modify it under
|
---|
7 | # the terms of the GNU General Public License as published by the Free Software
|
---|
8 | # Foundation; either version 3 of the License, or (at your option) any later
|
---|
9 | # version.
|
---|
10 | #
|
---|
11 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
12 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
13 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
---|
14 | # details.
|
---|
15 | #
|
---|
16 | # You should have received a copy of the GNU General Public License along with
|
---|
17 | # this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
18 |
|
---|
19 | AUTOMAKE_OPTIONS = dist-bzip2 silent-rules std-options
|
---|
20 | ACLOCAL_AMFLAGS = -I config
|
---|
21 |
|
---|
22 | MAKE_HOST = @MAKE_HOST@
|
---|
23 |
|
---|
24 | # Only process if target is MS-Windows
|
---|
25 | if WINDOWSENV
|
---|
26 | MAYBE_W32 = w32
|
---|
27 | W32INC = -I $(top_srcdir)/w32/include
|
---|
28 | W32LIB = -Lw32 -lw32
|
---|
29 | ossrc =
|
---|
30 | else
|
---|
31 | ossrc = posixos.c
|
---|
32 | endif
|
---|
33 |
|
---|
34 | # we can safely drop doc and po when bootstrapping kmk.
|
---|
35 | # SUBDIRS = glob config po doc $(MAYBE_W32)
|
---|
36 | SUBDIRS = glob config $(MAYBE_W32)
|
---|
37 |
|
---|
38 | bin_PROGRAMS = kmk kmk_redirect
|
---|
39 | include_HEADERS = gnumake.h
|
---|
40 |
|
---|
41 | if USE_CUSTOMS
|
---|
42 | remote = remote-cstms.c
|
---|
43 | else
|
---|
44 | remote = remote-stub.c
|
---|
45 | endif
|
---|
46 |
|
---|
47 | kmk_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
|
---|
48 | function.c getopt.c getopt1.c guile.c implicit.c job.c load.c \
|
---|
49 | loadapi.c main.c misc.c $(ossrc) output.c read.c remake.c \
|
---|
50 | rule.c signame.c strcache.c variable.c version.c vpath.c \
|
---|
51 | hash.c $(remote) \
|
---|
52 | \
|
---|
53 | expreval.c \
|
---|
54 | incdep.c \
|
---|
55 | strcache2.c \
|
---|
56 | alloccache.c \
|
---|
57 | kbuild.c \
|
---|
58 | kbuild-object.c \
|
---|
59 | electric.c \
|
---|
60 | ../lib/md5.c \
|
---|
61 | ../lib/kDep.c \
|
---|
62 | ../lib/kbuild_version.c \
|
---|
63 | ../lib/dos2unix.c \
|
---|
64 | ../lib/maybe_con_fwrite.c \
|
---|
65 | ../lib/version_compare.c \
|
---|
66 | \
|
---|
67 | kmkbuiltin.c \
|
---|
68 | kmkbuiltin/append.c \
|
---|
69 | kmkbuiltin/cat.c \
|
---|
70 | kmkbuiltin/chmod.c \
|
---|
71 | kmkbuiltin/cmp.c \
|
---|
72 | kmkbuiltin/cmp_util.c \
|
---|
73 | kmkbuiltin/cp.c \
|
---|
74 | kmkbuiltin/cp_utils.c \
|
---|
75 | kmkbuiltin/echo.c \
|
---|
76 | kmkbuiltin/expr.c \
|
---|
77 | kmkbuiltin/install.c \
|
---|
78 | kmkbuiltin/kDepIDB.c \
|
---|
79 | kmkbuiltin/kDepObj.c \
|
---|
80 | kmkbuiltin/ln.c \
|
---|
81 | kmkbuiltin/md5sum.c \
|
---|
82 | kmkbuiltin/mkdir.c \
|
---|
83 | kmkbuiltin/mv.c \
|
---|
84 | kmkbuiltin/printf.c \
|
---|
85 | kmkbuiltin/redirect.c \
|
---|
86 | kmkbuiltin/rm.c \
|
---|
87 | kmkbuiltin/rmdir.c \
|
---|
88 | kmkbuiltin/sleep.c \
|
---|
89 | kmkbuiltin/test.c \
|
---|
90 | kmkbuiltin/touch.c \
|
---|
91 | \
|
---|
92 | kmkbuiltin/err.c \
|
---|
93 | kmkbuiltin/getopt_r.c \
|
---|
94 | kmkbuiltin/getopt1_r.c \
|
---|
95 | kmkbuiltin/fts.c \
|
---|
96 | kmkbuiltin/setmode.c \
|
---|
97 | kmkbuiltin/strmode.c \
|
---|
98 | kmkbuiltin/strlcpy.c \
|
---|
99 | kmkbuiltin/osdep.c \
|
---|
100 | kmkbuiltin/kbuild_protection.c \
|
---|
101 | kmkbuiltin/common-env-and-cwd-opt.c
|
---|
102 |
|
---|
103 | kmk_redirect_SOURCES = kmkbuiltin/redirect.c \
|
---|
104 | kmkbuiltin/common-env-and-cwd-opt.c \
|
---|
105 | kmkbuiltin/err.c \
|
---|
106 | ../lib/kbuild_version.c
|
---|
107 | kmk_redirect_CFLAGS = -UKMK -DKMK_BUILTIN_STANDALONE
|
---|
108 |
|
---|
109 | EXTRA_kmk_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
|
---|
110 |
|
---|
111 | noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \
|
---|
112 | debug.h getopt.h gettext.h hash.h output.h os.h
|
---|
113 |
|
---|
114 | #kmk_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@
|
---|
115 | kmk_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ \
|
---|
116 | $(GUILE_LIBS)
|
---|
117 | # Only process if target is MS-Windows
|
---|
118 | if WINDOWSENV
|
---|
119 | kmk_LDADD += $(W32LIB)
|
---|
120 | endif
|
---|
121 |
|
---|
122 | man_MANS = make.1
|
---|
123 |
|
---|
124 | # org - DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
|
---|
125 | DEFS = \
|
---|
126 | -DNO_ARCHIVES \
|
---|
127 | -DEXPERIMENTAL \
|
---|
128 | -DCONFIG_WITH_TOUPPER_TOLOWER \
|
---|
129 | -DCONFIG_WITH_DEFINED \
|
---|
130 | -DCONFIG_WITH_EXPLICIT_MULTITARGET \
|
---|
131 | -DCONFIG_WITH_DOT_MUST_MAKE \
|
---|
132 | -DCONFIG_WITH_PREPEND_ASSIGNMENT \
|
---|
133 | -DCONFIG_WITH_LOCAL_VARIABLES \
|
---|
134 | -DCONFIG_WITH_2ND_TARGET_EXPANSION \
|
---|
135 | -DCONFIG_WITH_ALLOC_CACHES \
|
---|
136 | -DCONFIG_WITH_STRCACHE2 \
|
---|
137 | \
|
---|
138 | -DKMK \
|
---|
139 | -DKMK_HELPERS \
|
---|
140 | -DCONFIG_NO_DEFAULT_SUFFIXES \
|
---|
141 | -DCONFIG_NO_DEFAULT_PATTERN_RULES \
|
---|
142 | -DCONFIG_NO_DEFAULT_TERMINAL_RULES \
|
---|
143 | -DCONFIG_NO_DEFAULT_SUFFIX_RULES \
|
---|
144 | -DCONFIG_NO_DEFAULT_VARIABLES \
|
---|
145 | -DCONFIG_WITH_EXTENDED_NOTPARALLEL \
|
---|
146 | -DCONFIG_WITH_INCLUDEDEP \
|
---|
147 | -DCONFIG_WITHOUT_THREADS \
|
---|
148 | -DCONFIG_WITH_VALUE_LENGTH \
|
---|
149 | \
|
---|
150 | -DCONFIG_WITH_ABSPATHEX \
|
---|
151 | -DCONFIG_WITH_COMMANDS_FUNC \
|
---|
152 | -DCONFIG_WITH_DATE \
|
---|
153 | -DCONFIG_WITH_DEFINED_FUNCTIONS \
|
---|
154 | -DCONFIG_WITH_EVALPLUS \
|
---|
155 | -DCONFIG_WITH_FILE_SIZE \
|
---|
156 | -DCONFIG_WITH_LOOP_FUNCTIONS \
|
---|
157 | -DCONFIG_WITH_MATH \
|
---|
158 | -DCONFIG_WITH_NANOTS \
|
---|
159 | -DCONFIG_WITH_ROOT_FUNC \
|
---|
160 | -DCONFIG_WITH_RSORT \
|
---|
161 | -DCONFIG_WITH_STACK \
|
---|
162 | -DCONFIG_WITH_STRING_FUNCTIONS \
|
---|
163 | -DCONFIG_WITH_WHERE_FUNCTION \
|
---|
164 | -DCONFIG_WITH_WHICH \
|
---|
165 | -DCONFIG_WITH_XARGS \
|
---|
166 | \
|
---|
167 | -DCONFIG_WITH_COMPARE \
|
---|
168 | -DCONFIG_WITH_SET_CONDITIONALS \
|
---|
169 | -DCONFIG_WITH_IF_CONDITIONALS \
|
---|
170 | -DCONFIG_WITH_PRINTF \
|
---|
171 | -DCONFIG_WITH_MINIMAL_STATS \
|
---|
172 | -DCONFIG_PRETTY_COMMAND_PRINTING \
|
---|
173 | -DCONFIG_WITH_PRINT_STATS_SWITCH \
|
---|
174 | -DCONFIG_WITH_PRINT_TIME_SWITCH \
|
---|
175 | -DCONFIG_WITH_RDONLY_VARIABLE_VALUE \
|
---|
176 | -DCONFIG_WITH_LAZY_DEPS_VARS \
|
---|
177 | \
|
---|
178 | -DKBUILD_TYPE=\"$(KBUILD_TYPE)\" \
|
---|
179 | -DKBUILD_HOST=\"$(KBUILD_TARGET)\" \
|
---|
180 | -DKBUILD_HOST_ARCH=\"$(KBUILD_TARGET_ARCH)\" \
|
---|
181 | -DKBUILD_HOST_CPU=\"$(KBUILD_TARGET_CPU)\" \
|
---|
182 | \
|
---|
183 | -DKBUILD_SVN_REV=1 \
|
---|
184 | -DKBUILD_VERSION_MAJOR=0 \
|
---|
185 | -DKBUILD_VERSION_MINOR=1 \
|
---|
186 | -DKBUILD_VERSION_PATCH=9998 \
|
---|
187 | \
|
---|
188 | -DCONFIG_WITH_KMK_BUILTIN \
|
---|
189 | @DEFS@
|
---|
190 |
|
---|
191 | AM_CPPFLAGS = $(GLOBINC) -I$(srcdir)/../lib -I$(srcdir)/../lib/kStuff/include
|
---|
192 | AM_CFLAGS = $(GUILE_CFLAGS)
|
---|
193 | # Only process if target is MS-Windows
|
---|
194 | if WINDOWSENV
|
---|
195 | AM_CPPFLAGS += $(W32INC)
|
---|
196 | endif
|
---|
197 |
|
---|
198 |
|
---|
199 | # Extra stuff to include in the distribution.
|
---|
200 |
|
---|
201 | EXTRA_DIST = ChangeLog README build.sh.in $(man_MANS) \
|
---|
202 | README.customs README.OS2 \
|
---|
203 | SCOPTIONS SMakefile \
|
---|
204 | README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
|
---|
205 | README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
---|
206 | README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
|
---|
207 | make_msvc_net2003.sln make_msvc_net2003.vcproj \
|
---|
208 | README.VMS makefile.vms makefile.com config.h-vms \
|
---|
209 | vmsdir.h vmsfunctions.c vmsify.c vms_exit.c vms_progname.c \
|
---|
210 | vms_export_symbol.c vms_export_symbol_test.com \
|
---|
211 | gmk-default.scm gmk-default.h
|
---|
212 |
|
---|
213 | # This is built during configure, but behind configure's back
|
---|
214 |
|
---|
215 | DISTCLEANFILES = build.sh
|
---|
216 |
|
---|
217 | # --------------- Internationalization Section
|
---|
218 |
|
---|
219 | localedir = $(datadir)/locale
|
---|
220 |
|
---|
221 | # --------------- Local INSTALL Section
|
---|
222 |
|
---|
223 | # If necessary, change the gid of the app and turn on the setgid flag.
|
---|
224 | #
|
---|
225 |
|
---|
226 | # Whether or not make needs to be installed setgid.
|
---|
227 | # The value should be either 'true' or 'false'.
|
---|
228 | # On many systems, the getloadavg function (used to implement the '-l'
|
---|
229 | # switch) will not work unless make is installed setgid kmem.
|
---|
230 | #
|
---|
231 | inst_setgid = @NEED_SETGID@
|
---|
232 |
|
---|
233 | # Install make setgid to this group so it can get the load average.
|
---|
234 | #
|
---|
235 | inst_group = @KMEM_GROUP@
|
---|
236 |
|
---|
237 | install-exec-local:
|
---|
238 | @if $(inst_setgid); then \
|
---|
239 | app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
---|
240 | if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
---|
241 | echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
---|
242 | else \
|
---|
243 | echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
---|
244 | echo "otherwise the '-l' option will probably not work."; \
|
---|
245 | echo "You may need special privileges to complete the installation"; \
|
---|
246 | echo "of $$app."; \
|
---|
247 | fi; \
|
---|
248 | else true; fi
|
---|
249 |
|
---|
250 | # --------------- Generate the Guile default module content
|
---|
251 |
|
---|
252 | guile.$(OBJEXT): gmk-default.h
|
---|
253 | gmk-default.h: $(srcdir)/gmk-default.scm
|
---|
254 | (echo 'static const char *const GUILE_module_defn = " '\\ \
|
---|
255 | && sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
|
---|
256 | $(srcdir)/gmk-default.scm \
|
---|
257 | && echo '";') > $@
|
---|
258 |
|
---|
259 | # --------------- Local DIST Section
|
---|
260 |
|
---|
261 | # Install the w32 and tests subdirectories
|
---|
262 | #
|
---|
263 | dist-hook:
|
---|
264 | (cd $(srcdir); \
|
---|
265 | sub=`find w32 tests -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
|
---|
266 | tar chf - $$sub) \
|
---|
267 | | (cd $(distdir); tar xfBp -)
|
---|
268 |
|
---|
269 |
|
---|
270 | # --------------- Local CHECK Section
|
---|
271 |
|
---|
272 | check-local: check-regression check-loadavg
|
---|
273 | @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
---|
274 | dashes=`echo "$$banner" | sed s/./=/g`; \
|
---|
275 | echo; \
|
---|
276 | echo "$$dashes"; \
|
---|
277 | echo "$$banner"; \
|
---|
278 | echo "$$dashes"; \
|
---|
279 | echo
|
---|
280 |
|
---|
281 | .PHONY: check-loadavg check-regression
|
---|
282 |
|
---|
283 | check-loadavg: loadavg$(EXEEXT)
|
---|
284 | @echo The system uptime program believes the load average to be:
|
---|
285 | -uptime
|
---|
286 | @echo The GNU load average checking code thinks:
|
---|
287 | -./loadavg$(EXEEXT)
|
---|
288 |
|
---|
289 | # The loadavg function is invoked during "make check" to test getloadavg.
|
---|
290 | check_PROGRAMS = loadavg
|
---|
291 | nodist_loadavg_SOURCES = getloadavg.c
|
---|
292 | loadavg_CPPFLAGS = -DTEST
|
---|
293 | loadavg_LDADD = @GETLOADAVG_LIBS@
|
---|
294 |
|
---|
295 | # > check-regression
|
---|
296 | #
|
---|
297 | # Look for the make test suite, and run it if found and we can find perl.
|
---|
298 | # If we're building outside the tree, we use symlinks to make a local copy of
|
---|
299 | # the test suite. Unfortunately the test suite itself isn't localizable yet.
|
---|
300 | #
|
---|
301 | MAKETESTFLAGS =
|
---|
302 |
|
---|
303 | check-regression: tests/config-flags.pm
|
---|
304 | @if test -f '$(srcdir)/tests/run_make_tests'; then \
|
---|
305 | ulimit -n 128; \
|
---|
306 | if $(PERL) -v >/dev/null 2>&1; then \
|
---|
307 | case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
|
---|
308 | *) test -d tests || mkdir tests; \
|
---|
309 | rm -f srctests; \
|
---|
310 | if ln -s '$(srcdir)/tests' srctests; then \
|
---|
311 | for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
---|
312 | rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
---|
313 | done; fi ;; \
|
---|
314 | esac; \
|
---|
315 | echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
---|
316 | cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
|
---|
317 | else \
|
---|
318 | echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
---|
319 | fi; \
|
---|
320 | else \
|
---|
321 | echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
|
---|
322 | fi
|
---|
323 |
|
---|
324 |
|
---|
325 | # --------------- Maintainer's Section
|
---|
326 |
|
---|
327 | # Tell automake that I haven't forgotten about this file and it will be
|
---|
328 | # created before we build a distribution (see maintMakefile in the Git
|
---|
329 | # distribution).
|
---|
330 |
|
---|
331 | README:
|
---|
332 |
|
---|
333 | @MAINT_MAKEFILE@
|
---|