VirtualBox

source: kBuild/trunk/src/kmk/Makefile.am@ 3247

Last change on this file since 3247 was 3140, checked in by bird, 7 years ago

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

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

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