-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Ok, for the last few months I've been playing with different tools to help generate makefiles for very large ILE RPG applications that make use of lots of LF, PF, PRTF, etc and it is a lot of work. I think the next possible way to help generate these makefiles is to build my own generator.
The generator would work post-source-migration. As in, you would have already moved all the sources to the IFS. The way I am thinking this would work is by actually scanning the source code for references. I want something that is open-source and easy to use.
Here's how each type of source code would get their references
LF/PF
DSPDBRto find logical/physical relations
RPGLE
-
F spec (both fixed format and free format)
- to determine whether it is LF or PF, you would have to use the name of the declaration to find the file and determine it by the file's extension.
-
CALL opcode.
- Look for any program that doesn't start with Q
-
Embedded SQL
- While this one is hard because it's SQL syntax, we can hopefully just look for the
FROMclause and take the file after it (the file also may be a stored procedure). - We also need to look for stored procedures (
CALL).
- While this one is hard because it's SQL syntax, we can hopefully just look for the
-
ExtPgmwhich points to an external program -
BndDirin the source so a binding directory is created in the makefile -
ExtProcwhich points to an external procedure, which of course we don't know what that procedure is. -
ExtNamecan point to an external table -
NoMainwould indicate it's a module (.rpglemod) -
Optionally add
/copyand/includeas deps, incase you want to track changes in dep sources. -
As a backup, after we've got a list of LF/PF references, we can just scan each RPGLE source for the names of the LF/PF files, which may indicate a reference.
CLLE
DclFwhich defines a file- We may optionally want to look for any
OBJparameter, as it may indicate other references - There are also commands to think about. We could check if the command the CL is trying to run exists in the source directory. Then if it does add it as a dep.
DDS (LF/PF/PRTF)
- The
REFkeyword.