| 1 | # This is a -*-Makefile-*-, or close enough
|
|---|
| 2 |
|
|---|
| 3 | AUTOMAKE_OPTIONS = 1.7.6 dist-bzip2 check-news ansi2knr
|
|---|
| 4 | ACLOCAL_AMFLAGS = -I config
|
|---|
| 5 |
|
|---|
| 6 | SUBDIRS = glob config po doc
|
|---|
| 7 |
|
|---|
| 8 | bin_PROGRAMS = make
|
|---|
| 9 |
|
|---|
| 10 | if USE_CUSTOMS
|
|---|
| 11 | remote = remote-cstms.c
|
|---|
| 12 | else
|
|---|
| 13 | remote = remote-stub.c
|
|---|
| 14 | endif
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
|
|---|
| 18 | function.c getopt.c getopt1.c implicit.c job.c main.c \
|
|---|
| 19 | misc.c read.c remake.c $(remote) rule.c signame.c \
|
|---|
| 20 | variable.c version.c vpath.c hash.c
|
|---|
| 21 |
|
|---|
| 22 | EXTRA_make_SOURCES = remote-stub.c remote-cstms.c
|
|---|
| 23 |
|
|---|
| 24 | noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
|---|
| 25 | debug.h getopt.h gettext.h hash.h
|
|---|
| 26 |
|
|---|
| 27 | make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@
|
|---|
| 28 |
|
|---|
| 29 | man_MANS = make.1
|
|---|
| 30 |
|
|---|
| 31 | DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
|
|---|
| 32 |
|
|---|
| 33 | AM_CPPFLAGS = $(GLOBINC)
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | # Extra stuff to include in the distribution.
|
|---|
| 37 | # Note we need all the glob stuff here, rather than in glob/Makefile.am,
|
|---|
| 38 | # because often that directory isn't built on the systems used by the
|
|---|
| 39 | # maintainers.
|
|---|
| 40 |
|
|---|
| 41 | EXTRA_DIST = README build.sh.in $(man_MANS) \
|
|---|
| 42 | README.customs README.OS2 \
|
|---|
| 43 | SCOPTIONS SMakefile \
|
|---|
| 44 | README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
|
|---|
| 45 | README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
|---|
| 46 | README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
|
|---|
| 47 | readme.vms makefile.vms makefile.com config.h-vms \
|
|---|
| 48 | vmsdir.h vmsfunctions.c vmsify.c
|
|---|
| 49 |
|
|---|
| 50 | MAKE_HOST = @MAKE_HOST@
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 | # Forward targets
|
|---|
| 54 |
|
|---|
| 55 | html:
|
|---|
| 56 | cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
|
|---|
| 57 |
|
|---|
| 58 | .PHONY: html
|
|---|
| 59 |
|
|---|
| 60 | # --------------- Internationalization Section
|
|---|
| 61 |
|
|---|
| 62 | localedir = $(datadir)/locale
|
|---|
| 63 |
|
|---|
| 64 | # We need this due to a bug in gettext 0.12.1 Makefile.in.in: without this I
|
|---|
| 65 | # can't run distcheck because this file is created but not removed during
|
|---|
| 66 | # distclean.
|
|---|
| 67 |
|
|---|
| 68 | distclean-local:
|
|---|
| 69 | test "$(srcdir)" = . || rm -f po/stamp-po
|
|---|
| 70 |
|
|---|
| 71 | # --------------- Local INSTALL Section
|
|---|
| 72 |
|
|---|
| 73 | # If necessary, change the gid of the app and turn on the setgid flag.
|
|---|
| 74 | #
|
|---|
| 75 |
|
|---|
| 76 | # Whether or not make needs to be installed setgid.
|
|---|
| 77 | # The value should be either `true' or `false'.
|
|---|
| 78 | # On many systems, the getloadavg function (used to implement the `-l'
|
|---|
| 79 | # switch) will not work unless make is installed setgid kmem.
|
|---|
| 80 | #
|
|---|
| 81 | inst_setgid = @NEED_SETGID@
|
|---|
| 82 |
|
|---|
| 83 | # Install make setgid to this group so it can get the load average.
|
|---|
| 84 | #
|
|---|
| 85 | inst_group = @KMEM_GROUP@
|
|---|
| 86 |
|
|---|
| 87 | install-exec-local:
|
|---|
| 88 | @if $(inst_setgid); then \
|
|---|
| 89 | app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
|---|
| 90 | if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
|---|
| 91 | echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
|---|
| 92 | else \
|
|---|
| 93 | echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
|---|
| 94 | echo "otherwise the \`-l' option will probably not work."; \
|
|---|
| 95 | echo "You may need special privileges to complete the installation"; \
|
|---|
| 96 | echo "of $$app."; \
|
|---|
| 97 | fi; \
|
|---|
| 98 | else true; fi
|
|---|
| 99 |
|
|---|
| 100 | # --------------- Local DIST Section
|
|---|
| 101 |
|
|---|
| 102 | # Install the w32 and tests subdirectories
|
|---|
| 103 | #
|
|---|
| 104 | dist-hook:
|
|---|
| 105 | (cd $(srcdir); \
|
|---|
| 106 | 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`; \
|
|---|
| 107 | tar chf - $$sub) \
|
|---|
| 108 | | (cd $(distdir); tar xfBp -)
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | # --------------- Local CHECK Section
|
|---|
| 112 |
|
|---|
| 113 | check-local: check-regression check-loadavg
|
|---|
| 114 | @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
|---|
| 115 | dashes=`echo "$$banner" | sed s/./=/g`; \
|
|---|
| 116 | echo; \
|
|---|
| 117 | echo "$$dashes"; \
|
|---|
| 118 | echo "$$banner"; \
|
|---|
| 119 | echo "$$dashes"; \
|
|---|
| 120 | echo
|
|---|
| 121 |
|
|---|
| 122 | .PHONY: check-loadavg check-regression
|
|---|
| 123 |
|
|---|
| 124 | check-loadavg: loadavg
|
|---|
| 125 | @echo The system uptime program believes the load average to be:
|
|---|
| 126 | -uptime
|
|---|
| 127 | @echo The GNU load average checking code thinks:
|
|---|
| 128 | -./loadavg
|
|---|
| 129 |
|
|---|
| 130 | # The loadavg function is invoked during "make check" to test getloadavg.
|
|---|
| 131 | noinst_PROGRAMS = loadavg
|
|---|
| 132 | nodist_loadavg_SOURCES = getloadavg.c
|
|---|
| 133 | loadavg_CPPFLAGS = -DTEST
|
|---|
| 134 | loadavg_LDADD = @GETLOADAVG_LIBS@
|
|---|
| 135 |
|
|---|
| 136 | # > check-regression
|
|---|
| 137 | #
|
|---|
| 138 | # Look for the make test suite, and run it if found and we can find perl.
|
|---|
| 139 | # If we're building outside the tree, we use symlinks to make a local copy of
|
|---|
| 140 | # the test suite. Unfortunately the test suite itself isn't localizable yet.
|
|---|
| 141 | #
|
|---|
| 142 | MAKETESTFLAGS =
|
|---|
| 143 |
|
|---|
| 144 | check-regression:
|
|---|
| 145 | @if test -f "$(srcdir)/tests/run_make_tests"; then \
|
|---|
| 146 | if $(PERL) -v >/dev/null 2>&1; then \
|
|---|
| 147 | case `cd $(srcdir); pwd` in `pwd`) : ;; \
|
|---|
| 148 | *) test -d tests || mkdir tests; \
|
|---|
| 149 | rm -f srctests; \
|
|---|
| 150 | if ln -s "$(srcdir)/tests" srctests; then \
|
|---|
| 151 | for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
|---|
| 152 | rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
|---|
| 153 | done; fi ;; \
|
|---|
| 154 | esac; \
|
|---|
| 155 | echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS)"; \
|
|---|
| 156 | cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS); \
|
|---|
| 157 | else \
|
|---|
| 158 | echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
|---|
| 159 | fi; \
|
|---|
| 160 | else \
|
|---|
| 161 | echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
|
|---|
| 162 | fi
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 | # --------------- Maintainer's Section
|
|---|
| 166 |
|
|---|
| 167 | @MAINT_MAKEFILE@
|
|---|