Mail Archives: djgpp/1998/01/17/13:15:39
Ruiter de M writes:
>What I hope to do is to use ONE dependancy in ONE makefile in ONE run
>of `make' to handle this, because the names of the dirs can change and
>I want them in a variable. I have tried all sorts of things but it was
>not possible.
I am no make expert but I think the VPATH directive will be able to do
what you want. For example in the Allegro makefile I write:
VPATH = demo docs examples setup src tests tools src/djgpp
obj/djgpp/%.o: %.c allegro.h
gcc $(CFLAGS) -o $@ -c $<
This makes it possible to compile .c into .o from any of the directories
named in the VPATH, without needing to explicitly state the path to the
file (make will search those directories for it). Of course this isn't
any good if you have different files with the same names in various
directories, but I find it extremely handy since it lets me organise the
code in a sensible directory structure without having to list any paths
in the makefile.
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa
- Raw text -