]> git.draconx.ca Git - cdecl99.git/commitdiff
Work around some ULTRIX make bugs.
authorNick Bowler <nbowler@draconx.ca>
Wed, 6 Dec 2023 04:05:17 +0000 (23:05 -0500)
committerNick Bowler <nbowler@draconx.ca>
Wed, 6 Dec 2023 04:10:24 +0000 (23:10 -0500)
ULTRIX 4.5 make fails during rule lookup when it tries to build a
target in a nonexistent directory that might have inference rules
associated with it (i.e., ends with a defined suffix), for example:

  % echo 'nonexistent/baz.o: ;' | make -f -
  Directory nonexistent/: Make: Cannot open.  Stop.

We can work around this problem by using a prerequisite to create the
output directory instead of trying to create it directly in the rule.
Automake actually does this already for its own rules, so let's try
to hook the same mechanism.

Pull in similar fixes from dxcommon.

Makefile.am
common

index 87cf0bd7950f5855e680d80fa09f8aed5b8968de..6888d83155b2fde04343cb42f62d0de5ff84dee2 100644 (file)
@@ -9,6 +9,7 @@ ACLOCAL_AMFLAGS = -I m4 -I common/m4
 # For Gnulib
 MOSTLYCLEANFILES =
 EXTRA_LTLIBRARIES =
+EXTRA_PROGRAMS =
 
 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
        -I$(top_builddir)/lib -I$(top_srcdir)/lib \
@@ -37,13 +38,17 @@ noinst_DATA = $(MOFILES)
 
 nodist_include_HEADERS = src/config/cdecl.h
 src/config/cdecl.h: config.h src/cdecl.h $(DX_BASEDIR)/scripts/bake-config.awk
-       $(AM_V_GEN) $(MKDIR_P) $(@D)
        $(AM_V_at) $(AWK) -f $(DX_BASEDIR)/scripts/bake-config.awk \
          config.h $(srcdir)/src/cdecl.h >$@-t
        $(AM_V_at) mv -f $@-t $@
 EXTRA_DIST += $(DX_BASEDIR)/scripts/bake-config.awk
 CLEANFILES += src/config/cdecl.h
 
+# Hack to get Automake to emit a dirstamp rule, and use it in src/config/cdecl.h.
+src/config/cdecl.h: src/config/$(am__dirstamp)
+EXTRA_PROGRAMS += src/config/gl-dirstamp
+src_config_gl_dirstamp_SOURCES =
+
 shared_gl_objects = $(gnulib_symfiles:.glsym=.lo)
 static_gl_objects = $(gnulib_extra_objects:.lo=.@OBJEXT@)
 
@@ -141,9 +146,9 @@ XGETTEXT_OPTS = -D $(builddir) -D $(srcdir) --from-code=utf-8 \
        --keyword=_ --keyword=N_ --keyword=PN_:1c,2
 
 po/$(PACKAGE).pot: $(SOURCES)
-       $(AM_V_at)  $(MKDIR_P) $(@D)
-       $(AM_V_GEN) $(XGETTEXT) $(XGETTEXT_OPTS) -o $@.tmp $(SOURCES)
-       $(AM_V_at)  mv -f $@.tmp $@
+       $(AM_V_GEN) $(MKDIR_P) po
+       $(AM_V_at) $(XGETTEXT) $(XGETTEXT_OPTS) -o $@.tmp $(SOURCES)
+       $(AM_V_at) mv -f $@.tmp $@
 
 # These are required to prevent the builtin lex/yacc rules from
 # superseding ours...
@@ -345,7 +350,7 @@ CLEANFILES += atlocal
 # refer to the just-installed .la file, rather than more typical library flags
 # (-Lfoo -lfoo).  Otherwise libtool can pick up libcdecl.la from the current
 # working directory which defeats the point of an install check.
-EXTRA_PROGRAMS = t/installcheck
+EXTRA_PROGRAMS += t/installcheck
 t_installcheck_CPPFLAGS = -I$(DESTDIR)$(includedir)
 t_installcheck_LDADD = $(DESTDIR)$(libdir)/libcdecl.la
 t_installcheck_CFLAGS =
diff --git a/common b/common
index cc589a8b1539e9515985081d9498dda2b6b6caf7..8c45dd9fec485578a09dbf541d4209dcf77acd5f 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit cc589a8b1539e9515985081d9498dda2b6b6caf7
+Subproject commit 8c45dd9fec485578a09dbf541d4209dcf77acd5f