1 # This is a -*-Makefile-*-, or close enough
7 make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
8 rule.c implicit.c default.c variable.c expand.c function.c \
9 vpath.c version.c ar.c arscan.c remote-$(REMOTE).c \
10 commands.h dep.h filedef.h job.h make.h rule.h variable.h \
12 getopt.c getopt1.c getopt.h
13 make_LDADD = @LIBOBJS@ @ALLOCA@ @GLOBLIB@
15 info_TEXINFOS = make.texinfo
18 INCLUDES = -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
20 EXTRA_DIST = README build.sh.in $(man_MANS) README.customs remote-cstms.c\
21 make-stds.texi texinfo.tex SCOPTIONS SMakefile\
22 README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
23 README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
24 README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat\
25 readme.vms makefile.vms makefile.com config.h-vms vmsdir.h\
26 vmsfunctions.c vmsify.c
30 MOSTLYCLEANFILES = loadavg.c
33 MAKE_HOST = @MAKE_HOST@
36 # --------------- Local INSTALL Section
38 # If necessary, change the gid of the app and turn on the setgid flag.
41 # Whether or not make needs to be installed setgid.
42 # The value should be either `true' or `false'.
43 # On many systems, the getloadavg function (used to implement the `-l'
44 # switch) will not work unless make is installed setgid kmem.
46 inst_setgid = @NEED_SETGID@
48 # Install make setgid to this group so it can get the load average.
50 inst_group = @KMEM_GROUP@
53 @if $(inst_setgid); then \
54 app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
55 if chgrp $(inst_group) $$app && chmod g+s $$app; then \
56 echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
58 echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
59 echo "otherwise the \`-l' option will probably not work."; \
60 echo "You may need special privileges to complete the installation"; \
65 # --------------- Local DIST Section
67 # Install the w32 and tests subdirectories
71 sub=`find w32 tests -follow \( -name CVS -prune -o -name work -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
73 | (cd $(distdir); tar xfBp -)
76 # --------------- Local CHECK Section
78 check-local: check-regression check-loadavg
79 @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
80 dashes=`echo "$$banner" | sed s/./=/g`; \
87 .PHONY: check-loadavg check-regression
91 loadavg: loadavg.c config.h
93 $(LINK) $(DEFS) $(CPPFLAGS) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
95 # We copy getloadavg.c into a different file rather than compiling it
96 # directly because some compilers clobber getloadavg.o in the process.
98 loadavg.c: getloadavg.c
99 ln $(srcdir)/getloadavg.c loadavg.c || \
100 cp $(srcdir)/getloadavg.c loadavg.c
102 check-loadavg: loadavg
103 @echo The system uptime program believes the load average to be:
105 @echo The GNU load average checking code believes:
110 # Look for the make test suite, and run it if found and we can find perl.
111 # If we're building outside the tree, we use symlinks to make a local copy of
112 # the test suite. Unfortunately the test suite itself isn't localizable yet.
117 @if test -f "$(srcdir)/tests/run_make_tests"; then \
118 if $(PERL) -v >/dev/null 2>&1; then \
119 case `cd $(srcdir); pwd` in `pwd`) : ;; \
120 *) test -d tests || mkdir tests; \
122 if ln -s "$(srcdir)/tests" srctests; then \
123 for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
124 rm -f tests/$$f; ln -s ../srctests/$$f tests; \
127 echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS)"; \
128 cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS); \
130 echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
133 echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
137 # --------------- Local CLEAN section
139 maintainer-clean-local:
140 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
143 # --------------- Maintainer's Section