build/pymake/tests/include-dynamic.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build/pymake/tests/include-dynamic.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +$(shell \
     1.5 +if ! test -f include-dynamic.inc; then \
     1.6 +  echo "TESTVAR = oldval" > include-dynamic.inc; \
     1.7 +  sleep 2; \
     1.8 +  echo "TESTVAR = newval" > include-dynamic.inc.in; \
     1.9 +fi \
    1.10 +)
    1.11 +
    1.12 +# before running the 'all' rule, we should be rebuilding include-dynamic.inc,
    1.13 +# because there is a rule to do so
    1.14 +
    1.15 +all:
    1.16 +	test $(TESTVAR) = newval
    1.17 +	test "$(MAKE_RESTARTS)" = 1
    1.18 +	@echo TEST-PASS
    1.19 +
    1.20 +include-dynamic.inc: include-dynamic.inc.in
    1.21 +	test "$(MAKE_RESTARTS)" = ""
    1.22 +	cp $< $@
    1.23 +
    1.24 +include include-dynamic.inc

mercurial