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 | SUBDIRS = glob config po doc $(MAYBE_W32)
|
---|
35 |
|
---|
36 | bin_PROGRAMS = make
|
---|
37 | include_HEADERS = gnumake.h
|
---|
38 |
|
---|
39 | if USE_CUSTOMS
|
---|
40 | remote = remote-cstms.c
|
---|
41 | else
|
---|
42 | remote = remote-stub.c
|
---|
43 | endif
|
---|
44 |
|
---|
45 | make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
|
---|
46 | function.c getopt.c getopt1.c guile.c implicit.c job.c load.c \
|
---|
47 | loadapi.c main.c misc.c $(ossrc) output.c read.c remake.c \
|
---|
48 | rule.c signame.c strcache.c variable.c version.c vpath.c \
|
---|
49 | hash.c $(remote)
|
---|
50 |
|
---|
51 | EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
|
---|
52 |
|
---|
53 | noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \
|
---|
54 | debug.h getopt.h gettext.h hash.h output.h os.h
|
---|
55 |
|
---|
56 | make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \
|
---|
57 | $(GUILE_LIBS)
|
---|
58 | # Only process if target is MS-Windows
|
---|
59 | if WINDOWSENV
|
---|
60 | make_LDADD += $(W32LIB)
|
---|
61 | endif
|
---|
62 |
|
---|
63 | man_MANS = make.1
|
---|
64 |
|
---|
65 | DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
|
---|
66 |
|
---|
67 | AM_CPPFLAGS = $(GLOBINC)
|
---|
68 | AM_CFLAGS = $(GUILE_CFLAGS)
|
---|
69 | # Only process if target is MS-Windows
|
---|
70 | if WINDOWSENV
|
---|
71 | AM_CPPFLAGS += $(W32INC)
|
---|
72 | endif
|
---|
73 |
|
---|
74 |
|
---|
75 | # Extra stuff to include in the distribution.
|
---|
76 |
|
---|
77 | EXTRA_DIST = ChangeLog README build.sh.in $(man_MANS) \
|
---|
78 | README.customs README.OS2 \
|
---|
79 | SCOPTIONS SMakefile \
|
---|
80 | README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
|
---|
81 | README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
---|
82 | README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
|
---|
83 | make_msvc_net2003.sln make_msvc_net2003.vcproj \
|
---|
84 | README.VMS makefile.vms makefile.com config.h-vms \
|
---|
85 | vmsdir.h vmsfunctions.c vmsify.c vms_exit.c vms_progname.c \
|
---|
86 | vms_export_symbol.c vms_export_symbol_test.com \
|
---|
87 | gmk-default.scm gmk-default.h
|
---|
88 |
|
---|
89 | # This is built during configure, but behind configure's back
|
---|
90 |
|
---|
91 | DISTCLEANFILES = build.sh
|
---|
92 |
|
---|
93 | # --------------- Internationalization Section
|
---|
94 |
|
---|
95 | localedir = $(datadir)/locale
|
---|
96 |
|
---|
97 | # --------------- Local INSTALL Section
|
---|
98 |
|
---|
99 | # If necessary, change the gid of the app and turn on the setgid flag.
|
---|
100 | #
|
---|
101 |
|
---|
102 | # Whether or not make needs to be installed setgid.
|
---|
103 | # The value should be either 'true' or 'false'.
|
---|
104 | # On many systems, the getloadavg function (used to implement the '-l'
|
---|
105 | # switch) will not work unless make is installed setgid kmem.
|
---|
106 | #
|
---|
107 | inst_setgid = @NEED_SETGID@
|
---|
108 |
|
---|
109 | # Install make setgid to this group so it can get the load average.
|
---|
110 | #
|
---|
111 | inst_group = @KMEM_GROUP@
|
---|
112 |
|
---|
113 | install-exec-local:
|
---|
114 | @if $(inst_setgid); then \
|
---|
115 | app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
---|
116 | if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
---|
117 | echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
---|
118 | else \
|
---|
119 | echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
---|
120 | echo "otherwise the '-l' option will probably not work."; \
|
---|
121 | echo "You may need special privileges to complete the installation"; \
|
---|
122 | echo "of $$app."; \
|
---|
123 | fi; \
|
---|
124 | else true; fi
|
---|
125 |
|
---|
126 | # --------------- Generate the Guile default module content
|
---|
127 |
|
---|
128 | guile.$(OBJEXT): gmk-default.h
|
---|
129 | gmk-default.h: $(srcdir)/gmk-default.scm
|
---|
130 | (echo 'static const char *const GUILE_module_defn = " '\\ \
|
---|
131 | && sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
|
---|
132 | $(srcdir)/gmk-default.scm \
|
---|
133 | && echo '";') > $@
|
---|
134 |
|
---|
135 | # --------------- Local DIST Section
|
---|
136 |
|
---|
137 | # Install the w32 and tests subdirectories
|
---|
138 | #
|
---|
139 | dist-hook:
|
---|
140 | (cd $(srcdir); \
|
---|
141 | 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`; \
|
---|
142 | tar chf - $$sub) \
|
---|
143 | | (cd $(distdir); tar xfBp -)
|
---|
144 |
|
---|
145 |
|
---|
146 | # --------------- Local CHECK Section
|
---|
147 |
|
---|
148 | check-local: check-regression check-loadavg
|
---|
149 | @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
---|
150 | dashes=`echo "$$banner" | sed s/./=/g`; \
|
---|
151 | echo; \
|
---|
152 | echo "$$dashes"; \
|
---|
153 | echo "$$banner"; \
|
---|
154 | echo "$$dashes"; \
|
---|
155 | echo
|
---|
156 |
|
---|
157 | .PHONY: check-loadavg check-regression
|
---|
158 |
|
---|
159 | check-loadavg: loadavg$(EXEEXT)
|
---|
160 | @echo The system uptime program believes the load average to be:
|
---|
161 | -uptime
|
---|
162 | @echo The GNU load average checking code thinks:
|
---|
163 | -./loadavg$(EXEEXT)
|
---|
164 |
|
---|
165 | # The loadavg function is invoked during "make check" to test getloadavg.
|
---|
166 | check_PROGRAMS = loadavg
|
---|
167 | nodist_loadavg_SOURCES = getloadavg.c
|
---|
168 | loadavg_CPPFLAGS = -DTEST
|
---|
169 | loadavg_LDADD = @GETLOADAVG_LIBS@
|
---|
170 |
|
---|
171 | # > check-regression
|
---|
172 | #
|
---|
173 | # Look for the make test suite, and run it if found and we can find perl.
|
---|
174 | # If we're building outside the tree, we use symlinks to make a local copy of
|
---|
175 | # the test suite. Unfortunately the test suite itself isn't localizable yet.
|
---|
176 | #
|
---|
177 | MAKETESTFLAGS =
|
---|
178 |
|
---|
179 | check-regression: tests/config-flags.pm
|
---|
180 | @if test -f '$(srcdir)/tests/run_make_tests'; then \
|
---|
181 | ulimit -n 128; \
|
---|
182 | if $(PERL) -v >/dev/null 2>&1; then \
|
---|
183 | case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
|
---|
184 | *) test -d tests || mkdir tests; \
|
---|
185 | rm -f srctests; \
|
---|
186 | if ln -s '$(srcdir)/tests' srctests; then \
|
---|
187 | for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
---|
188 | rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
---|
189 | done; fi ;; \
|
---|
190 | esac; \
|
---|
191 | echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
---|
192 | cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
|
---|
193 | else \
|
---|
194 | echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
---|
195 | fi; \
|
---|
196 | else \
|
---|
197 | echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
|
---|
198 | fi
|
---|
199 |
|
---|
200 |
|
---|
201 | # --------------- Maintainer's Section
|
---|
202 |
|
---|
203 | # Tell automake that I haven't forgotten about this file and it will be
|
---|
204 | # created before we build a distribution (see maintMakefile in the Git
|
---|
205 | # distribution).
|
---|
206 |
|
---|
207 | README:
|
---|
208 |
|
---|
209 | @MAINT_MAKEFILE@
|
---|