Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!erikb From: erikb@cs.vu.nl (Erik Baalbergen) Newsgroups: comp.unix.questions Subject: Re: Make: Compiling source code from a different directory. Message-ID: <4652@cogito.cs.vu.nl> Date: 29 Nov 89 07:50:24 GMT References: <404@massey.ac.nz> Reply-To: erikb@cs.vu.nl (Erik Baalbergen) Organization: VU Informatica, Amsterdam Lines: 33 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, ->I set up the makefile on our Sun 386i to access the source kept on ->our Pyramid. This wasn't too difficult. I have an obj directory that ->contains the makefile, and on the same level, a src directory that is ->a symbolic link to the other machine. So the makefile defines SRCDIR ->as ../src and uses the following rule to find everything: -> ->%.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. -> ->-- ->Ken Spagnolo - Systems Programmer, Postmaster, Usenet Administrator, etc. -> Computer Centre, Massey University, Palmerston North, New Zealand ->K.Spagnolo@massey.ac.nz Phone: +64-63-69099 x8587 New Zealand = GMT+12 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 dependencies; a dull job, but resulting in a standard, "portable" makefile :-) Erik Baalbargen -- Erik H. Baalbergen Vrije Universiteit / Dept. of Maths. & Comp. Sc. De Boelelaan 1081 1081 HV Amsterdam / The Netherlands tel. +31 20 548 8080