bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Intermediate file woes


From: tom_honermann
Subject: Intermediate file woes
Date: Thu, 10 May 2001 11:29:08 -0700

Running GNU Make 3.79.1 on a RedHat Linux 6.2 system

I've got two issues:

1) Explicit intermediate files (Those listed as pre-reqs of .INTERMEDIATE)
will get deleted even if make did not create them.  This is not-consistant
with how make deals with non-explicit intermediate files.  Here's an
example:

   .SUFFIXES:
   #.INTERMEDIATE: test.x

   all: test

   %.x: %.cpp
           cp $< $@

   %.i: %.x
           cp $< $@

   %.o: %.i
           cp $< $@

   clean::
           rm -f test *.o *.i *.x

   test: test.o
           cp $< $@

Running this as is looks like this:
   st-lnx01:$ make clean
   rm -f test *.o *.i *.x *.d
   st-lnx01:$ make
   cp test.cpp test.x
   cp test.x test.i
   cp test.i test.o
   cp test.o test
   rm test.x test.i
   st-lnx01:$ make test.x
   cp test.cpp test.x
   st-lnx01:$ make
   cp test.x test.i
   cp test.i test.o
   cp test.o test
   rm test.i                                     <--- test.x not deleted

Uncommenting ".INTERMEDIATE: test.x" after .SUFFIXES results in this:
   st-lnx01:$ make clean
   rm -f test *.o *.i *.x *.d
   st-lnx01:$ make
   cp test.cpp test.x
   cp test.x test.i
   cp test.i test.o
   cp test.o test
   rm test.x test.i
   st-lnx01:$ make test.x
   cp test.cpp test.x
   st-lnx01:$ make
   cp test.x test.i
   cp test.i test.o
   cp test.o test
   rm test.x test.i                   <--- test.x deleted

Note the last line in each run - test.x is not deleted in the first run,
but it is in the second.

2) The .INTERMEDIATE target doesn't accept patterns for dependencies.  For
example, you can't do this.
   .INTERMEDIATE: %.x

Are these both design restrictions?  Or should I start coding :)

Tom.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]