home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!caen!uvaarpa!murdoch!uvacs.cs.Virginia.EDU!rg3h
- From: rg3h@uvacs.cs.Virginia.EDU (Rich Gossweiler)
- Subject: ? for make gurus
- Message-ID: <1993Jan26.192554.15037@murdoch.acc.Virginia.EDU>
- Sender: usenet@murdoch.acc.Virginia.EDU
- Reply-To: rg3h@Virginia.EDU
- Organization: University of Virginia Computer Science Department
- Date: Tue, 26 Jan 1993 19:25:54 GMT
- Lines: 52
-
- I'd like to put all my .o files in a separate subdirectory. On the
- suns, I use a macro as shown below:
-
-
- #
- # all the object files to be created
- #
- VR_OBJS = dynarray.o sock.o vr_comm.o \
- timing.o vr_init.o vr_draw.o \
- vr_file.o vr_tree.o vr_tracker.o \
- vr_light.o vr_glove.o vr_util.o \
- vr_timing.o
-
- #
- # Rule substitution -- prepend the .o files with subdirectory "sunobj/"
- #
- VR_OBJECTS = $(VR_OBJS:%=sunobj/%)
-
-
- sunobj/%.o: $(INC) %.c
- @echo '>>>>> Making $@ <<<<<'
- $(CC) -c -o $@ $<
- @echo " "
-
-
- $(VR_LIBRARY): $(VR_OBJECTS)
- @echo "***** Creating library $@ *****"
- /bin/rm -f $@
- ar qv $@ $?
- ranlib $@
- @echo " "
-
- The $(VR_OBJECTS) macro substitutes "sunobj/" in front of each .o file
- (specified in the $(VR_OBJS) variabele). I use this as the dependency
- in making the VR library, and tell the compiler to put the .o files in
- that directory.
-
- Unfortunately, it appears as though I can't do this with the sgi make
- macros. All I want to do is put the .o files in another directory, and
- make the .c files be dependent on them, over in that subdirectory.
- Anyone have any suggestions on how I might achieve this perplexing
- goal?
-
- Thanks,
- Rich
-
-
- --
- Rich Gossweiler (rg3h@cs.Virginia.EDU) | Education is mostly cleaning
- CS Department, Olsson Hall | erasers and waiting for lunch.
- The University of Virginia | -- Joe Bazooka
- Charlottesville, Virginia 22903 |
-