Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Current patch: msg#00008

Subject: Current patch
Here I am attaching the current patch (towards the latest released
make 3.81). Updating to make CVS is still pending.

Features implemented:

- Custom out of date by the variable .OUT_OF_DATE

- Persistence by function changed-value

${changed-value target,name,expression} returns true if the last
persistently stored value of "name" is different from the previous
one, and in that case, the new value is stored after a successful
compilation of the given target.

Pending work:
- Agree on a model of persistence.

- Performance: the current implementation would be slow for
dependencies based on checksums if the same file is a prerequisite for
different targets, because the checksum would be evaluated N times.

Issues:

Dependencies on variables values are somewhat tricky, because pattern
rules without a command are ignored by make for variable assignment;
and phony targets cause the targets that depend on them to be compiled
unconditionally (see example bellow).

Simple example that summarizes all the features (be careful to use
tabs for fule commands)
With the make file bellow, target a depends on the content of b, c, d
and on the value of the variable CFLAGS. First intialize b, c and d
with some text content. Run make. If you run make again, make should
not execute the command cat unless you change again the content
(rather than the timestamp) of b, c or d. In addition, if you change
the value of CFLAGS (by executing make CFLAGS=something), a should be
out of date again.

The test suite has also some additional examples.


---------------------------cut here. insert tabs where appropiate
-------------------------------------
content-hash=${shell  md5sum $@ | awk '{print $$1}'}

all: a

%.variable: content-hash=${$*}
%.variable: .OUT_OF_DATE=""
%.variable:
        @echo foo
# this command is used only so that this rule is not ignored.

a:.OUT_OF_DATE=${changed-value $@.$<,${$<::content-hash}}

a: b c d CFLAGS.variable
       cat b c d > a
-------------------------------------------------------------------------------------------------------------

This version of make has been checked with all current test suites,
including some new test for the features added.

Best regards,

Ramon

Attachment: make.diff
Description: Text Data

_______________________________________________
Make-alpha mailing list
Make-alpha@xxxxxxx
http://lists.gnu.org/mailman/listinfo/make-alpha
<Prev in Thread] Current Thread [Next in Thread>