Xref: utzoo comp.unix.questions:32166 comp.databases:10584 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions,comp.databases Subject: Re: Preprocessor dependencies in MAKE Keywords: make preprocessor dependency sql ingres c Message-ID: <1991Jun15.155856.553@virtech.uucp> Date: 15 Jun 91 15:58:56 GMT References: <2331@prodigal.dwrsun2.UUCP> Organization: Virtual Technologies Inc. Lines: 35 perl@dwrsun2.UUCP (Robert Perlberg) writes: >which is made up of many `.sc' files, I would like to create a Make >rule that will understand this general dependency so I don't have to >create an explicit dependency for each file. I have tried the >following: > .SUFFIXES: .sc > runme: runme.o > $(CC) $(CFLAGS) -o $@ runme.o -lingres -lm > .sc.o: > esqlc $*.sc > $(CC) $(CFLAGS) -c $*.c >it works the first time, but then if I modify runme.sc and run make it >says "`runme' is up to date". The problem is that the .c.o rule is taking precedence. So what you need to do is the following: .SUFFIXES: .SUFFIXES: .o .sc .c .c~ ..... The first line clears the suffixes list. The second line will cause your .sc.o rule to be applied (assuming it fits) before the .c.o rule would be applied. Note that you sould ensure that you don't leave off any of the predefined suffixes on the second line or else they won't be usable. You can see what the default list of suffixes is by entering: make -fp - 2>/dev/null < /dev/null | grep SUFFIX Have fun. -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc. uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170