Re: makefile for esqlc source
Posted in 1995
siva@hogpe.ho.att.com (-S.POTHIREDDY) wrote: >Hello, > >I am having problem writing a makefile for an esqlc source program. >The makefile I have written is like this > >prog1: src1.o src2.o src3.o > $(CC) -o $(OBJ) src1.o src2.o src3.o > >src1.o: src1.ec def.h > esql -e src1.ec; $(CC) -c src1.c > >src2.o: src2.ec def.h > esql -e src2.ec; $(CC) -c src2.c > >src3.o: src3.ec def.h > esql -e src3.ec; $(CC) -c src3.c Try this rule in your makefile: SUFFIXES : .ec ec.o : esql -e $(CFLAGS) $< $(CC) $(CFLAGS) -c $*.c @-rm -f $*.c The makefile should then automatically handle esqlc files. The only problem I have with this method is that when a compile error occurs the 'rm' does not remove the intermediate .c. On a subsequent make the esqlc preprocessor is not invoked. This can cause some confusion if you are not aware of the problem. -- -------------------------------------------------------------------------- Philip Walden Hewlett Packard Product Generation Information Systems 1501 Page Mill Road, M/S 4U-6 Palo Alto, CA 94304 (415) 857-3899 FAX (415) 857-8234 --------------------------------------------------------------------------