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