[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Implicit rules
From: |
Svein E. Seldal |
Subject: |
Implicit rules |
Date: |
Sat, 04 Jan 2003 18:04:17 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016 |
Hi,
Lets say I have a make like this:
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
then this works:
make file.o
make test/file.o
Now I would like to do the following:
%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
And I would still like to write 'make file.o' and 'make test/file.o'.
But the latter wont work as long as there's a '/' in the implicit rule.
If I try it I get a "make: *** No rule to make target `test/file.o'.
Stop.". (This seems correct according to the docs, but I still need to
circumvent this!)
Anyone got any ideas to make this work?
Thanks,
Svein
- Implicit rules,
Svein E. Seldal <=