GNU bug report logs -
#10930
touching dependency files, take 2
Previous Next
Reported by: Bruce Korb <bkorb <at> gnu.org>
Date: Fri, 2 Mar 2012 17:10:01 UTC
Severity: normal
Tags: notabug
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10930 in the body.
You can then email your comments to 10930 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-automake <at> gnu.org
:
bug#10930
; Package
automake
.
(Fri, 02 Mar 2012 17:10:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Bruce Korb <bkorb <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
bug-automake <at> gnu.org
.
(Fri, 02 Mar 2012 17:10:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This is a autoconf, automake and make question, rebuffed in gnulib.
It's partly autoconf because autoconf stages dummy dependency files
so the make include function won't choke. It is partly make because
I find it a bit tricky getting the dependencies just right. It is,
I think, mostly an automake question since I think that the
machinery behind the AMDEP/DEPDIR configury stuff is automake.
The issue is that I have this tool that takes multiple input files
and produces multiple output files. "make", of course, was conceived
with the idea that each production rule produces one output file.
The workaround is to figure out how to have one target file represent
the production of the many, often done with "stamp" files. e.g.
> target : $(deplist)
> touch $@-temp ; $(do-stuff) ; mv $@-temp $@
>
> $(target_list) : target
This is all well and good when dealing with yacc or lex where the
number of inputs and outputs is fairly well constrained. My tool
is not so well constrained. So I took a page from GCC. I use
"-M" to tell it to produce make file friendly dependency files.
But I took it a step farther, and that's what leads to this
what-is-the-best-approach question. (I'm getting there.)
The make fragment produced contains a list of sources, a list of
targets, a sentinel target and the dependency file itself.
The sentinel and the dependency fragment may be the same file.
Here's an abbreviated example:
> t = output ...
> s = input ...
>
> .deps/output-done : $(s)
> $(t) : .deps/output-done
> @:
the main makefile is responsible for the actual "output-done" rule.
It would be nice to not have to have that basically empty production
rule, but I haven't found a way to avoid it. Without it, you get
"no rule to make output" errors.
Question 1: Is there a way around this empty rule?
When "-MP" is added to the command line, I now produce some phony rules:
> .PHONY : clean-.deps/output-done
>
> clean-.deps/output-done :
> rm -f $(t)
> touch -t 199912312359 .deps/output-done
I'm not happy with that. This is an example where the sentinel file is
the dependency file. Were they different, then it would be:
> t = output ...
> s = input ...
>
> stamp-foo : $(s)
> $(t) : stamp-foo
> @:
>
> .PHONY : clean-stamp-foo
>
> clean-stamp-foo :
> rm -f stamp-foo $(t)
I'm also unhappy with this because I now have this stamp file wart,
but I also don't have the "touch -t 199912312359" wart.
Question 2: Is there a better way?
I'd also like to add a line to that fragment:
> ag_clean_targets += clean-stamp-foo
but it isn't portable. So, pending the decade wait for the "+="
make operator, there must be ways to test for make program capabilities.
Question 3: I'm sure it's obvious and I'm just oblivious, but how do
I tell if the current make supports "+=" at configure time?
Of course, it isn't clear that my clients could use it anyway since
they'd have to construct the list for non-"+=" supporting platforms.
This renders the utility of $(ag_clean_targets) to be rather small.
Any suggestions? Thank you!! Regards, Bruce
Information forwarded
to
bug-automake <at> gnu.org
:
bug#10930
; Package
automake
.
(Fri, 02 Mar 2012 20:25:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 10930 <at> debbugs.gnu.org (full text, mbox):
tags 10930 notabug
close 10930
thanks
Hi Bruce. By writing to bug-automake, you have automatically opened
a new report in the Automake bug tracker; still, in your mail, you only
ask a question, and don't report any actual bug AFAICS. To avoid extra
noise in the tracker, I'm thus closing the report you've (probably
unwittingly) opened; you should still be able to continue the discussion
normally though. In case you think the issue you are facing is truly
due to an automake bug, feel free to re-open the report.
Regards,
Stefano
Added tag(s) notabug.
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Fri, 02 Mar 2012 20:25:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
10930 <at> debbugs.gnu.org and Bruce Korb <bkorb <at> gnu.org>
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Fri, 02 Mar 2012 20:25:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 31 Mar 2012 11:24:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 13 years and 167 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.