From 939beb11a5ccf58d7fe79a809a1b592c5c9143c0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Nov 2021 13:20:30 +0200 Subject: Add support for dynamic dependencies in ad hoc Buildscript recipes Specifically, add the new `depdb dyndep` builtin that can be used to extract dynamic dependencies from a program run or a file. For example: obje{hello.o}: cxx{hello} {{ s = $path($<[0]) depdb dyndep $cxx.poptions $cc.poptions --what=header --default-prereq-type=h -- $cxx.path $cxx.poptions $cc.poptions $cxx.mode -M -MG $s diag c++ ($<[0]) o = $path($>) $cxx.path $cxx.poptions $cc.poptions $cc.coptions $cxx.coptions $cxx.mode -o $o -c $s }} Currently only the `make` dependency format is supported. --- libbuild2/make-parser.test.testscript | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 libbuild2/make-parser.test.testscript (limited to 'libbuild2/make-parser.test.testscript') diff --git a/libbuild2/make-parser.test.testscript b/libbuild2/make-parser.test.testscript new file mode 100644 index 0000000..6db00eb --- /dev/null +++ b/libbuild2/make-parser.test.testscript @@ -0,0 +1,98 @@ +# file : libbuild2/make-parser.test.testscript +# license : MIT; see accompanying LICENSE file + +: valid +: +$* <>EOO + foo: + + foo: bar + + foo: bar baz + + foo: bar \ + baz + + foo: bar\ + baz + + foo:\ + bar baz\ + fox + + foo: bar \ + \ + baz + + foo: bar\ + + foo bar: baz + + foo \ + bar: baz + + foo \ + bar \ + : baz + + \ + foo: bar + EOI + T foo + + T foo + P bar + + T foo + P bar + P baz + + T foo + P bar + P baz + + T foo + P bar + P baz + + T foo + P + P bar + P baz + P fox + + T foo + P bar + P + P baz + + T foo + P bar + P + + T foo + T bar + P baz + + T foo + T bar + P baz + + T foo + T bar + T + P baz + + T + T foo + P bar + EOO + +: lax +: +$* <>EOO + foo: c:\tmp\bar + EOI + T foo + P c:\tmp\bar + EOO -- cgit v1.1