bug-make
[Top][All Lists]
Advanced

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

Re: Feature request / patch: dependency-only prerequisites


From: Christof Warlich
Subject: Re: Feature request / patch: dependency-only prerequisites
Date: Thu, 1 Aug 2019 12:15:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Am 13.07.19 um 14:46 schrieb Paul Smith:

On Wed, 2019-07-10 at 18:15 +0200, Christof Warlich wrote:
Am 10.07.19 um 14:44 schrieb Paul Smith:
Let me know how you want to proceed.
As I want to tackle the most challenging part first, I'd like to suggest to
do the copyright assignment after the technical side is in a decent shape.
But as I said, no problem to do it fist if that's more appropriate.
That's no problem.  However you prefer is fine with me.

Copyright assignment these days is pretty straightforward and can be
done via email instead of sending paper documents around like in the
old days, so it's not as long a process.

One item to note: if you work for a company which has rights to your
work, then they would need to sign off on this as well.

Cheers!

Hi Paul, all,

attached is a first "proof of concept" patch that uses the specific variable
PREREQUISTES to add prerequisites that do not affect automatic
variables. It's not complete (see the points below), but should be good
enough to ask for initial feedback on whether the general approach makes
sense.

Here are the points that I'm aware of that are missing:

  1. Currently, PREREQUISITES is only considered when it is defined
    as a target specific variable in an ordinary rule. The code to handle
    the case when PREREQUISITES is a global variable (or when in is
    defined in a pattern rule?!) is still missing.
  2. Variables and functions are not expanded. Could you give me a
    quick hint on how this should be done? I've found lookup_variable()
    to expand global variables, but this would require to do the parsing
    manually and would not be of much use with functions.
  3. What about the "struct file" pointer and the "struct variable" pointer
    returned by lookup_variable() and lookup_variable_in_set() respectively:
    Do I need to free memory when done with them, and if so, may I just
    use free()?

Thanks for any feedback and your precious time,

Chris

P.S.: There is a small Makefile that could be used for a quick test of the
current (limited) functionality:

target: PREREQUISITES=hi ho
target: foo bar
    @echo "dependency-only prerequisites: ${PREREQUISITES}"
    @echo "ordinary prerequisites: $^"
    rm -rf hi ho foo bar
hi ho foo bar:
    touch $@

Running make with this Makefile yields:

$ make target
touch foo
touch bar
touch hi
touch ho
dependency-only prerequisites: hi ho
ordinary prerequisites: foo bar
rm -rf hi ho foo bar

as desired, i.e. both "hi" and "ho" are recognized as prerequisites but were
not added to $^.

Attachment: prereq.patch
Description: Text Data


reply via email to

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