4gl makefile
Posted in 1992
In-Reply-To: <1992Nov30.054856.17704@candle.uucp>; from "Bruce Momjian" at Nov 30, 92 5:48 am -> Would someone please post how to construct a Makefile for 4GL -> multi-part source programs? Here is my best shot. It works, but I can -> not figure out how to discard the builtin Make rules without calling -> 'make' from within the Makefile with the -r option. The Makeflags -> variable doesn't seem to do any good. -> I've made some comments in your example from what we currently use. -> -------------------------------------------------------------------- -> # -> # Makefile -> # -> # -> OBJECTS = wa_matsum.o wa_menu.o zaarl_r.o zaarl_c.o zaarl_l.o zaarl_d.o \\ -> wa_arfun.o z_arl_r1.o -> -> MAKEFLAGS=-r -> XFLAGS = -> CFLAGS = -O -> LIBS = /usr/lib/libelite.a -> -> all: all: wa_menu.4ge -> make -r wa_menu.4ge shoot this line ^^^^ -> -> wa_menu.4ge : $(OBJECTS) -> c4gl -o wa_menu.4ge $(XFLAGS) $(CFLAGS) $(OBJECTS) $(LIBS) c4gl -o $@ $(XFLAGS) $(CFLAGS) $(OBJECTS) $(LIBS) -> -> clean: -> rm -f *.o *.c *.ec wa_menu log core -> -> .SUFFIXES: .o .4gl .SUFFIXES : .4gl .o .c .o ^^^^^ Try this too (I haven't) # My reading of the make rules imply that the .4gl should # come first - and it seems to work for us. I wonder if our # makes are different. -> -> .4gl.o: -> c4gl -c $(XFLAGS) $(CFLAGS) $< .4gl.o : @set -x ;\\ c4gl $(CFLAGS) $< ;\\ rm -f $(*F).c $(*F).ec ^^^^^^^^^^^^^^^^^^^^^^^ this gets rid of the .ec and .c file so you don't run into the problem. according to the make documentation, the .SUFFIXES is read left to right, so supposedly if you have .c .o as the last entry in .SUFFIXES, make would try to compile from a 4gl first. I haven't tried it yet, maybe tomorrow... As you can see we physically rm the .c and .ec files so that the point is moot for us. regards, j. _____________________________________________________________________________ Jack Parker - Contractor | Hewlett Packard, BSMC Boise, Idaho, USA| These don't look like opinions. jparker@hpbs2651.boi.hp.com | Are you sure they're mine? (208) 323-5388 (W) (208) 384-1623 (H) | _____________________________________________________________________________