emputil.gms : Generates the EMP Model Library files

Description

The following system configuration/document files are written:

    emplib.glb   IDE index and documentaion
    emplibfs.txt Makefile input file

All files $included, read and written have to be in the same
directory.


Small Model of Type : GAMS


Category : GAMS EMP library


Main file : emputil.gms   includes :  empmod.inc [html]

$title Generates the EMP Model Library files (EMPUTIL,SEQ=1)
$onText

  The following system configuration/document files are written:

      emplib.glb   IDE index and documentaion
      emplibfs.txt Makefile input file

  All files $included, read and written have to be in the same
  directory.

$offText

files glb      IDE model library index / 'emplib.glb'   /
      glist    makefile index file     / 'emplibfs.txt' / ;

$offListing
$include empmod.inc
$onListing
*
*  IDE emplib file
*
put glb
    'Version = 5'
 /  'LibraryName = GAMS EMP Library'
 /  'Columns = 4'
 /  '4 = SeqNr'
 /  '1 = Name'
 /  '2 = Type'
 /  '3 = Description'
 /  'InitialSort = 2'
 /  '*$*$*$';

glb.lcase=1;
loop{(s,m)$sm(s,m),
   put / 'Files = ' m.tl:0 '.' s.tl:0;
   loop(incmap(inc,s), put ',',inc.tl:0 '.inc');
   loop{incmap(minc,s),
       put ',[',minc.tl:0,']';
   };
   loop{incmap(oinc,s),
      put ',',oinc.tl:0;
   };
   glb.lcase=2;
   put / '1 = ' m.tl:0;
   put / '2 = '; loop(tss(t,s), put t.tl );
   glb.lcase=0;
   put / '3 = ' m.te(m);
   glb.lcase=1;
   put / '4 = ' '000000':ceil(log10(card(s)+1));
   put   @(glb.cc-card(s.tl)) s.tl:0;
   put_utilities 'glb'/ m.tl:0 '.' s.tl:0;
   put / '*$*$*$'
};
putclose;

*
*  makefile input
*
$sTitle list of all files in makefile format
glist.lcase=1;
put glist 'EMPLIBFILES = \'
        / 'emplib.glb \'
loop{inc,
   put / inc.tl:0 '.inc \'
};
loop{oinc,
   put / oinc.tl:0 ' \'
};
loop(sm(s,m),
   put  / m.tl:0 '.' s.tl:0 ' \' )
putclose // glist;