Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a makefile dependency generator for RPGLE (part 2) #47

Open
worksofliam opened this issue Jun 12, 2020 · 0 comments
Open

Building a makefile dependency generator for RPGLE (part 2) #47

worksofliam opened this issue Jun 12, 2020 · 0 comments
Labels
blog Personal interests

Comments

@worksofliam
Copy link
Owner

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

  • DSPDBR to 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 FROM clause and take the file after it (the file also may be a stored procedure).
    • We also need to look for stored procedures (CALL).
  • ExtPgm which points to an external program

  • BndDir in the source so a binding directory is created in the makefile

  • ExtProc which points to an external procedure, which of course we don't know what that procedure is.

  • ExtName can point to an external table

  • NoMain would indicate it's a module (.rpglemod)

  • Optionally add /copy and /include as 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

  • DclF which defines a file
  • We may optionally want to look for any OBJ parameter, 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 REF keyword.
@worksofliam worksofliam added the blog Personal interests label Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blog Personal interests
Projects
None yet
Development

No branches or pull requests

1 participant