Makefile Help
Rich
rluchor@optonline.net
Fri Mar 15 07:13:00 GMT 2002
I'm new to gcc and am running Mandrake Linux 8.1 with gcc 2.96-0.62mdk.
I've been experimenting with writing my own makefiles and have run into
a problem. The makefiles work OK as long as all of the source code is
in the same subdirectory, however, if the source is in another
subdirectory, the makefile can't find it. Here's a simple code sample:
-------------------------------------------------
CC = gcc
all: simple
vpath %.h ~/Projects/test/src
simple.o: simple.c
$(CC) -c simple.c
simple: simple.o
$(CC) -o simple simple.o
-------------------------------------------------------
The source code is in the /Projects/test subdirectory but simple.c has a
header file called foo.h that's in the /Projects/test/src subdirectory.
The error message is "No such file or directory called foo.h". Why
isn't it being found? VPATH= ~/Projects/test/src doesn't work either.
What's missing?
TIA
Rich
--
rluchor@optonline.net
More information about the Gcc-help
mailing list