bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31465: Automake 1.16 breaks custom dependency handling


From: Sander Niemeijer
Subject: bug#31465: Automake 1.16 breaks custom dependency handling
Date: Tue, 15 May 2018 18:56:56 +0200

I have a software package that uses SWIG to dynamically generates .c files.
With automake 1.15 and earlier I was able to add my own dependency rules for 
this by adding some custom entries to the Makefile.am.

A small reduced example of the approach I am using:

@AMDEP_TRUE@@am__include@ @address@hidden(DEPDIR)/address@hidden@

foo.c: $(srcdir)/foo.i
@AMDEP_TRUE@    source='$(srcdir)/foo.i' object='foo.c' libtool=no 
@AMDEPBACKSLASH@
@AMDEP_TRUE@    depfile='$(DEPDIR)/foo.Pc' tmpdepfile='$(DEPDIR)/foo.TPc' 
@AMDEPBACKSLASH@
@AMDEP_TRUE@    depmode='none' $(depcomp) @AMDEPBACKSLASH@
@AMDEP_TRUE@    $(SWIG) $(SWIGFLAGS) -M $(srcdir)/foo.i > $(DEPDIR)/foo.Pc
        $(SWIG) $(SWIGFLAGS) -o foo.c $(srcdir)/foo.i


This approach worked fine with previous (15.x and earlier) automake versions, 
but with the latest release (I tested with 1.16.1) this no longer works.

The 'Something went wrong bootstrapping makefile fragments' problem that was 
raised by the configure script was easily solved by adding an '# 
am--include-marker' to the include statement.

But after that, a call to 'make' will complain about '.deps/foo.Pc: No such 
file or directory'.

The problem here is that the dependency file $(DEPDIR)/foo.Pc no longer gets 
generated by configure (or config.status).

I have been able to work around this by overriding am--depfiles to:

am--depfiles: $(am__depfiles_remade) $(local_depfiles)

And then generate the foo.Pc file as part of the $(local_depfiles) target 
(using some additional custom rules).

This seems to work nicely, except that automake still keeps giving me warnings 
about am--depfiles being overridden, which I would like to get rid off.

The question is thus whether it would be possible to add some hook into 
automake to have am--depfiles depend on some additional (optional) target (that 
can then be used by the Makefile.am author to generate custom dependency files).
Something in the spirit of the extension mechanism that is already available 
for e.g. the *-hook and *-local targets.

For instance, allowing an optional am--depfiles-local target that, if it exists 
in the Makefile.am, will be added as dependency to am--depfiles:

am--depfiles: $(am__depfiles_remade) am--depfiles-local

which will then allow me to use:

am--depfiles-local: $(local_depfiles)

Best regards,
Sander Niemeijer






reply via email to

[Prev in Thread] Current Thread [Next in Thread]