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 readme.vms makefile.vms makefile.com config.h-vms \
63 vmsdir.h vmsfunctions.c vmsify.c
65 MAKE_HOST = @MAKE_HOST@
71 cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
75 # --------------- Internationalization Section
77 localedir = $(datadir)/locale
79 # --------------- Local INSTALL Section
81 # If necessary, change the gid of the app and turn on the setgid flag.
84 # Whether or not make needs to be installed setgid.
85 # The value should be either `true' or `false'.
86 # On many systems, the getloadavg function (used to implement the `-l'
87 # switch) will not work unless make is installed setgid kmem.
89 inst_setgid = @NEED_SETGID@
91 # Install make setgid to this group so it can get the load average.
93 inst_group = @KMEM_GROUP@
96 @if $(inst_setgid); then \
97 app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
98 if chgrp $(inst_group) $$app && chmod g+s $$app; then \
99 echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
101 echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
102 echo "otherwise the \`-l' option will probably not work."; \
103 echo "You may need special privileges to complete the installation"; \
108 # --------------- Local DIST Section
110 # Install the w32 and tests subdirectories
114 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`; \
116 | (cd $(distdir); tar xfBp -)
119 # --------------- Local CHECK Section
121 check-local: check-regression check-loadavg
122 @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
123 dashes=`echo "$$banner" | sed s/./=/g`; \
130 .PHONY: check-loadavg check-regression
132 check-loadavg: loadavg$(EXEEXT)
133 @echo The system uptime program believes the load average to be:
135 @echo The GNU load average checking code thinks:
138 # The loadavg function is invoked during "make check" to test getloadavg.
139 noinst_PROGRAMS = loadavg
140 nodist_loadavg_SOURCES = getloadavg.c
141 loadavg_CPPFLAGS = -DTEST
142 loadavg_LDADD = @GETLOADAVG_LIBS@
146 # Look for the make test suite, and run it if found and we can find perl.
147 # If we're building outside the tree, we use symlinks to make a local copy of
148 # the test suite. Unfortunately the test suite itself isn't localizable yet.
153 @if test -f "$(srcdir)/tests/run_make_tests"; then \
154 if $(PERL) -v >/dev/null 2>&1; then \
155 case `cd $(srcdir); pwd` in `pwd`) : ;; \
156 *) test -d tests || mkdir tests; \
158 if ln -s "$(srcdir)/tests" srctests; then \
159 for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
160 rm -f tests/$$f; ln -s ../srctests/$$f tests; \
163 echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
164 cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \
166 echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
169 echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
173 # --------------- Maintainer's Section
175 # Tell automake that I haven't forgotten about this file and it will be
176 # created before we build a distribution (see maintMakefile in the CVS