Xref: utzoo comp.lang.c:38075 comp.unix.misc:1272 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!gatech!psuvax1!uwm.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!shlump.nac.dec.com!decvax.DEC.COM!evans From: evans@decvax.DEC.COM (Marc Evans) Newsgroups: comp.lang.c,comp.unix.misc Subject: Re: Makefile question Message-ID: <21915@shlump.nac.dec.com> Date: 9 Apr 91 12:01:34 GMT References: <1991Apr9.050652.10199@athena.mit.edu> Sender: news@shlump.nac.dec.com Reply-To: evans@decvax.DEC.COM Followup-To: comp.lang.c Distribution: usa Organization: Synergytics Lines: 31 In article <1991Apr9.050652.10199@athena.mit.edu>, ibekhaus@athena.mit.edu (Ira B. Ekhaus) writes: |> hello, |> I currently have my directory mounted to two machines with different |> cpu's, ie DEC and Sun. |> What is the easiest way to set up my makefiles, to use the current CPU to |> decide whether an object file should be updated. It would be great if |> libraries could be set up for both types of cpu's, and only updated if the |> source code was newer, but a separate object file would be susceptible to |> updating whenever a make command on a different CPU type than the object file. I would consider using something like: LIB = libfoo.a invoke : exec $(MAKE) $(MAKEFLAGS) ARCH=${ARCH-`machine`} $(LIB) $(LIB) : $(ARCH)/$(LIB) $(ARCH)/$(LIB)(foo1.o) :: foo1.c $(ARCH)/$(LIB)(foo2.o) :: foo2.c $(ARCH)/$(LIB)(foo3.o) :: foo3.c By doing this you eliminate the .o files all together, and instead just reference the contents of each archive. The default rules should *do the right thing*, but for efficiency you may want to change the .c.o and .c.a rules. - Marc -- =========================================================================== Marc Evans - WB1GRH - evans@decvax.DEC.COM | Synergytics (603)635-8876 Unix and X Software Consultant | 21 Hinds Ln, Pelham, NH 03076 ===========================================================================