Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!bloom-beacon!adam.pika.mit.edu!scs From: scs@adam.pika.mit.edu (Steve Summit) Newsgroups: comp.unix.wizards Subject: Re: generating code to run multiple targets/configurations from single Message-ID: <10445@bloom-beacon.MIT.EDU> Date: 9 Apr 89 02:35:48 GMT References: <18927@adm.BRL.MIL> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: scs@adam.pika.mit.edu (Steve Summit) Lines: 26 In article <18927@adm.BRL.MIL> Leisner.Henr@xerox.com (Marty) writes: >I need (for a long time) a better way to produce multiple configurations on >multiple targets from a single set of sources. >...I guess >I'm going to put the different objects/outputs in different subdirectories >(so make won't get confused), but I'll still preprocess the makefiles. One thing I've found which helps is if your C compiler(s) pay attention to the -o flag even in the presence of -c. (4.3bsd may have introduced this.) Then you can you can use a different suffix (not just .o) for each kind of object file, and keep them all in the same directory with one copy of the source. I've used .ovax for vax, .o11 for pdp11, .po for profiled, etc. The Makefile contains new default rules like .SUFFIXES: .po .c.po: $(CC) $(CFLAGS) -p -c -o $@ $*.c Someday I'll post my retargetable C compiler driver which allows the use of -o in this way, and allows easy selection of compiler back-ends to make cross-compilation easy. Steve Summit scs@adam.pika.mit.edu