Path: utzoo!utgpu!news-server.csri.toronto.edu!smoke.cs.toronto.edu!neat.cs.toronto.edu!moraes Newsgroups: comp.windows.x From: moraes@cs.toronto.edu (Mark Moraes) Subject: Re: Question on Imakefile Message-ID: <90Sep6.184104edt.561@smoke.cs.toronto.edu> Organization: Department of Computer Science, University of Toronto References: <1990Sep6.174748.2608@cadence.com> Date: 6 Sep 90 22:42:20 GMT Lines: 30 mikel@cadence.cadence.com writes: >I got a question on Imakefile. In a directory I want to generate >multiple programs. How can I pass different DEFINES or CFLAGS to >each program generating rules? I'm using SingleProgramTarget(). Try one of the Special*ObjectRule() macros -- specify the objects to be compiled with this rule, any special dependencies for those objects, (ones that makedepend will not detect) and the options to give cc -c. eg. NormalProgramTarget(foo,foo.o x.o y.o,$(DEPLIBS),$(LOCAL_LIBRARIES),$(SYS_LIBRARIES)) SpecialObjectRule(foo.o,Makefile,-DFOO) will essentially generate the Makefile: foo: foo.o x.o y.o $(DEPLIBS) cc $(CFLAGS) -o $@ foo.o x.o y.o $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) foo.o: Makefile cc -c $(CFLAGS) -DFOO $*.c [Note. Imake.rules indicates SingleProgramTarget is obsolete since it doesn't understand DEPLIBS] People are strongly advised to read Imake.rules when working with Imakefiles. No, it isn't that complex if you understand cpp and make. The R4 version is well documented, too. [Many thanks to whoever did that] Mark.