1 # This is a -*-Makefile-*-, or close enough
3 AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr
4 ACLOCAL_AMFLAGS = -I config
6 # Only process if target is MS-Windows
9 W32INC = -I $(top_srcdir)/w32/include
13 SUBDIRS = glob config po doc $(MAYBE_W32)
18 remote = remote-cstms.c
20 remote = remote-stub.c
24 make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
25 function.c getopt.c getopt1.c implicit.c job.c main.c \
26 misc.c read.c remake.c $(remote) rule.c signame.c \
27 variable.c version.c vpath.c hash.c
29 EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
31 noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
32 debug.h getopt.h gettext.h hash.h
34 make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@
35 # Only process if target is MS-Windows
37 make_LDADD += $(W32LIB)
42 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
44 AM_CPPFLAGS = $(GLOBINC)
45 # Only process if target is MS-Windows
47 AM_CPPFLAGS += $(W32INC)
51 # Extra stuff to include in the distribution.
52 # Note we need all the glob stuff here, rather than in glob/Makefile.am,
53 # because often that directory isn't built on the systems used by the
56 EXTRA_DIST = README build.sh.in $(man_MANS) \
57 README.customs README.OS2 \
59 README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
60 README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
61 README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
62 make_msvc_net2003.sln make_msvc_net2003.vcproj \
63 readme.vms makefile.vms makefile.com config.h-vms \
64 vmsdir.h vmsfunctions.c vmsify.c
66 MAKE_HOST = @MAKE_HOST@
72 cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
76 # --------------- Internationalization Section
78 localedir = $(datadir)/locale
80 # --------------- Local INSTALL Section
82 # If necessary, change the gid of the app and turn on the setgid flag.
85 # Whether or not make needs to be installed setgid.
86 # The value should be either `true' or `false'.
87 # On many systems, the getloadavg function (used to implement the `-l'
88 # switch) will not work unless make is installed setgid kmem.
90 inst_setgid = @NEED_SETGID@
92 # Install make setgid to this group so it can get the load average.
94 inst_group = @KMEM_GROUP@
97 @if $(inst_setgid); then \
98 app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
99 if chgrp $(inst_group) $$app && chmod g+s $$app; then \
100 echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
102 echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
103 echo "otherwise the \`-l' option will probably not work."; \
104 echo "You may need special privileges to complete the installation"; \
109 # --------------- Local DIST Section
111 # Install the w32 and tests subdirectories
115 sub=`find w32 tests -follow \( -name CVS -prune -o -name .cvsignore -o -name work -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
117 | (cd $(distdir); tar xfBp -)
120 # --------------- Local CHECK Section
122 check-local: check-regression check-loadavg
123 @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
124 dashes=`echo "$$banner" | sed s/./=/g`; \
131 .PHONY: check-loadavg check-regression
133 check-loadavg: loadavg$(EXEEXT)
134 @echo The system uptime program believes the load average to be:
136 @echo The GNU load average checking code thinks:
139 # The loadavg function is invoked during "make check" to test getloadavg.
140 noinst_PROGRAMS = loadavg
141 nodist_loadavg_SOURCES = getloadavg.c
142 loadavg_CPPFLAGS = -DTEST
143 loadavg_LDADD = @GETLOADAVG_LIBS@
147 # Look for the make test suite, and run it if found and we can find perl.
148 # If we're building outside the tree, we use symlinks to make a local copy of
149 # the test suite. Unfortunately the test suite itself isn't localizable yet.
154 @if test -f "$(srcdir)/tests/run_make_tests"; then \
155 if $(PERL) -v >/dev/null 2>&1; then \
156 case `cd $(srcdir); pwd` in `pwd`) : ;; \
157 *) test -d tests || mkdir tests; \
159 if ln -s "$(srcdir)/tests" srctests; then \
160 for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
161 rm -f tests/$$f; ln -s ../srctests/$$f tests; \
164 echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
165 cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \
167 echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
170 echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
174 # --------------- Maintainer's Section
176 # Tell automake that I haven't forgotten about this file and it will be
177 # created before we build a distribution (see maintMakefile in the CVS