Savannah bug #37179: Use alternate shared library syntax for MacOS.
[make.git] / Makefile.am
blob592de9f8e4b3d96fbe668e0cd4c1f190dcd53173
1 # This is a -*-Makefile-*-, or close enough
3 # Copyright (C) 1997-2012 Free Software Foundation, Inc.
4 # This file is part of GNU Make.
6 # GNU Make is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 3 of the License, or (at your option) any later
9 # version.
11 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
14 # details.
16 # You should have received a copy of the GNU General Public License along with
17 # this program.  If not, see <http://www.gnu.org/licenses/>.
19 AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news
20 ACLOCAL_AMFLAGS =  -I config
22 MAKE_HOST =     @MAKE_HOST@
24 # Only process if target is MS-Windows
25 if WINDOWSENV
26   MAYBE_W32 =   w32
27   W32INC =      -I $(top_srcdir)/w32/include
28   W32LIB =      -Lw32 -lw32
29 endif
31 SUBDIRS =       glob config po doc $(MAYBE_W32)
33 bin_PROGRAMS =  make
35 if USE_CUSTOMS
36   remote =      remote-cstms.c
37 else
38   remote =      remote-stub.c
39 endif
41 make_SOURCES =  ar.c arscan.c commands.c default.c dir.c expand.c file.c \
42                 function.c getopt.c getopt1.c implicit.c job.c main.c \
43                 misc.c read.c remake.c rule.c signame.c \
44                 strcache.c variable.c version.c vpath.c hash.c \
45                 $(remote)
47 if HAVE_GUILE
48   make_SOURCES += guile.c
49 endif
51 EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
53 noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
54                 debug.h getopt.h gettext.h hash.h
56 make_LDADD =    @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \
57                 $(GUILE_LIBS)
58 # Only process if target is MS-Windows
59 if WINDOWSENV
60     make_LDADD += $(W32LIB)
61 endif
63 man_MANS =      make.1
65 DEFS =          -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
67 AM_CPPFLAGS =   $(GLOBINC)
68 AM_CFLAGS =     $(GUILE_CFLAGS)
69 # Only process if target is MS-Windows
70 if WINDOWSENV
71     AM_CPPFLAGS +=      $(W32INC)
72 endif
75 # Extra stuff to include in the distribution.
77 EXTRA_DIST =    README build.sh.in $(man_MANS) \
78                 README.customs README.OS2 \
79                 SCOPTIONS SMakefile \
80                 README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
81                 README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
82                 README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
83                 make_msvc_net2003.sln make_msvc_net2003.vcproj \
84                 readme.vms makefile.vms makefile.com config.h-vms \
85                 vmsdir.h vmsfunctions.c vmsify.c \
86                 gmk-default.scm gmk-default.h
88 # This is built during configure, but behind configure's back
90 DISTCLEANFILES = build.sh
92 # Forward targets
94 html:
95         cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
97 .PHONY: html
99 # --------------- Internationalization Section
101 localedir =     $(datadir)/locale
103 # --------------- Local INSTALL Section
105 # If necessary, change the gid of the app and turn on the setgid flag.
108 # Whether or not make needs to be installed setgid.
109 # The value should be either 'true' or 'false'.
110 # On many systems, the getloadavg function (used to implement the '-l'
111 # switch) will not work unless make is installed setgid kmem.
113 inst_setgid = @NEED_SETGID@
115 # Install make setgid to this group so it can get the load average.
117 inst_group = @KMEM_GROUP@
119 install-exec-local:
120         @if $(inst_setgid); then \
121            app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
122            if chgrp $(inst_group) $$app && chmod g+s $$app; then \
123              echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
124            else \
125              echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
126              echo "otherwise the '-l' option will probably not work."; \
127              echo "You may need special privileges to complete the installation"; \
128              echo "of $$app."; \
129            fi; \
130          else true; fi
132 # --------------- Generate the Guile default module content
134 guile.$(OBJEXT): gmk-default.h
135 gmk-default.h: $(srcdir)/gmk-default.scm
136         (echo 'static const char *const GUILE_module_defn = " '\\ \
137           && sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
138                  $(srcdir)/gmk-default.scm \
139           && echo '";') > $@
141 # --------------- Local DIST Section
143 # Install the w32 and tests subdirectories
145 dist-hook:
146         (cd $(srcdir); \
147          sub=`find w32 tests -follow \( -name CVS -o -name .deps -o -name work -o -name .cvsignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
148          tar chf - $$sub) \
149         | (cd $(distdir); tar xfBp -)
152 # --------------- Local CHECK Section
154 check-local: check-regression check-loadavg
155         @banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
156         dashes=`echo "$$banner" | sed s/./=/g`; \
157         echo; \
158         echo "$$dashes"; \
159         echo "$$banner"; \
160         echo "$$dashes"; \
161         echo
163 .PHONY: check-loadavg check-regression
165 check-loadavg: loadavg$(EXEEXT)
166         @echo The system uptime program believes the load average to be:
167         -uptime
168         @echo The GNU load average checking code thinks:
169         -./loadavg$(EXEEXT)
171 # The loadavg function is invoked during "make check" to test getloadavg.
172 check_PROGRAMS = loadavg
173 nodist_loadavg_SOURCES = getloadavg.c
174 loadavg_CPPFLAGS = -DTEST
175 loadavg_LDADD = @GETLOADAVG_LIBS@
177 # > check-regression
179 # Look for the make test suite, and run it if found and we can find perl.
180 # If we're building outside the tree, we use symlinks to make a local copy of
181 # the test suite.  Unfortunately the test suite itself isn't localizable yet.
183 MAKETESTFLAGS =
185 check-regression:
186         @if test -f "$(srcdir)/tests/run_make_tests"; then \
187           if $(PERL) -v >/dev/null 2>&1; then \
188             case `cd $(srcdir); pwd` in `pwd`) : ;; \
189               *) test -d tests || mkdir tests; \
190                  rm -f srctests; \
191                  if ln -s "$(srcdir)/tests" srctests; then \
192                    for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
193                      rm -f tests/$$f; ln -s ../srctests/$$f tests; \
194                    done; fi ;; \
195             esac; \
196             echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
197             cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \
198           else \
199             echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
200           fi; \
201          else \
202           echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
203          fi
206 # --------------- Maintainer's Section
208 # Tell automake that I haven't forgotten about this file and it will be
209 # created before we build a distribution (see maintMakefile in the CVS
210 # distribution).
212 README:
214 @MAINT_MAKEFILE@