VirtualBox

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

Last change on this file since 3387 was 3259, checked in by bird, 5 years ago

kmk: bootstrap fixes

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

© 2023 Oracle
ContactPrivacy policyTerms of Use