VirtualBox

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

Last change on this file since 3633 was 3394, checked in by bird, 4 years ago

kmk: Added version sort function: versort, rversort, versortfiles, rversortfiles, qversortfiles, qrversortfiles. Try get the real host version on windows by using RtlGetVersion.

  • 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 ../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
103kmk_redirect_SOURCES = kmkbuiltin/redirect.c \
104 kmkbuiltin/common-env-and-cwd-opt.c \
105 kmkbuiltin/err.c \
106 ../lib/kbuild_version.c
107kmk_redirect_CFLAGS = -UKMK -DKMK_BUILTIN_STANDALONE
108
109EXTRA_kmk_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
110
111noinst_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@
115kmk_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ \
116 $(GUILE_LIBS)
117# Only process if target is MS-Windows
118if WINDOWSENV
119 kmk_LDADD += $(W32LIB)
120endif
121
122man_MANS = make.1
123
124# org - DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
125DEFS = \
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
191AM_CPPFLAGS = $(GLOBINC) -I$(srcdir)/../lib -I$(srcdir)/../lib/kStuff/include
192AM_CFLAGS = $(GUILE_CFLAGS)
193# Only process if target is MS-Windows
194if WINDOWSENV
195 AM_CPPFLAGS += $(W32INC)
196endif
197
198
199# Extra stuff to include in the distribution.
200
201EXTRA_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
215DISTCLEANFILES = build.sh
216
217# --------------- Internationalization Section
218
219localedir = $(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#
231inst_setgid = @NEED_SETGID@
232
233# Install make setgid to this group so it can get the load average.
234#
235inst_group = @KMEM_GROUP@
236
237install-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
252guile.$(OBJEXT): gmk-default.h
253gmk-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#
263dist-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
272check-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
283check-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.
290check_PROGRAMS = loadavg
291nodist_loadavg_SOURCES = getloadavg.c
292loadavg_CPPFLAGS = -DTEST
293loadavg_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#
301MAKETESTFLAGS =
302
303check-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
331README:
332
333@MAINT_MAKEFILE@
Note: See TracBrowser for help on using the repository browser.

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