help-make
[Top][All Lists]
Advanced

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

VPATH problem


From: Bgh Ello
Subject: VPATH problem
Date: Sat, 18 Feb 2012 08:26:24 -0800 (PST)

     Greetings.  I am unable to get the simplest VPATH example working
and could use some help.  I have a hello world program, hello.cpp in the
src directory, and I can't reach it with VPATH.  Here is the makefile

VPATH = src
CC = g++
OPTS = -c -O2 -Wall
OBJS = hello.o

hello : $(OBJS)
      $(CC) -o $@ $(OBJS)

hello.o : hello.cpp
        $(CC) $(OPTS) hello.cpp

and here is the result of the make command (Gnu make 3.81)

g++ -c -O2 -Wall hello.cpp
g++: error: hello.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.
make: *** [hello.o] Error 4

     Any suggestions would be appreciated.  Thanks.



reply via email to

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