ibekhaus@athena.mit.edu (Ira B. Ekhaus) (04/09/91)
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. thanks, ira ekhaus ibekhaus@athena.mit.edu
evans@decvax.DEC.COM (Marc Evans) (04/09/91)
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 ===========================================================================
lbr@holos0.uucp (Len Reed) (04/12/91)
In article <21915@shlump.nac.dec.com> evans@decvax.DEC.COM writes: >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. I'd also use dmake or Gnu-make (both free, available at the usual ftp sources) to get some more power in my make. Both have rules to simplify the syntatic messiness of making libraries. More important, both have make-time if-then-else structures that are real useful when you have a makefile that must work on different systems. -- Len Reed Holos Software, Inc. Voice: (404) 496-1358 UUCP: ...!gatech!holos0!lbr