summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorPaul Smith <psmith@nuodb.com>2018-07-01 12:28:25 -0400
committerPaul Smith <psmith@gnu.org>2018-07-02 07:54:07 -0400
commit63b42fa235835cbeac6c1b9182f32798ea135dfd (patch)
tree69d0ded9d9a149842a889360987ab42cf6372a1f /Makefile.am
parenta7b0dfddac435eab6017f99f8f5cb18860fb90ac (diff)
downloadmake-git-63b42fa235835cbeac6c1b9182f32798ea135dfd.tar.gz
Convert GNU make to use the gnulib portability library
Move content from glob/* and config/* into standard GNU directory locations lib/* and m4/*. Install the gnulib bootstrap script and its configuration file, and create a bootstrap.bat file for Windows. Update the README.git file with new requirements and instructions for building from Git. At this point we only install the alloca, getloadavg, and FDL modules from gnulib. We keep our old glob/fnmatch implementation since the gnulib versions require significant amounts of infrastructure which doesn't exist on Windows yet. Further work is required here. Due to a problem with gnulib's version of getloadavg, we need to bump the minimum required version of automake to 1.16.1 unfortunately. * README.git: Update instructions * NEWS: Move developer news to a separate section * configure.ac: Update for use with gnulib modules * bootstrap: Bootstrap from Git workspace (import from gnulib) * bootstrap.conf: Bootstrap configuration for GNU make * bootstrap.bat: Bootstrap from Git workspace for Windows * gl/modules/make-glob: Support our local fnmatch/glob implementation * config/acinclude.m4: Move to m4/ * config/dospaths.m4: Move to m4/ * glob/fnmatch.c: Move to lib/ * glob/fnmatch.h.in: Move to lib/ * glob/glob.c: Move to lib/ * glob/glob.h.in: Move to lib/ * Makefile.am: Update for new directories * build.template: Update for new directories * build_w32.bat: Update for new directories * builddos.bat: Update for new directories * maintMakefile: Update for new directories * makefile.com: Update for new directories * mk/Amiga.mk: Update for new directories * mk/Posix.mk.in: Update for new directories * mk/VMS.mk: Update for new directories * mk/Windows32.mk: Update for new directories * mk/msdosdjgpp.mk: Update for new directories * po/LINGUAS: One language per line (needed by gnulib) * INSTALL: Remove (obtained from gnulib) * src/alloca.c: Remove (obtained from gnulib) * src/getloadavg.c: Remove (obtained from gnulib) * po/Makevars: Remove (created by bootstrap) * config/*: Remove leftover files * glob/*: Remove leftover files
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am94
1 files changed, 28 insertions, 66 deletions
diff --git a/Makefile.am b/Makefile.am
index 8097d7b7..3540c555 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,11 +17,11 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
AUTOMAKE_OPTIONS = dist-bzip2 silent-rules std-options subdir-objects nostdinc
-ACLOCAL_AMFLAGS = -I config
+ACLOCAL_AMFLAGS = -I m4
MAKE_HOST = @MAKE_HOST@
-SUBDIRS = glob config po doc
+SUBDIRS = lib po doc
bin_PROGRAMS = make
include_HEADERS = src/gnumake.h
@@ -38,12 +38,6 @@ make_SRCS = src/ar.c src/arscan.c src/commands.c src/commands.h \
src/rule.c src/rule.h src/signame.c src/strcache.c \
src/variable.c src/variable.h src/version.c src/vpath.c
-glob_SRCS = glob/fnmatch.c glob/fnmatch.h glob/glob.c glob/glob.h
-
-loadavg_SRCS = src/getloadavg.c
-
-alloca_SRCS = src/alloca.c
-
w32_SRCS = src/w32/pathstuff.c src/w32/w32os.c src/w32/compat/dirent.c \
src/w32/compat/posixfcn.c src/w32/include/dirent.h \
src/w32/include/dlfcn.h src/w32/include/pathstuff.h \
@@ -56,16 +50,23 @@ vms_SRCS = src/vms_exit.c src/vms_export_symbol.c src/vms_progname.c \
amiga_SRCS = src/amiga.c src/amiga.h
+glob_SRCS = lib/fnmatch.c lib/fnmatch.h lib/glob.c lib/glob.h
+
+alloca_SRCS = lib/alloca.c
+
+loadavg_SRCS = lib/getloadavg.c
+
make_SOURCES = $(make_SRCS)
EXTRA_make_SOURCES = $(amiga_SRCS) $(vms_SRCS)
-make_LDADD = $(GUILE_LIBS) $(LIBOBJS) $(ALLOCA) $(GLOBLIB) \
- @GETLOADAVG_LIBS@ @LIBINTL@
+make_LDADD = $(LIBOBJS) $(GUILE_LIBS) lib/libgnu.a $(GETLOADAVG_LIBS) \
+ @LIBINTL@
localedir = $(datadir)/locale
-AM_CPPFLAGS = -Isrc -I$(srcdir)/src $(GLOBINC) -DLIBDIR=\"$(libdir)\" \
- -DINCLUDEDIR=\"$(includedir)\" -DLOCALEDIR=\"$(localedir)\"
+AM_CPPFLAGS = -Isrc -I$(top_srcdir)/src -Ilib -I$(top_srcdir)/lib \
+ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" \
+ -DLOCALEDIR=\"$(localedir)\"
AM_CFLAGS = $(GUILE_CFLAGS)
@@ -88,6 +89,8 @@ mk_FILES = Basic.mk mk/msdosdjgpp.mk mk/Amiga.mk mk/VMS.mk mk/Windows32.mk
# We don't need this, since the standard automake output will do.
#mk/Posix.mk.in
+m4_FILES = m4/gnulib-cache.m4
+
test_FILES = tests/run_make_tests tests/run_make_tests.bat \
tests/run_make_tests.pl tests/test_driver.pl \
tests/config-flags.pm.in tests/config_flags_pm.com \
@@ -102,49 +105,20 @@ EXTRA_DIST = ChangeLog README build.sh.in $(man_MANS) \
README.VMS makefile.com src/config.h-vms src/vmsjobs.c \
vms_export_symbol_test.com \
src/gmk-default.scm src/gmk-default.h \
- $(mk_FILES) $(test_FILES)
+ $(mk_FILES) $(m4_FILES) $(test_FILES)
# This is built during configure, but behind configure's back
DISTCLEANFILES = build.sh
-# --------------- Local INSTALL Section
-
-# If necessary, change the gid of the app and turn on the setgid flag.
-#
-
-# Whether or not make needs to be installed setgid.
-# The value should be either 'true' or 'false'.
-# On some systems, the getloadavg function (used to implement the '-l'
-# switch) will not work unless make is installed setgid kmem.
-#
-inst_setgid = @NEED_SETGID@
-
-# Install make setgid to this group so it can get the load average.
-#
-inst_group = @KMEM_GROUP@
-
-install-exec-local:
- @if $(inst_setgid); then \
- app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
- if chgrp $(inst_group) $$app && chmod g+s $$app; then \
- echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
- else \
- echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
- echo "otherwise the '-l' option will probably not work."; \
- echo "You may need special privileges to complete the installation"; \
- echo "of $$app."; \
- fi; \
- else true; fi
-
# --------------- Generate the Guile default module content
src/guile.$(OBJEXT): src/gmk-default.h
-src/gmk-default.h: $(srcdir)/src/gmk-default.scm
+src/gmk-default.h: $(top_srcdir)/src/gmk-default.scm
(echo 'static const char *const GUILE_module_defn = " '\\ \
&& sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
- $(srcdir)/src/gmk-default.scm \
+ $(top_srcdir)/src/gmk-default.scm \
&& echo '";') > src/gmk-default.h
# --------------- Local DIST Section
@@ -152,7 +126,7 @@ src/gmk-default.h: $(srcdir)/src/gmk-default.scm
# Install the mk and tests subdirectories
#
dist-hook:
- (cd $(srcdir); \
+ (cd $(top_srcdir); \
sub=`find tests/scripts -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name \*.out -o -name Makefile \) -prune -o -type f -print`; \
tar chf - $$sub) \
| (cd $(distdir); tar xfBp -)
@@ -160,7 +134,7 @@ dist-hook:
# --------------- Local CHECK Section
-check-local: check-regression check-loadavg
+check-local: check-regression
@banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo; \
@@ -169,20 +143,6 @@ check-local: check-regression check-loadavg
echo "$$dashes"; \
echo
-.PHONY: check-loadavg check-regression
-
-check-loadavg: loadavg$(EXEEXT)
- @echo The system uptime program believes the load average to be:
- -uptime
- @echo The GNU load average checking code thinks:
- -./loadavg$(EXEEXT)
-
-# The loadavg function is invoked during "make check" to test getloadavg.
-check_PROGRAMS = loadavg
-nodist_loadavg_SOURCES = $(loadavg_SRCS)
-loadavg_CPPFLAGS = -Isrc -I$(srcdir)/src -DTEST
-loadavg_LDADD = @GETLOADAVG_LIBS@
-
# > check-regression
#
# Look for the make test suite, and run it if found and we can find perl.
@@ -191,25 +151,27 @@ loadavg_LDADD = @GETLOADAVG_LIBS@
#
MAKETESTFLAGS =
+.PHONY: check-regression
+
check-regression: tests/config-flags.pm
- @if test -f '$(srcdir)/tests/run_make_tests'; then \
+ @if test -f '$(top_srcdir)/tests/run_make_tests'; then \
ulimit -n 128; \
if $(PERL) -v >/dev/null 2>&1; then \
- case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
+ case `cd '$(top_srcdir)'; pwd` in `pwd`) : ;; \
*) test -d tests || mkdir tests; \
rm -f srctests; \
- if ln -s '$(srcdir)/tests' srctests; then \
+ if ln -s '$(top_srcdir)/tests' srctests; then \
for f in run_make_tests run_make_tests.pl test_driver.pl scripts jhelp.pl; do \
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
done; fi ;; \
esac; \
- echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
- cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
+ echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
+ cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
else \
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
fi; \
else \
- echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
+ echo "Can't find the GNU Make test suite ($(top_srcdir)/tests)."; \
fi