@profoundlogic/codermake 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,141 @@
1
+ # Compile Listings Reference
2
+
3
+ Guide to finding and interpreting IBM i compile listings produced by codermake builds.
4
+
5
+ ## Where to find logs
6
+
7
+ Every build target produces a log file at:
8
+
9
+ ```
10
+ tmp/logs/<target>.log
11
+ ```
12
+
13
+ For example, building `mypgm.pgm` writes to `tmp/logs/mypgm.pgm.log`.
14
+
15
+ ## RPG listings (.rpgle)
16
+
17
+ RPG compile listings from `CRTBNDRPG` or `CRTRPGMOD` follow a standard structure:
18
+
19
+ 1. **Header** -- compiler version, source file path, compile options
20
+ 2. **Source listing** -- numbered source lines (may include copy members)
21
+ 3. **Additional diagnostics** -- cross-reference tables, data structure layouts
22
+ 4. **Message summary** -- all diagnostic messages grouped by severity
23
+
24
+ ### Reading the message summary
25
+
26
+ The message summary appears near the end of the listing. Each entry shows:
27
+
28
+ ```
29
+ MSG ID SEV LINE TEXT
30
+ RNF7031 00 12 The name or indicator is not referenced.
31
+ RNF7066 00 45 A semicolon is expected ...
32
+ RNF5377 30 78 The type of expression does not match ...
33
+ ```
34
+
35
+ **Severity levels:**
36
+
37
+ | Severity | Meaning | Action |
38
+ |---|---|---|
39
+ | 00 | Informational | Safe to ignore |
40
+ | 10 | Warning | Review but usually benign |
41
+ | 20 | Error (recoverable) | Compiler attempted to continue; fix recommended |
42
+ | 30 | Severe error | Compilation failed; must fix |
43
+ | 40+ | Unrecoverable | Compilation failed; must fix |
44
+
45
+ Search for severity 30+ messages to find the root cause of a build failure. The `LINE` column tells you which source line triggered the error.
46
+
47
+ ### Common RPG message IDs
48
+
49
+ | ID prefix | Area |
50
+ |---|---|
51
+ | `RNF` | RPG compiler messages |
52
+ | `RNS` | RPG compiler (structured) |
53
+ | `SQL` | Embedded SQL messages (in SQLRPGLE) |
54
+
55
+ ## SQL RPG listings (.sqlrpgle)
56
+
57
+ SQL RPG compilation is a two-phase process:
58
+
59
+ 1. **SQL precompile** (`CRTSQLRPGI`) -- translates embedded SQL into RPG call statements
60
+ 2. **RPG compile** -- compiles the resulting RPG source
61
+
62
+ The log contains output from both phases. When debugging:
63
+
64
+ - **SQL errors** appear in the first phase. Look for `SQL` message IDs.
65
+ - **RPG errors** appear in the second phase. Look for `RNF`/`RNS` message IDs.
66
+ - If the SQL precompile fails, the RPG compile does not run.
67
+
68
+ ### SQL precompile messages
69
+
70
+ ```
71
+ SQL0104 30 Position 45 Token "SELEC" was not valid. Valid tokens: ...
72
+ SQL0204 20 Table "MYLIB/NOTABLE" not found.
73
+ ```
74
+
75
+ The position or line number tells you where in the embedded SQL the error occurred.
76
+
77
+ ## CL listings (.clle, .clp, .cl)
78
+
79
+ CL compile errors appear as `CPD` or `CPF` messages:
80
+
81
+ ```
82
+ CPD0727 30 The character value specified is not a valid name.
83
+ CPF0001 40 Error found on CALL command.
84
+ ```
85
+
86
+ For ILE CL (`CRTBNDCL`, `CRTCLMOD`), the listing structure is similar to RPG -- source listing followed by a message summary.
87
+
88
+ For OPM CL (`CRTCLPGM`), the output is typically shorter and errors reference source sequence numbers.
89
+
90
+ ## DDS listings (.dspf, .pf, .lf, .prtf)
91
+
92
+ DDS compilation errors from `CRTDSPF`, `CRTPF`, `CRTLF`, or `CRTPRTF` produce `CPD` messages:
93
+
94
+ ```
95
+ CPD7302 30 Record format SCREEN1 not found in file referenced.
96
+ CPD7344 30 Keyword REF not valid for this type of file.
97
+ ```
98
+
99
+ DDS errors typically reference a specific record format and line within the source.
100
+
101
+ ## SQL DDL listings (.table.sql, .index.sql, .proc.sql)
102
+
103
+ SQL DDL statements executed via `RUNSQLSTM` produce SQL messages:
104
+
105
+ ```
106
+ SQL0104 30 Token "CREAT" was not valid.
107
+ SQL0601 20 Table EMPLOYEE in MYLIB already exists.
108
+ SQL7905 10 Module *N in *N not found.
109
+ ```
110
+
111
+ - Severity 30+ means the statement failed.
112
+ - Severity 20 warnings (like "already exists") may or may not be a problem depending on context.
113
+
114
+ ## Message files and binding directories (.msgf, .bnddir)
115
+
116
+ These execute CL commands from a source file. Errors appear as `CPF` or `CPD` messages from the individual CL commands:
117
+
118
+ ```
119
+ CPF2112 40 Object APPMSG type *MSGF already exists in library MYLIB.
120
+ CPF2105 30 Object MYSRVPGM in MYLIB type *SRVPGM not found.
121
+ ```
122
+
123
+ ## Practical example
124
+
125
+ A build of `mypgm.pgm` fails. Here is how to diagnose it:
126
+
127
+ ```bash
128
+ # 1. Check the log
129
+ cat tmp/logs/mypgm.pgm.log
130
+
131
+ # 2. Search for high-severity messages
132
+ grep -E 'RNF.{4}\s+[34]0|SQL.{4}\s+[34]0|CPD.{4}\s+[34]0|CPF.{4}\s+[34]0' tmp/logs/mypgm.pgm.log
133
+ ```
134
+
135
+ Example output:
136
+
137
+ ```
138
+ RNF5377 30 42 The type of expression does not match the type expected.
139
+ ```
140
+
141
+ This tells you line 42 of the RPG source has a type mismatch. Open the source file, go to line 42, and fix the expression type.
@@ -0,0 +1,243 @@
1
+ # File Types Reference
2
+
3
+ Complete reference for all source and object types supported by codermake. Each entry shows the Rules.mk syntax and the IBM i CL command used to compile it.
4
+
5
+ ## Programs (.pgm)
6
+
7
+ ### RPG program from .rpgle
8
+
9
+ Compiles an ILE RPG source file into a bound program.
10
+
11
+ ```makefile
12
+ mypgm.pgm: mypgm.rpgle
13
+ ```
14
+
15
+ **CL command:** `CRTBNDRPG PGM(LIB/MYPGM) SRCSTMF('src/mypgm.rpgle')`
16
+
17
+ ### SQL RPG program from .sqlrpgle
18
+
19
+ Compiles an RPG source file with embedded SQL into a bound program. Two-phase compilation: SQL precompile, then RPG compile.
20
+
21
+ ```makefile
22
+ mypgm.pgm: mypgm.sqlrpgle
23
+ ```
24
+
25
+ **CL command:** `CRTSQLRPGI OBJ(LIB/MYPGM) OBJTYPE(*PGM) SRCSTMF('src/mypgm.sqlrpgle')`
26
+
27
+ ### ILE CL program from .clle
28
+
29
+ Compiles an ILE CL source file into a bound program.
30
+
31
+ ```makefile
32
+ mypgm.pgm: mypgm.clle
33
+ ```
34
+
35
+ **CL command:** `CRTBNDCL PGM(LIB/MYPGM) SRCSTMF('src/mypgm.clle')`
36
+
37
+ ### OPM CL program from .clp or .cl
38
+
39
+ Compiles an OPM CL source file into a program. Uses source members (not stream files). OPM CL cannot be compiled to modules.
40
+
41
+ ```makefile
42
+ mypgm.pgm: mypgm.clp
43
+ ```
44
+
45
+ **CL command:** `CRTCLPGM PGM(LIB/MYPGM) SRCFILE(LIB/QCLSRC)`
46
+
47
+ ### SQL procedure from .proc.sql
48
+
49
+ Runs a SQL DDL script that creates a stored procedure. The resulting object appears as a program.
50
+
51
+ ```makefile
52
+ getcount.pgm: getcount.proc.sql
53
+ ```
54
+
55
+ **CL command:** `RUNSQLSTM SRCSTMF('src/getcount.proc.sql') COMMIT(*NONE) DFTRDBCOL(LIB)`
56
+
57
+ ### Program from modules
58
+
59
+ Links one or more compiled modules into a program. All prerequisites must be `.module` targets.
60
+
61
+ ```makefile
62
+ mypgm.pgm: mod1.module mod2.module
63
+ ```
64
+
65
+ **CL command:** `CRTPGM PGM(LIB/MYPGM) MODULE(LIB/MOD1 LIB/MOD2)`
66
+
67
+ ## Modules (.module)
68
+
69
+ Modules are intermediate compile units that are linked into programs or service programs.
70
+
71
+ ### RPG module from .rpgle
72
+
73
+ ```makefile
74
+ mymod.module: mymod.rpgle
75
+ ```
76
+
77
+ **CL command:** `CRTRPGMOD MODULE(LIB/MYMOD) SRCSTMF('src/mymod.rpgle')`
78
+
79
+ ### SQL RPG module from .sqlrpgle
80
+
81
+ ```makefile
82
+ mymod.module: mymod.sqlrpgle
83
+ ```
84
+
85
+ **CL command:** `CRTSQLRPGI OBJ(LIB/MYMOD) OBJTYPE(*MODULE) SRCSTMF('src/mymod.sqlrpgle')`
86
+
87
+ ### ILE CL module from .clle
88
+
89
+ ```makefile
90
+ mymod.module: mymod.clle
91
+ ```
92
+
93
+ **CL command:** `CRTCLMOD MODULE(LIB/MYMOD) SRCSTMF('src/mymod.clle')`
94
+
95
+ ## Service programs (.srvpgm)
96
+
97
+ A service program is created from one or more modules plus an export list (`.exports` file). The export list defines which procedures are visible to callers.
98
+
99
+ ```makefile
100
+ mymod.module: mymod.rpgle
101
+ mysrvpgm.srvpgm: mymod.module mysrvpgm.exports
102
+ ```
103
+
104
+ **CL command:** `CRTSRVPGM SRVPGM(LIB/MYSRVPGM) MODULE(LIB/MYMOD) EXPORT(*SRCFILE) SRCSTMF('src/mysrvpgm.exports')`
105
+
106
+ ### .exports file format
107
+
108
+ The exports file is a plain text file with the following structure:
109
+
110
+ ```
111
+ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE(*GEN)
112
+ EXPORT SYMBOL("procedureName")
113
+ EXPORT SYMBOL("anotherProc")
114
+ ENDPGMEXP
115
+ ```
116
+
117
+ List every procedure that callers should be able to invoke. Procedure names are case-sensitive and must match the RPG prototype names exactly.
118
+
119
+ ## Files (.file)
120
+
121
+ The `.file` target extension covers several distinct IBM i object types, differentiated by the source extension.
122
+
123
+ ### Display file from .dspf
124
+
125
+ Creates a display file from DDS source.
126
+
127
+ ```makefile
128
+ myscreen.file: myscreen.dspf
129
+ ```
130
+
131
+ **CL command:** `CRTDSPF FILE(LIB/MYSCREEN) SRCFILE(LIB/QDDSSRC)`
132
+
133
+ ### Rich Display File from .json
134
+
135
+ Creates a display file from Profound UI Rich Display File JSON. The JSON is converted to DDS before compilation.
136
+
137
+ ```makefile
138
+ myscreen.file: myscreen.json
139
+ ```
140
+
141
+ **CL command:** `CRTDSPF FILE(LIB/MYSCREEN) SRCFILE(LIB/QDDSSRC) ENHDSP(*YES)`
142
+
143
+ ### Physical file from .pf
144
+
145
+ Creates a physical file from DDS source.
146
+
147
+ ```makefile
148
+ custdata.file: custdata.pf
149
+ ```
150
+
151
+ **CL command:** `CRTPF FILE(LIB/CUSTDATA) SRCFILE(LIB/QDDSSRC)`
152
+
153
+ ### Logical file from .lf
154
+
155
+ Creates a logical file (view/index over a physical file) from DDS source. Typically depends on the physical file it references.
156
+
157
+ ```makefile
158
+ custview.file: custview.lf custdata.file
159
+ ```
160
+
161
+ **CL command:** `CRTLF FILE(LIB/CUSTVIEW) SRCFILE(LIB/QDDSSRC)`
162
+
163
+ ### Printer file from .prtf
164
+
165
+ Creates a printer file from DDS source.
166
+
167
+ ```makefile
168
+ report.file: report.prtf
169
+ ```
170
+
171
+ **CL command:** `CRTPRTF FILE(LIB/REPORT) SRCFILE(LIB/QDDSSRC)`
172
+
173
+ ### SQL table from .table.sql
174
+
175
+ Creates a SQL table by running a DDL script.
176
+
177
+ ```makefile
178
+ employee.file: employee.table.sql
179
+ ```
180
+
181
+ **CL command:** `RUNSQLSTM SRCSTMF('src/employee.table.sql') COMMIT(*NONE) DFTRDBCOL(LIB)`
182
+
183
+ ### SQL index from .index.sql
184
+
185
+ Creates a SQL index by running a DDL script. Typically depends on the table it indexes.
186
+
187
+ ```makefile
188
+ empname.file: empname.index.sql employee.file
189
+ ```
190
+
191
+ **CL command:** `RUNSQLSTM SRCSTMF('src/empname.index.sql') COMMIT(*NONE) DFTRDBCOL(LIB)`
192
+
193
+ ## Menus (.menu)
194
+
195
+ A menu object requires both a display file and a message file.
196
+
197
+ ```makefile
198
+ mymenu.menu: mymenu.file mymenu.msgf
199
+ ```
200
+
201
+ **CL command:** `CRTMNU MENU(LIB/MYMENU) TYPE(*DSPF) DSPF(LIB/MYMENU) MSGF(LIB/MYMENU)`
202
+
203
+ ## Message files (.msgf)
204
+
205
+ Message files use the dual-purpose pattern: the `.msgf` extension is both the source and the target. The source file contains CL commands that create and populate the message file.
206
+
207
+ ```makefile
208
+ # Build the message file
209
+ appmsg.msgf: appmsg.msgf
210
+
211
+ # Use as a dependency (treated as a built object)
212
+ mymenu.menu: mymenu.file appmsg.msgf
213
+ ```
214
+
215
+ **Typical source content (src/appmsg.msgf):**
216
+
217
+ ```cl
218
+ CRTMSGF MSGF($LIBRARY/$NAME)
219
+ ADDMSGD MSGID(MSG0001) MSGF($LIBRARY/$NAME) MSG('First message') SECLVL('Detail text')
220
+ ```
221
+
222
+ The `$LIBRARY` and `$NAME` variables are set automatically by codermake at build time.
223
+
224
+ ## Binding directories (.bnddir)
225
+
226
+ Binding directories also use the dual-purpose pattern. The source file contains CL commands that create the binding directory and add entries to it.
227
+
228
+ ```makefile
229
+ # Build the binding directory (order-only dep ensures srvpgm exists first)
230
+ mybnddir.bnddir: mybnddir.bnddir | mysrvpgm.srvpgm
231
+
232
+ # Use as order-only dependency
233
+ mypgm.pgm: mypgm.rpgle mysrvpgm.srvpgm | mybnddir.bnddir
234
+ ```
235
+
236
+ **Typical source content (src/mybnddir.bnddir):**
237
+
238
+ ```cl
239
+ CRTBNDDIR BNDDIR($LIBRARY/$NAME)
240
+ ADDBNDDIRE BNDDIR($LIBRARY/$NAME) OBJ(($LIBRARY/MYSRVPGM *SRVPGM))
241
+ ```
242
+
243
+ Binding directories are almost always used as order-only prerequisites (`|`) because they must exist at compile time but should not trigger rebuilds when their content changes.