# The glconfig-gen target is intended only for use in recursive make
# invocations.
glconfig-gen: $(gnulib_symfiles)
+ $(AM_V_at) $(MKDIR_P) @GLSRC@
$(AM_V_at) depfiles=; symfiles=; \
for sym in $(gnulib_symfiles); do \
- symdir=`expr "$$sym" : '\(.*/\)'`; \
- symfile=`expr "$$sym" : '.*/\(.*\)' || printf '%s\n' "$$sym"`; \
- symbase=$$symdir.syms/`expr "$$symfile" : '\(.*\)\..*'`; \
- test -f "$$symbase.deps" && \
- depfiles="$$depfiles $$symbase.deps"; \
- symfiles="$$symfiles $$symbase.sym"; \
+ symdir=`expr "$$sym" : '\(.*/\)'`; \
+ symfile=`expr "$$sym" : '.*/\(.*\)' || printf '%s\n' "$$sym"`; \
+ symbase=$$symdir.syms/`expr "$$symfile" : '\(.*\)\..*'`; \
+ test -f "$$symbase.deps" && \
+ depfiles="$$depfiles $$symbase.deps"; \
+ symfiles="$$symfiles $$symbase.sym"; \
done; \
- $(GLCAT) $$depfiles > @GLSRC@/$(DEPDIR)/glconfig.Ph && \
- $(GLCAT) $$symfiles | sed 's/.*/#define & $(GLSYM_PREFIX)&/' \
- > $(GLCONFIG).tmp
+ $(glconfig_nodeps) \
+ || $(GLCAT) $$depfiles > @GLSRC@/$(DEPDIR)/glconfig.Ph || exit; \
+ $(GLCAT) $$symfiles | sed 's/.*/#define & $(GLSYM_PREFIX)&/' \
+ >$(GLCONFIG).tmp
.PHONY: glconfig-gen
-@AMDEP_TRUE@@am__include@ @am__quote@@GLSRC@/$(DEPDIR)/glconfig.Ph@am__quote@@dx_include_marker@
+if AMDEP
+glconfig_nodeps = false
+@am__include@ @am__quote@@GLSRC@/$(DEPDIR)/glconfig.Ph@am__quote@@dx_include_marker@
+else
+glconfig_nodeps = true
+endif
# Automake 1.16 and newer use make rules to generate the dependency stubs.
# we must hook those which is kind of annoying to do. This should be harmless
-dnl Copyright © 2021 Nick Bowler
+dnl Copyright © 2021-2022 Nick Bowler
dnl
dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
dnl This is free software: you are free to do what the fuck you want to.
AT_CHECK([./configure MAKE=dmake && test -f .deps/testsuite.P], [0], [ignore])
AT_CLEANUP
+
+AT_SETUP([glconfig.mk no depfiles])
+
+TEST_CONFIGURE_AC(
+[[AM_INIT_AUTOMAKE([foreign])
+
+AM_SET_DEPDIR
+AM_OUTPUT_DEPENDENCY_COMMANDS
+AM_MAKE_INCLUDE
+AM_DEP_TRACK
+
+DX_AUTOMAKE_COMPAT
+AC_SUBST([GLSRC], [lib])
+
+AC_CONFIG_FILES([Makefile])
+]])
+
+cp "$srcdir/snippet/glconfig.mk" .
+AT_DATA([Makefile.am],
+[[CLEANFILES =
+DISTCLEANFILES =
+gnulib_headers =
+include $(top_srcdir)/glconfig.mk
+]])
+TEST_AUTORECONF
+
+TEST_CONFIGURE([--disable-dependency-tracking])
+AT_CHECK([make -s lib/glconfig.h])
+AT_CHECK([test ! -d lib/.deps && test ! -d lib/_deps && cat lib/glconfig.h])
+
+AT_CLEANUP