Switch from recursive to non-recursive use of Gnulib.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Mar 2022 19:34:36 +0000 (12:34 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Mar 2022 19:34:36 +0000 (12:34 -0700)
This allows for better use of dependencies in Makefiles.  It causes a new
warning from Automake, which I hope to fix through a change to Gnulib
sometime soon.  I'm consulting the other Gnulib maintainers on that:
https://lists.gnu.org/archive/html/bug-gnulib/2022-03/msg00044.html

Makefile.am
Smake
configure.ac
po/automake.mk

index 98e8573669b5cc3aa5da65512b1addfef05599d4..1c345a1441e5f927583a90b81c45dc8e467dc822 100644 (file)
@@ -18,7 +18,7 @@
 
 AUTOMAKE_OPTIONS = std-options check-news 1.14 subdir-objects
 
-SUBDIRS = gl po
+SUBDIRS = po
 DISTCLEANFILES = ./po/stamp-po xconfigure
 BUILT_SOURCES =
 built-sources: $(BUILT_SOURCES)
@@ -38,6 +38,10 @@ pkgsysconfdir = $(sysconfdir)/$(PACKAGE)
 EXTRA_DIST = ONEWS
 
 CLEANFILES =
+MOSTLYCLEANDIRS =
+MOSTLYCLEANFILES =
+MAINTAINERCLEANFILES =
+
 CLEAN_LOCAL =
 ALL_LOCAL =
 CHECK_LOCAL =
@@ -55,9 +59,6 @@ PHONY =
 SUFFIXES =
 LDADD = gl/libgl.la
 
-gl/libgl.la: config.h
-       $(MAKE) -C gl
-
 # This ensures that files added to EXTRA_DIST are always distributed,
 # even if they are inside an Automake if...endif conditional block that is
 # disabled by some particular "configure" run.  For more information, see:
@@ -74,8 +75,10 @@ generate-changelog:
 
 DIST_HOOKS += generate-changelog
 
+GL_CFLAG_GNULIB_WARNINGS = -Wno-missing-prototypes -Wno-unused-parameter
 
 include $(top_srcdir)/build-aux/automake.mk
+include $(top_srcdir)/gl/automake.mk
 include $(top_srcdir)/po/automake.mk
 include $(top_srcdir)/lib/automake.mk
 include $(top_srcdir)/examples/automake.mk
diff --git a/Smake b/Smake
index 0b64221ca2c16358f80b1c2cef5b94e5e9e9ed4a..597baea4f256a131385bb5559c77ae734dd6aae2 100644 (file)
--- a/Smake
+++ b/Smake
@@ -336,7 +336,8 @@ prep_ph:
        touch build-aux/config.rpath
        $(GNULIB_TOOL) --add-import --no-changelog --m4-base=gl/m4 \
                --source-base=gl --lib=libgl --tests-base=tests \
-               --doc-base=gl/doc --aux-dir=build-aux  \
+               --doc-base=gl/doc --aux-dir=build-aux \
+               --makefile-name=automake.mk --automake-subdir \
                --libtool $(GNULIB_MODULES)
        if (glibtoolize --version) >/dev/null 2>&1; then        \
                LIBTOOLIZE=glibtoolize;                         \
@@ -404,6 +405,7 @@ clean: clean-icons
        rm -f config.h.in~
        rm -f config.h.in
        rm -f gl/Makefile.in
+       rm -f gl/automake.mk
        rm -f Makefile.in
        rm -f build-aux/compile
        rm -f build-aux/ltmain.sh
index 67a37f9fabd8747f341d6af26657ab9741d5bf5d..6d2aeda9745c5b4973b305617321b35c6b3e0969 100644 (file)
@@ -312,7 +312,7 @@ dnl it can make arrangements to build the documentation examples.
 AM_CONDITIONAL(cross_compiling, test x"$cross_compiling" = x"yes" )
 
 AC_CONFIG_FILES(
-  [Makefile gl/Makefile po/Makefile tests/atlocal perl-module/lib/PSPP.pm])
+  [Makefile po/Makefile tests/atlocal perl-module/lib/PSPP.pm])
 
 AC_CONFIG_COMMANDS([doc/pspp-figures/dummy], [:])
 
index 6c465a183e84dfa56ac9ee76b619cb75c6e303f8..5d207682c3d3fe8079c5ebc179eb816917ae8e17 100644 (file)
@@ -94,12 +94,13 @@ install-data-hook: $(GMOFILES)
          $(INSTALL_DATA) $$f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
        done
 
-uninstall-hook:
+uninstall-hook: uninstall-gmofiles
+uninstall-gmofiles:
        for f in $(GMOFILES); do \
          lang=`echo $$f | $(SED) -e 's%po/\(.*\)\.gmo%\1%' ` ; \
          rm -f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
        done
-
+.PHONY: uninstall-gmofiles
 
 EXTRA_DIST += \
        $(LOCALPOFILES) \