Re: 4gl makefile
Posted in 2009
On Wed, Oct 21, 2009 at 08:53, Randall Young (ADE) < Randall.Young@arkansas.gov> wrote: > Would someone please post an example or a pointer to an example of a 4gl > makefile. I am having difficulty in getting the global files via VPATH. I > don’t want to create a monster if there is a better way. Thanks. > > > > IBM INFORMIX-4GL Version 7.32.UC2 > > IBM Informix Dynamic Server Version 9.40.UC6 > I haven't used VPATH, but here's the Informix makefile I use - called informix.mk and usually used with 'include ${HOME}/etc/informix.mk' or a similar relative path name. Make sure you get tabs where blanks are shown. # @(#)$Id: i4gl.mk,v 1.7 2002/08/20 17:28:32 jleffler Exp $ # # @(#):PRODUCT: # # Makefile for Classic INFORMIX Dynamic 4GL Compilation # Knows about: C, ESQL/C, I4GL, I4GL-RDS, RDSLIB and RDSLINK #-------------------------------------------------------------------------- # Note that this file does not define any targets; it only defines # compilation rules and macros. It does not define SCCS rules either. #-------------------------------------------------------------------------- ############################################################################### # Compilers and flags ############################################################################### # Basic Unix Commands: LN = ln LN_S = ln -s CP = cp RM = rm RM_F = rm -f # ESQL/C Compiler # NB: It is often better to use the I4GL C-code compiler to compile # ESQL/C code that will subsequently be linked with I4GL programs. ESQL_EC_CMD = esql ESQL_EC_ENV = INFORMIXC="${CC}" ESQL_EC_FLAGS = ESQL_EC_LDFLAGS = ${LDFLAGS} # I4GL C-code Compiler # -- if ${CC} is gcc, set I4GL_CC_ENV to INFORMIXC="${CC} -fwritable-strings" I4GL_CC_CMD = c4gl I4GL_CC_ENV = INFORMIXC="${CC}" I4GL_CC_FLAGS = ${CFLAGS} # I4GL C-code Linker I4GL_CL_CMD = ${I4GL_CC_CMD} I4GL_CL_ENV = ${I4GL_CC_ENV} I4GL_CL_FLAGS = ${I4GL_CC_FLAGS} I4GL_CL_LDFLAGS = ${LDFLAGS} # I4GL P-code Compiler I4GL_PC_CMD = fglpc I4GL_PC_ENV = I4GL_PC_FLAGS = # I4GL P-code Linker (code available at IIUG web site) I4GL_PL_CMD = rdslink I4GL_PL_ENV = ${I4GL_PC_ENV} I4GL_PL_FLAGS = ${I4GL_PC_FLAGS} I4GL_PL_LDFLAGS = # I4GL Form Compiler I4GL_FC_CMD = form4gl I4GL_FC_FLAGS = -q # I4GL Message Compiler I4GL_MC_CMD = mkmessage I4GL_MC_FLAGS = # I4GL P-code Librarian (code available at IIUG web site) I4GL_PA_CMD = rdslib I4GL_PA_FLAGS = -rv # I4GL C-code Librarian I4GL_CA_CMD = ar I4GL_CA_FLAGS = -rv # I4GL P-code Runner Compiler I4GL_RC_CMD = cfglgo I4GL_RC_FLAGS = I4GL_RC_ENV = ${I4GL_CC_ENV} # I4GL P-code Debugger Compiler I4GL_DC_CMD = cfgldb I4GL_DC_FLAGS = I4GL_DC_ENV = ${I4GL_CC_ENV} # Complete commands for compiling and linking -- seldom changed ESQL_EC = ${ESQL_EC_ENV} ${ESQL_EC_CMD} ${ESQL_EC_FLAGS} I4GL_CC = ${I4GL_CC_ENV} ${I4GL_CC_CMD} ${I4GL_CC_FLAGS} I4GL_CL = ${I4GL_CL_ENV} ${I4GL_CL_CMD} ${I4GL_CL_FLAGS} I4GL_PC = ${I4GL_PC_ENV} ${I4GL_PC_CMD} ${I4GL_PC_FLAGS} I4GL_PL = ${I4GL_PL_ENV} ${I4GL_PL_CMD} ${I4GL_PL_FLAGS} I4GL_RC = ${I4GL_RC_ENV} ${I4GL_RC_CMD} ${I4GL_RC_FLAGS} I4GL_DC = ${I4GL_DC_ENV} ${I4GL_DC_CMD} ${I4GL_DC_FLAGS} I4GL_FC = ${I4GL_FC_CMD} ${I4GL_FC_FLAGS} I4GL_MC = ${I4GL_MC_CMD} ${I4GL_MC_FLAGS} I4GL_PA = ${I4GL_PA_CMD} ${I4GL_PA_FLAGS} I4GL_CA = ${I4GL_CA_CMD} ${I4GL_CA_FLAGS} # Basic Unix file commands RM = rm -f # Delete files ############################################################################### # Define suffixes which are recognised. I4GL_SUFFIXES = .o .4go .4gl .ec .c .4ge .frm .4gf .4pr .per .iem .msg .4gi .SUFFIXES: ${I4GL_SUFFIXES} # Rules for compiling I4GL (assuming 4.12/6.00 or later with -nokeep as default) .4gl: ${I4GL_CL} -o $@ $< ${I4GL_CL_LDFLAGS} .4gl.4ge: ${I4GL_CL} -o $@ $< ${I4GL_CL_LDFLAGS} .4gl.o: ${I4GL_CC} -c $< .4gl.ec: ${I4GL_CC} -e $< # Rules for compiling ESQL/C .ec: ${ESQL_EC} -o $@ $< ${ESQL_EC_LDFLAGS} ${RM} $*.[co] .ec.o: ${ESQL_EC} -c $< ${RM} $*.c .ec.c: ${ESQL_EC} -e $< # Rules for compiling I4GL form files .per.frm: ${I4GL_FC} $* # I4GL Forms with .4gf extension .4gf.frm: ${RM_F} $*.per ${LN} $*.4gf $*.per ${I4GL_FC} $* ${RM_F} $*.per # I4GL Forms with .4pr extension .4pr.frm: ${RM_F} $*.per ${LN} $*.4pr $*.per ${I4GL_FC} $* ${RM_F} $*.per # Rules for compiling message files .msg.iem: ${I4GL_MC} $< $@ # I4GL RDS compiling .4gl.4go: ${I4GL_PC} $< .4gl.4gi: ${I4GL_PC} $< ${I4GL_PL} -o $@ $*.4go ${I4GL_PL_LDFLAGS} ${RM_F} $*.4go Dink with it to suit yourself. The bit that may need most changing is the .SUFFIXES line. You might find it better to clear out all pre-existing suffixes (.SUFFIXES: as a line) and then add the I4GL suffixes (and perhaps the standard ones - which are typically relevant to C, Yacc, Lex, etc -after the I4GL suffixes.) -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/ "Blessed are we who can laugh at ourselves, for we shall never cease to be amused." NB: Please do not use this email for correspondence. I don't necessarily read it every week, even. Mike Ditka <http://www.brainyquote.com/quotes/authors/m/mike_ditka.html> - "If God had wanted man to play soccer, he wouldn't have given us arms."