Hi,
[Please retain the CC to [EMAIL PROTECTED] so
that the Debian Bug Tracking system can record your input]
This has been reported by a debian user. I am not sure if
this is a defect in make, but I can't find a rationale for the
difference in behaviour. If this is not a bug, a clarification about
what is happening would be appreciated.
manoj
When I create a Makefile with pattern rules for compiling to a directory
different from where the source lies, together with rules for creating
these directories, I get very strange results:
### Example Makefile
all: obj/.stamp obj/test
obj/test: obj/test.o
obj/.stamp:
mkdir -p obj
touch obj/.stamp
obj/%: obj/%.o
$(CC) $(LDFLAGS) -o $@ $^
obj/%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
### End of Example
Now, when the "obj" directory already exists, everything runs fine.
If it doesn't exist, it gets created and the program also compiled
correctly, but obj/test.o is deleted afterwards, because make considers
it an intermediate file. It seems that the cause is the "obj/test: obj/test.o"
rule being ignored if "obj" itself doesn't exist.
--
... r-q1
Manoj Srivastava <[EMAIL PROTECTED]> <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C
_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make