Ralph Seguin (seguin++at++vr2.engin.umich.edu)
Thu, 20 Jun 1996 10:47:17 -0400
I'm sure that I'm going to receive a sound thrashing for posting
unrelated material to this list :)
Apologies in advance.
Ok. Here's the situation. I have a directory structure as follows:
SomeProject/
src/
RCS/
obj1.c++
obj1.o
obj2.c++
obj2.o
obj3.c++
obj3.o
seguin/
RCS --> ../src/RCS
obj2.c++ (I'm working on it, so it's newer than ../src/obj2.c++)
Ie, work directories parallel to the src dir. Everything is RCSed
in src/RCS. Work dirs should only contain those sources/headers that
are being currently modified.
I have my Makefile set up something like:
# Set up the VPATH so that we don't need much in our work dir.
# Just what we are working on.
VPATH=.:../src
OBJS=obj1.o obj2.o obj3.o
# Implicit productions
.c++.o:
$(CCXX) $(CCXXOPTS) -c $<
.c.o:
$(CC) $(CCOPTS) -c $<
# Build a library.
mylib.a: $(OBJS)
$(AR) $(AROPTS) -cr $++at++ $(OBJS)
# Dependencies
obj1.o: obj1.c++
obj2.o: obj2.c++
obj3.o: obj3.c++
Soooooo... when I do a make, I want the following to happen:
ac -cr mylib.a ../src/obj1.o obj2.o ../src/obj3.o
Ie, I want it to take stuff from ../src if it isn't in my work directory.
I used to use a version of make from UC Berkeley which did the trick fine
with the above VPATH statement.
If I use IRIX 5.3 make, I get:
ac -cr mylib.a obj1.o obj2.o obj3.o
If I use GNU make, I get:
ac -cr ../src/mylib.a obj1.o obj2.o obj3.o
If I use GNU make, and I put the following into the Makefile, in place of
the single VPATH macro assignment:
vpath %.c++ .:../src
vpath %.o .:../src
vpath %.h .:../src
vpath %.a
I get the same results as in the IRIX make. Ie,
ac -cr mylib.a obj1.o obj2.o obj3.o
What am I doing wrong here?
Anybody know of or can give me a URL for the Berkeley make I'm talking about?
I've looked at the make man page a couple of times; I guess I'm just
not reading carefully enough or something...
Thanks.
-Ralph
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:02 PDT