Re: 4GL Make-Files
Posted in 1997
Dieter Winkler wrote:
>
> Could anyone send me an example of an 4gl Makefile for the Unix-C-Compiler.
> I would like to create a script with handles compiling all programs
> containing in the sys4glpgm-table.
>
> I have no idea to how i can get the 4gl-sourcefilenames into the makefile.
>
> Thanks!
>
> e-mail: baumschlager@pfeiffer.co.at
I thought nobody would ever ask!
:-)
Below is a report I wrote a while back which attempts to get the program
information out of a sys4glpgm.dbs. It isn't perfect, but it may offer you
some help. I believe the problem with the whole thing is that some of the
information is un-joinable, thusly it can't get it %100 right. But it's been
a while since I messed with this so any questions you have, heh heh, you're
on your own.
As far as a make file, I've a makefile generator at my toolsite. Goto
www.inxutil.com, and follow the links. Any errors with the tools please
let me know. My site was spilling over in size, so I'm in the process
of revamping it. The tools page is brief for now, so you'll have to
shop around.
Anyway, hope this helps. The sounce code here in c.d.i. is not at my site,
I didn't think anybody would ever need this. You just never know.
:-)
Tim
{
--------------------------------------------------------------------------------
pgm4gl.4gl
--------------------------------------------------------------------------------
AUTHOR: Tim Schaefer, The Computer Business Company, Inc.
Copyright 1992, 1993, 1994, 1995, 1996 ALL RIGHTS RESERVED
--------------------------------------------------------------------------------
DESCRIPTION: Produces a report of the dependencies created using the i4gl
program development environment.
DEPENDENCIES: Uses any syspgm4gl.dbs
MAKEFILE: c4gl pgm4gl.4gl -o pgm4gl.4ge
c4gl: c4gl pgm4gl.4gl -o pgm4gl.4ge
ORIGINAL: Wed Feb 7 14:14:44 EST 1996
USAGE: pgm4gl.4ge syspgm4gl output-file
where:
pgm4gl.4ge - this program
syspgm4gl - syspgm4gl.dbs data base
( check your $DBPATH )
will default to ./syspgm4gl.dbs
output-file - defaults to "syspgm4gl.rpt"
unless you specify a name.
NOTES: Check your $DBPATH environment variable in the event you don't
get the database you think you should. If $DBPATH isn't set
the syspgm4gl.dbs directory beneath the current directory is
used.
--------------------------------------------------------------------------------
$Source$
Checked-in-by: $Author$
Checked-in: $Date$
$Revision$
$Locker$
--------------------------------------------------------------------------------
$Log$
--------------------------------------------------------------------------------
}
MAIN
DEFINE prg_rec RECORD
progname CHAR(10),
ppath CHAR(40),
fglsourcename CHAR(10),
spath CHAR(40)
END RECORD
DEFINE dep_rec RECORD
sec_name CHAR(60) ,
string1 CHAR(10) ,
string2 CHAR(40) ,
string3 CHAR(10) ,
string4 CHAR(40)
END RECORD
DEFINE i INTEGER
DEFINE db_name CHAR(40)
DEFINE file_name CHAR(125)
DEFINE glb_txt CHAR(200)
DEFINE lib_txt CHAR(200)
DEFINE opt_txt CHAR(200)
DEFINE oth_txt CHAR(200)
DEFINE run_txt CHAR(200)
DEFINE src_txt CHAR(200)
LET db_name = arg_val(1)
LET file_name = arg_val(2)
# IF num_args() < 2 THEN
# ERROR "usage: pgm4gl.4ge database-name report-name"
# EXIT PROGRAM
# END IF
IF LENGTH ( file_name ) <= 0 OR file_name IS NULL THEN
LET file_name = "syspgm4gl.rpt"
END IF
IF LENGTH ( db_name ) <= 0 OR db_name IS NULL THEN
LET db_name = "syspgm4gl"
END IF
DATABASE db_name
INITIALIZE prg_rec.* TO NULL
INITIALIZE dep_rec.* TO NULL
DECLARE rpt_master_curs CURSOR FOR
SELECT progname, ppath, fglsourcename, spath FROM source4gl
ORDER BY progname, fglsourcename
START REPORT gen_rpt TO file_name
FOREACH rpt_master_curs INTO prg_rec.*
OUTPUT TO REPORT gen_rpt( prg_rec.* , dep_rec.* )
LET glb_txt = "SELECT globname,gpath FROM global",
" WHERE global.progname = ",ascii (34), prg_rec.progname CLIPPED, ascii(34)
," ORDER BY globname "
LET lib_txt = "SELECT libraries FROM libraries",
" WHERE libraries.progname = " , ascii(34), prg_rec.progname CLIPPED, ascii(34)
," ORDER BY libraries "
LET opt_txt = "SELECT options FROM opts",
" WHERE opts.progname = " , ascii(34), prg_rec.progname CLIPPED, ascii(34)
," ORDER BY options "
LET oth_txt = "SELECT othername, opath FROM otherobj",
" WHERE otherobj.progname = " , ascii(34), prg_rec.progname CLIPPED, ascii(34)
," ORDER BY othername "
LET run_txt = "SELECT fglgoname, fpath, db4glname, dpath FROM runner",
" WHERE runner.progname = " , ascii(34), prg_rec.progname CLIPPED, ascii(34)
," ORDER BY fglgoname "
LET src_txt = "SELECT othersourcename, extension, spath FROM sourceother ",
" WHERE sourceother.progname = " , ascii(34), prg_rec.progname CLIPPED, ascii(34)
," ORDER BY othersourcename "
PREPARE glb_prep FROM glb_txt
DECLARE glb_cursor CURSOR FOR glb_prep
PREPARE lib_prep FROM lib_txt
DECLARE lib_cursor CURSOR FOR lib_prep
PREPARE opt_prep FROM opt_txt
DECLARE opt_cursor CURSOR FOR opt_prep
PREPARE oth_prep FROM oth_txt
DECLARE oth_cursor CURSOR FOR oth_prep
PREPARE run_prep FROM run_txt
DECLARE run_cursor CURSOR FOR run_prep
PREPARE src_prep FROM src_txt
DECLARE src_cursor CURSOR FOR src_prep
INITIALIZE dep_rec.* TO NULL
LET dep_rec.sec_name = "Global 4GL Filename ( basename ) "
FOREACH glb_cursor INTO dep_rec.string1, dep_rec.string2
OUTPUT TO REPORT gen_rpt( prg_rec.* , dep_rec.* )
END FOREACH
INITIALIZE dep_rec.* TO NULL
LET dep_rec.sec_name = "Libraries"
FOREACH lib_cursor INTO dep_rec.string1
OUTPUT TO REPORT gen_rpt( prg_rec.* , dep_rec.* )
END FOREACH
INITIALIZE dep_rec.* TO NULL
LET dep_rec.sec_name = "Compiler Options"
FOREACH opt_cursor INTO dep_rec.string1
OUTPUT TO REPORT gen_rpt( prg_rec.* , dep_rec.* )
END FOREACH
INITIALIZE dep_rec.* TO NULL
LET dep_rec.sec_name = "Other Obj"
FOREACH oth_cursor INTO dep_rec.string1, dep_rec.string2
OUTPUT TO REPORT gen_rpt( prg_rec.* , dep_rec.* )
END FOREACH
INITIALIZE dep_rec.* TO NULL
LET dep_rec.sec_name = "RDS Runner"
FOREACH run_cursor INTO dep_rec.string1, dep_rec.strin