[PATCH] newlib: switch to multilib.am

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
We use the common config-ml.in for configure, so switch the makefile
over to the common multilib.am.  It's almost exactly the same code,
but there are two differences:
* Common code hooks install-exec-local for install-multi, but newlib
  doesn't currently install any executables, so that doesn't fire.
  Newlib already has install-data-local that inlined install-multi,
  so switch that to the common install-multi.
* Common code doesn't provide a check-multi at all.  Keep ours for
  now.  Some day common code might get it.  Or not.  Who knows.
---
 newlib/Makefile.am | 36 +++---------------
 newlib/Makefile.in | 91 ++++++++++++++++++++++++----------------------
 2 files changed, 53 insertions(+), 74 deletions(-)

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 6a28215d3620..6edc9abc2086 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -7,14 +7,6 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 PHONY =
 noinst_DATA =
 
-# Multilib support variables.
-MULTISRCTOP =
-MULTIBUILDTOP =
-MULTIDIRS =
-MULTISUBDIR =
-MULTIDO = true
-MULTICLEAN = true
-
 LIBTOOL_VERSION_INFO = 0:0:0
 
 # The newlib hardware floating-point routines have been disabled due to
@@ -312,13 +304,15 @@ stmp-targ-include: config.status
 
 CLEANFILES = stmp-targ-include
 
-install-data-local:	install-toollibLIBRARIES
+## We hook install-multi because this Makefile doesn't have any exec targets,
+## only data targets.  If that ever changes, this should be removed and the
+## install-exec-local in ../multilib.am will kick in.
+install-data-local: install-toollibLIBRARIES install-multi
 if USE_LIBTOOL
 else
 	rm -f $(DESTDIR)$(toollibdir)/libg.a
 	ln $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a >/dev/null 2>/dev/null || cp $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a
 endif
-	$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
 	-if [ -z "$(MULTISUBDIR)" ]; then \
 	  $(mkinstalldirs) $(DESTDIR)$(tooldir)/include; \
 	  for i in $(srcdir)/libc/include/*.h; do \
@@ -442,30 +436,10 @@ install-man:
 
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
 
-# Multilib support.
-PHONY += all-multi check-multi mostlyclean-multi clean-multi distclean-multi \
-	maintainer-clean-multi
-
-all-recursive: all-multi
-check-recursive: check-multi
-mostlyclean-recursive: mostlyclean-multi
-clean-recursive: clean-multi
-distclean-recursive: distclean-multi
-maintainer-clean-recursive: maintainer-clean-multi
+include ../multilib.am
 
-# The $(MAKE) comments below are to enable parallel building.
-all-multi:
-	$(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
 check-multi:
 	$(MULTIDO) $(AM_MAKEFLAGS) DO=check multi-do # $(MAKE)
-mostlyclean-multi:
-	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
-clean-multi:
-	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
-distclean-multi:
-	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
-maintainer-clean-multi:
-	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
 
 MAKEOVERRIDES=
 
diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index a365218a53d2..2ea83d858950 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -416,20 +416,9 @@ AUTOMAKE_OPTIONS = dejagnu
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
 # Variables that will accumulate in subdirs.
-
-# Multilib support.
-PHONY = all-multi check-multi mostlyclean-multi clean-multi \
-	distclean-multi maintainer-clean-multi $(am__append_4)
+PHONY = $(am__append_4)
 noinst_DATA = stmp-targ-include $(am__append_1) $(am__append_2) \
 	$(am__append_3)
-
-# Multilib support variables.
-MULTISRCTOP = 
-MULTIBUILDTOP = 
-MULTIDIRS = 
-MULTISUBDIR = 
-MULTIDO = true
-MULTICLEAN = true
 LIBTOOL_VERSION_INFO = 0:0:0
 @NEWLIB_HW_FP_FALSE@MATHDIR = math
 
@@ -545,6 +534,12 @@ libc_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO) -release newlib -no-unde
 @USE_LIBTOOL_TRUE@libc_la_DEPENDENCIES = libc-libtool-objectlist
 CLEANFILES = stmp-targ-include
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
+MULTISRCTOP = 
+MULTIBUILDTOP = 
+MULTIDIRS = 
+MULTISUBDIR = 
+MULTIDO = true
+MULTICLEAN = true
 MAKEOVERRIDES = 
 
 # dejagnu support
@@ -557,7 +552,7 @@ all: newlib.h _newlib_version.h
 .SUFFIXES: .c .lo .o .obj
 am--refresh: Makefile
 	@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/doc/local.mk $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../multilib.am $(srcdir)/doc/local.mk $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
@@ -579,7 +574,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
 	esac;
-$(srcdir)/doc/local.mk $(am__empty):
+$(srcdir)/../multilib.am $(srcdir)/doc/local.mk $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
@@ -855,7 +850,7 @@ check-am: all-am
 	$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
 check: check-recursive
 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h \
-		_newlib_version.h
+		_newlib_version.h all-local
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
@@ -902,7 +897,7 @@ distclean: distclean-recursive
 	-rm -f Makefile
 distclean-am: clean-am distclean-DEJAGNU distclean-compile \
 	distclean-generic distclean-hdr distclean-libtool \
-	distclean-tags
+	distclean-local distclean-tags
 
 dvi: dvi-recursive
 
@@ -923,7 +918,7 @@ install-dvi: install-dvi-recursive
 
 install-dvi-am:
 
-install-exec-am:
+install-exec-am: install-exec-local
 
 install-html: install-html-recursive
 
@@ -947,12 +942,13 @@ maintainer-clean: maintainer-clean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
 	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
+maintainer-clean-am: distclean-am maintainer-clean-generic \
+	maintainer-clean-local
 
 mostlyclean: mostlyclean-recursive
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
+	mostlyclean-libtool mostlyclean-local
 
 pdf: pdf-recursive
 
@@ -967,24 +963,25 @@ uninstall-am: uninstall-toollibDATA uninstall-toollibLIBRARIES \
 
 .MAKE: $(am__recursive_targets) all check-am install-am install-strip
 
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
 	am--refresh check check-DEJAGNU check-am clean clean-cscope \
 	clean-generic clean-libtool clean-local clean-toollibLIBRARIES \
 	clean-toollibLTLIBRARIES cscope cscopelist-am ctags ctags-am \
 	distclean distclean-DEJAGNU distclean-compile \
 	distclean-generic distclean-hdr distclean-libtool \
-	distclean-tags dvi dvi-am html html-am info info-am install \
-	install-am install-data install-data-am install-data-local \
-	install-dvi install-dvi-am install-exec install-exec-am \
-	install-html install-html-am install-info install-info-am \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip install-toollibDATA \
-	install-toollibLIBRARIES install-toollibLTLIBRARIES \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
+	distclean-local distclean-tags dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-data-local install-dvi install-dvi-am install-exec \
+	install-exec-am install-exec-local install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-toollibDATA install-toollibLIBRARIES \
+	install-toollibLTLIBRARIES installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-local mostlyclean \
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
-	uninstall-toollibDATA uninstall-toollibLIBRARIES \
+	mostlyclean-local pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-toollibDATA uninstall-toollibLIBRARIES \
 	uninstall-toollibLTLIBRARIES
 
 .PRECIOUS: Makefile
@@ -1145,10 +1142,9 @@ stmp-targ-include: config.status
 	$(MAKE) targ-include/newlib.h
 	touch $@
 
-install-data-local:	install-toollibLIBRARIES
+install-data-local: install-toollibLIBRARIES install-multi
 @USE_LIBTOOL_FALSE@	rm -f $(DESTDIR)$(toollibdir)/libg.a
 @USE_LIBTOOL_FALSE@	ln $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a >/dev/null 2>/dev/null || cp $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a
-	$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
 	-if [ -z "$(MULTISUBDIR)" ]; then \
 	  $(mkinstalldirs) $(DESTDIR)$(tooldir)/include; \
 	  for i in $(srcdir)/libc/include/*.h; do \
@@ -1270,18 +1266,13 @@ install-man:
 	  fi; \
 	done
 
-all-recursive: all-multi
-check-recursive: check-multi
-mostlyclean-recursive: mostlyclean-multi
-clean-recursive: clean-multi
-distclean-recursive: distclean-multi
-maintainer-clean-recursive: maintainer-clean-multi
-
-# The $(MAKE) comments below are to enable parallel building.
+# GNU Make needs to see an explicit $(MAKE) variable in the command it
+# runs to enable its job server during parallel builds.  Hence the
+# comments below.
 all-multi:
 	$(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
-check-multi:
-	$(MULTIDO) $(AM_MAKEFLAGS) DO=check multi-do # $(MAKE)
+install-multi:
+	$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
 mostlyclean-multi:
 	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
 clean-multi:
@@ -1291,6 +1282,20 @@ distclean-multi:
 maintainer-clean-multi:
 	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
 
+.MAKE .PHONY: all-multi clean-multi distclean-multi install-am \
+	      install-multi maintainer-clean-multi mostlyclean-multi
+
+install-exec-local: install-multi
+
+all-local: all-multi
+mostlyclean-local: mostlyclean-multi
+clean-local: clean-multi
+distclean-local: distclean-multi
+maintainer-clean-local: maintainer-clean-multi
+
+check-multi:
+	$(MULTIDO) $(AM_MAKEFLAGS) DO=check multi-do # $(MAKE)
+
 site.exp: Makefile
 	@echo 'Making a new site.exp file...'
 	@test ! -f site.bak || rm -f site.bak
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.