[Libosinfo] [osinfo-db-tools PATCH v2 14/16] Move files needed for `make syntax-check` to build-aux

Fabiano Fidêncio fidencio at redhat.com
Tue Jul 9 10:47:42 UTC 2019


Together with the changes, let's adapt GNUmakefile and maint.mk in order
to be able to run those files from build-aux.

GNUmakefile:
- changing both srcdir & top_srcdir, and adjusting the includes of
  cfg.mk and maint.mk were enough to be able to run `make syntax-check`
  from build-aux directory;

maint.mk:
- "ME" variable had to be changed to point to the right place;
- Some paths expecting cfg.mk in the top_srcdir had to be changed;
- tight-scope.mk target dependency has been changed from $(ME) to
  maint.mk;

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 GNUmakefile => build-aux/GNUmakefile | 8 ++++----
 cfg.mk => build-aux/cfg.mk           | 0
 maint.mk => build-aux/maint.mk       | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
 rename GNUmakefile => build-aux/GNUmakefile (97%)
 rename cfg.mk => build-aux/cfg.mk (100%)
 rename maint.mk => build-aux/maint.mk (99%)

diff --git a/GNUmakefile b/build-aux/GNUmakefile
similarity index 97%
rename from GNUmakefile
rename to build-aux/GNUmakefile
index a62b880..6811db1 100644
--- a/GNUmakefile
+++ b/build-aux/GNUmakefile
@@ -30,8 +30,8 @@ else
 SHELL = sh
 endif
 
-srcdir = .
-top_srcdir = .
+srcdir = ..
+top_srcdir = ..
 
 # Make tar archive easier to reproduce.
 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
@@ -40,13 +40,13 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
 ALL_RECURSIVE_TARGETS =
 
 # Some projects override e.g., _autoreconf here.
--include $(srcdir)/cfg.mk
 
 # Allow cfg.mk to override these.
 _build-aux ?= build-aux
 _autoreconf ?= autoreconf -v
 
-include $(srcdir)/maint.mk
+-include $(srcdir)/$(_build-aux)/cfg.mk
+include $(srcdir)/$(_build-aux)/maint.mk
 
 # Ensure that $(VERSION) is up to date for dist-related targets, but not
 # for others: rerunning autoreconf and recompiling everything isn't cheap.
diff --git a/cfg.mk b/build-aux/cfg.mk
similarity index 100%
rename from cfg.mk
rename to build-aux/cfg.mk
diff --git a/maint.mk b/build-aux/maint.mk
similarity index 99%
rename from maint.mk
rename to build-aux/maint.mk
index b8c207d..fe8bcf4 100644
--- a/maint.mk
+++ b/build-aux/maint.mk
@@ -19,7 +19,7 @@
 
 # This is reported not to work with make-3.79.1
 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-ME := maint.mk
+ME := $(_build-aux)/maint.mk
 
 # These variables ought to be defined through the configure.ac section
 # of the module description. But some packages import this file directly,
@@ -1660,7 +1660,7 @@ _gl_TS_dir ?= src
 ALL_RECURSIVE_TARGETS += sc_tight_scope
 sc_tight_scope: tight-scope.mk
 	@fail=0;							\
-	if ! $(GREP) '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk	\
+	if ! $(GREP) '^ *export _gl_TS_headers *=' $(srcdir)/$(_build-aux)/cfg.mk	\
 		> /dev/null						\
 	   && ! $(GREP) -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
 		> /dev/null 2>&1; then					\
@@ -1668,7 +1668,7 @@ sc_tight_scope: tight-scope.mk
 	else								\
 	    $(MAKE) -s -C $(_gl_TS_dir)					\
 		-f Makefile						\
-		-f $(abs_top_srcdir)/cfg.mk				\
+		-f $(abs_top_srcdir)/$(_build-aux)/cfg.mk				\
 		-f $(abs_top_builddir)/$<				\
 	      _gl_tight_scope						\
 		|| fail=1;						\
@@ -1676,7 +1676,7 @@ sc_tight_scope: tight-scope.mk
 	rm -f $<;							\
 	exit $$fail
 
-tight-scope.mk: $(ME)
+tight-scope.mk: maint.mk
 	@rm -f $@ $@-t
 	@perl -ne '/^# TS-start/.../^# TS-end/ and print' $(srcdir)/$(ME) > $@-t
 	@chmod a=r $@-t && mv $@-t $@
-- 
2.21.0




More information about the Libosinfo mailing list