From 655121741560d62c1ae82c13a9d2aad18f130603 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Nov 2018 14:00:07 +0200 Subject: Implement support for dependency chains Now instead of: ./: exe{foo} exe{foo}: cxx{*} We can write: ./: exe{foo}: cxx{*} Or even: ./: exe{foo}: libue{foo}: cxx{*} This can be combined with prerequisite-specific variables (which naturally only apply to the last set of prerequisites in the chain): ./: exe{foo}: libue{foo}: bin.whole = false --- tests/dependency/chain/buildfile | 5 ++++ tests/dependency/chain/testscript | 39 +++++++++++++++++++++++++ tests/variable/prerequisite-specific/testscript | 13 ++++++--- 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 tests/dependency/chain/buildfile create mode 100644 tests/dependency/chain/testscript (limited to 'tests') diff --git a/tests/dependency/chain/buildfile b/tests/dependency/chain/buildfile new file mode 100644 index 0000000..a27681e --- /dev/null +++ b/tests/dependency/chain/buildfile @@ -0,0 +1,5 @@ +# file : tests/dependency/chain/buildfile +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +./: testscript $b diff --git a/tests/dependency/chain/testscript b/tests/dependency/chain/testscript new file mode 100644 index 0000000..09ea4a6 --- /dev/null +++ b/tests/dependency/chain/testscript @@ -0,0 +1,39 @@ +# file : tests/dependency/chain/testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include ../../common.testscript + +: basic +: +$* <>/~%EOE% +./: dir{x}: dir{a} +dump dir{x} +EOI +:2:1: dump: +% .+/dir\{x/\}: .+:dir\{a/\}% +EOE + +: long +: +$* <>/~%EOE% +./: dir{x}: dir{y}: dir{a} +dump dir{x} dir{y} +EOI +:2:1: dump: +% .+/dir\{x/\}: .+:dir\{y/\}% + +% .+/dir\{y/\}: .+:dir\{a/\}% +EOE + +: multiple +: +$* <>/~%EOE% +./: dir{x} dir{y}: dir{a} dir{b} +dump dir{x} dir{y} +EOI +:2:1: dump: +% .+/dir\{x/\}: .+:dir\{a/\} .+:dir\{b/\}% + +% .+/dir\{y/\}: .+:dir\{a/\} .+:dir\{b/\}% +EOE diff --git a/tests/variable/prerequisite-specific/testscript b/tests/variable/prerequisite-specific/testscript index 1c7e7bd..ef14cfc 100644 --- a/tests/variable/prerequisite-specific/testscript +++ b/tests/variable/prerequisite-specific/testscript @@ -62,10 +62,15 @@ EOI } EOE -: expect-assignment +: chain : -$* <>EOE != 0 -dir{x}: dir{a}: +$* <>/~%EOE% +dir{x}: dir{y}: dir{a}: foo = FOO +dump dir{y} EOI -:1:16: error: expected name instead of +:2:1: dump: +% .+/dir\{y/\}: .+:dir\{a/\}:% + { + foo = FOO + } EOE -- cgit v1.1