Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!samsung!uakari.primate.wisc.edu!xanth!lll-winken!tekbspa!optilink!brad From: brad@optilink.UUCP (Brad Yearwood) Newsgroups: comp.unix.questions Subject: Re: Make: Compiling source code from a different directory. Message-ID: <2686@optilink.UUCP> Date: 30 Nov 89 08:21:45 GMT References: <4652@cogito.cs.vu.nl> Organization: Optilink Corporation, Petaluma, CA Lines: 33 From article <4652@cogito.cs.vu.nl>, by erikb@cs.vu.nl (Erik Baalbergen): # In article <404@massey.ac.nz> K.Spagnolo@massey.ac.nz (Ken Spagnolo) writes: # ->We have several machines that all need to run the same code. Rather # ->than keep the source on each and worry about keeping them up to date, # ->... # ->%.o: $(SRCDIR)/%.c # -> $(CC) $(CFLAGS) -c $< # -> # ->It works fine on the Sun, but when I tried it on our new DECstation 3100, # ->it didn't work. Does anyone know of another way to achieve this? No # ->matter what I try, I get "Don't know how to make target". Thanx a lot. # -> # This meta-rule construct is not present in all makes, especially # older makes. You may consider meta rules as a non-standard make feature. # Try to use VPATH (also non-standard), if present in the make on # your DECstation (see man page). Otherwise you could write explicit # ... GNU Make has VPATH, meta-rules, nice extensions to meta-rules, nice file and pathname manipulation functions, and complete source code in case you need something not already provided. GNU Make, with a couple of local hacks to provide selective VPATH expansion functions, is an essential item in our project toolbox here. I also find the documentation for GNU Make to be much more readable and complete than other Make documentation. If your project moves to a different machine or site, having source code for Make relieves you from reliance upon non-standard features which might be available on one system but not on another. McGrath and Stallman have a real winner in GNU Make. Brad Yearwood Optilink Corp. {pyramid, tekbspa, pixar}!optilink!brad Petaluma, California