0.0.18 • Published 2 years ago

@halcyontech/rmake v0.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

rmake

rmake is a tool used to generate a makefile for RPGLE projects.

General usage

rmake will scan the sources in the current working directory (CWD) and generate a makefile based on the results.

rmake && gmake BIN_LIB=libname

Project structure

rmake does not care about project structure, but does enforce these rules for source code names:

  • the object name is the basename of the source file
  • if your source includes .pgm, then it will become a program.
    • mypgm.pgm.rpgle becomes a MYPGM.PGM object
  • if your source does not include .pgm, then it will become a module, cmd, dtaara, etc.
    • mysrvpgm.rpgle becomes MYSRVPGM.MODULE and then MYSRVPGM.PGM
  • rmake only supports single module programs and service programs
  • rmake does not yet support SQL long name references.

Changing compile options

The iproj.json can contain a compiles property to customise how each extension type gets compiled. To generate the defaults, you can use rmake --init to create or update the iproj.json file. When you define an extension in the compiles property, the properties of it will override the rmake defaults.

Here is the schema for the compiles option:

interface iProjFile {
	compiles: {[extension: string]: CompileData};
}

interface CompileData {
	/** indicates what type of object will be built from this source */
	becomes: ObjectType;
	/** will copy the source to a temp member first */
	member?: boolean,
	/** `commands` do not respect the library list and is run before 'command' */
	commands?: string[]
	/** `command` does respect the library list */
	command?: string;
	/** Used if the commands are built up from source. Usually means `command` and `commands` is blank */
	commandSource?: boolean;
	/** if the non-source object now requires source. Use make generic name like `qbndsrc/%.bnd` */
	targetSource?: string;
};

Example: service program binder source

By default, rmake uses EXPORT(*ALL) on CRTSRVPGM. This can be overridden in the iproj.json file:

This definition means that if I am creating a service program named TOOLS.SRVPGM, qbndsrc/TOOLS.bnd needs to exist.

{
	"compiles": {
		"srvpgm": {
			"targetSource": "qbndsrc/%.bnd",
			"command": "CRTSRVPGM SRVPGM($(BIN_LIB)/$*) MODULE(*SRVPGM) SRCSTMF('$<') BNDDIR($(BNDDIR))"
		}
	}
}

Example: build object from commands

Objects like data areas do not have source. In the compiles property, there is a flag that can be used to tell rmake to get the commands from the source.

"dtaara": {
	"becomes": "DTAARA",
	"commandSource": true
}

So if a file exists named version.dtaara, then the CL commands inside it will be used to create that .DTAARA object.

CRTDTAARA DTAARA(*CURLIB/VERSION) TYPE(*CHAR) LEN(20)
CHGDTAARA DTAARA(*CURLIB/VERSION) VALUE('1.0')

When commandSource is enabled, CL commands may error but that will not stop the build as these errors are ignored.

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago