makefile - How do I tell GNU make to remove intermediate files right away? -
i'm using make automate creation of file depends on several other files, each of depends on intermediate file being created, , on file on hard drive.
/ \ a1 a2 | | b1 b2 | | file1 file2
all
depends on a1
, a2
, depend on intermediate files b1
, b2
, in turn made file1
, file2
on hard drive. here's makefile.
all: $(patsubst %, a%, 1 2) echo "making all" a%: b% echo "making $@ $^" b%: file% echo "making $@ $^"
when make -n
, see following output (after touching file1
, file2
).
echo "making b1 file1" echo "making a1 b1" echo "making b2 file2" echo "making a2 b2" echo "making all" rm b1 b2
my problem b1
, b2
extremely large, , can't keep them both on hard drive @ same time (in real situation, it's not 2 dozens of these files). there way tell make dispose of b1
a1
finished, before starting make a2
? in other words, see following output.
echo "making b1 file1" echo "making a1 b1" rm b1 echo "making b2 file2" echo "making a2 b2" rm b2 echo "making all"
Comments
Post a Comment