[PATCH 1/5] libgloss: convert top level to automake

Mike Frysinger vapier@gentoo.org
Sat Feb 5 05:46:52 GMT 2022


The top level dir isn't doing anything interesting, just recursing into
subdirs.  So this change isn't terribly exciting.  But it sets us up for
doing more fun stuff in follow up commits.

[TODO] Check test targets
---
 libgloss/Makefile.am       |  38 ++
 libgloss/Makefile.in       | 842 +++++++++++++++++++++++++++++--------
 libgloss/config/default.mh |   3 +
 libgloss/configure.ac      |   2 +-
 4 files changed, 715 insertions(+), 170 deletions(-)
 create mode 100644 libgloss/Makefile.am

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
new file mode 100644
index 000000000000..0779da76dd76
--- /dev/null
+++ b/libgloss/Makefile.am
@@ -0,0 +1,38 @@
+## Top level makefile for libgloss
+
+ACLOCAL_AMFLAGS = -I . -I .. -I ../config
+
+# Variables that will accumulate in subdirs.
+PHONY =
+
+SUBDIRS = @subdirs@ .
+
+tooldir = $(exec_prefix)/$(target_alias)
+
+## These are roughly topologically sorted in order to make porting more
+## streamlined.
+FLAGS_TO_PASS = \
+	"CC=$(CC)" \
+	"CFLAGS=$(CFLAGS)" \
+	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+	"CCASFLAGS=$(CCASFLAGS)" \
+	"AR=$(AR)" \
+	"RANLIB=$(RANLIB)" \
+	"AR_FLAGS=$(AR_FLAGS)" \
+	"MAKEINFO=$(MAKEINFO)" \
+	"AS=$(AS)" \
+	"LD=$(LD)" \
+	"CROSS_CFLAGS=$(CROSS_CFLAGS)" \
+	"TARGET_CFLAGS=$(TARGET_CFLAGS)" \
+	"exec_prefix=$(exec_prefix)" \
+	"prefix=$(prefix)" \
+	"tooldir=$(tooldir)" \
+	"infodir=$(infodir)" \
+	"libdir=$(libdir)" \
+	"top_toollibdir=$(toollibdir)" \
+	"INSTALL=$(INSTALL)" \
+	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+	"INSTALL_DATA=$(INSTALL_DATA)" \
+	"DESTDIR=$(DESTDIR)"
+
+include $(top_srcdir)/../multilib.am
diff --git a/libgloss/config/default.mh b/libgloss/config/default.mh
index 987dc390dc50..4e7f106f9366 100644
--- a/libgloss/config/default.mh
+++ b/libgloss/config/default.mh
@@ -29,3 +29,6 @@ AR_FLAGS = rc
 #
 .c.s:
 	$(CC) $(CFLAGS_FOR_TARGET) -S $(INCLUDES) $(CFLAGS) $<
+
+# We don't build docs in subdirs, so stub out the rules.
+.PHONY: doc docs dvi html install-html info install-info clean-info pdf install-pdf
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 1fa877729f9b..e4f0b50860b6 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -11,7 +11,7 @@ AC_CONFIG_AUX_DIR(..)
 AC_PROG_INSTALL
 
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE([foreign no-define 1.15])
+AM_INIT_AUTOMAKE([foreign no-dist no-define subdir-objects 1.15.1])
 
 if test -z "${with_multisubdir}" ; then
   AC_CONFIG_FILES([doc/Makefile])
-- 
2.34.1



More information about the Newlib mailing list