Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!voder!pyramid!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!romp!auschs!awdprime!doorstop.austin.ibm.com!tif From: tif@doorstop.austin.ibm.com (Paul Chamberlain) Newsgroups: comp.unix.programmer Subject: make with multiple executables from same source files Message-ID: <4196@awdprime.UUCP> Date: 12 Nov 90 15:42:17 GMT Sender: news@awdprime.UUCP Reply-To: tif@doorstop (Paul Chamberlain) Distribution: usa Organization: IBM AWD, Austin, TX Lines: 28 Summary: Expires: Sender: Followup-To: Keywords: I'm not sure what happened the first time, I'll try again... I have two executables that depend on the same source files but are compiled with different CFLAGS. Anybody have a good way to make a makefile understand this? Let's say I have source1.c, source2.c, and source3.c. I want to be able to say "make exe1", "make exe2", or "make all". But I want it to do the right thing if I say "make all; make all". i.e. cc -DDEF1 -c source1.c cc -DDEF1 -c source2.c cc -DDEF1 -c source3.c cc -o exe1 source1.o source2.o source3.o cc -DDEF2 -c source1.c cc -DDEF2 -c source2.c cc -DDEF2 -c source3.c cc -o exe2 source1.o source2.o source3.o and then `all' is up to date. I don't mind having extra "touch", "test", or "rm" commands. I don't even mind having more than one makefile. Paul Chamberlain | I do NOT represent IBM. tif@doorstop, sc30661 at ausvm6 512/838-7008 | ...!cs.utexas.edu!ibmchs!auschs!doorstop.austin.ibm.com!tif