Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

make run

The following example of the make functionality consists of several procedures.

The procedure MAINPROCEDURE has the following parameters:

TARGET:

Target component of the make runs

SUCC-PROC:

Continuation processing

SELECT:

Consideration of the time stamp

PROCEDURE:

Generated procedure

MAKEFILE:

Description of the program system itself

MAKEDEFAULTS:

Description of the global defaults

The parameters TARGET, SUCC-PROC, SELECT and PROCEDURE are to be specified in the same way as in BEGIN-MAKE. If the procedure is called with the default parameters, the target component of the make run is the first target in MAKEDEFAULTS or MAKEFILE. The make run generates a procedure which is then called with INCLUDE-PROCEDURE.

The MAKEDEFAULTS file contains default settings and standard actions, i.e. things that can be shared by a number of program systems.

The MAKEFILE file contains the actual definitions of the program system, the dependencies.
The program system contains a phase file which is linked from two object modules. The object modules are compiled from S-type members of the same names with the aid of two M-type members. The pseudo-targets CLEAR and PRINT can be used for special program system actions (clearing and printing).

MAINPROCEDURE procedure:

/DECLARE-PARAMETER (TARGET(INI-VALUE= ́*FIRST-TARGET ́),- 
/                   SUCC-PROC(INI-VALUE= ́*CREATE-PROC ́),- 
/                   SELECT(INI-VALUE= ́*MODIFIED ́),- 
/                   PROCEDURE(INI-VALUE= ́#P ́),- 
/                   MAKEFILE(INI-VALUE= ́MAKEFILE ́),- 
/                   MAKEDEFAULTS(INI-VALUE= ́MAKEDEFAULTS ́)) 
/SET-VAR SUB0=SUBSTR( ́&(PROCEDURE) ́,1,2)   „FILE OR BIB.-ELEMENT" -----------------  (1) 
/BEGIN-BLOCK DATA-INSERTION=YES 
/START-LMS 

(1)

Use of the /INCLUDE-PROCEDURE command is permitted.

/IF (SUB0= ́*L ́) 
// MODIFY-LMS-DEFAULTS TYPE=J 
// DELETE-ELEMENT &(PROCEDURE)    „BIB.-ELEMENT DELETE" 
// STEP 
/ELSE 
// EXEC-SYSTEM-CMD DELETE-FILE &(PROCEDURE)  „FILE DELETE" 
// STEP 
/END-IF 
//BEGIN-MAKE TARGET=&(TARGET), - -------------------------------------------------   (2) 
//           SELECT=&(SELECT), - 
//           SUCCESS-PROCESSING=&(SUCC-PROC), - 
//           PROCEDURE=&(PROCEDURE) 
/INCLUDE-PROCEDURE NAME=&MAKEDEFAULTS --------------------------------------------   (3) 
/INCLUDE-PROCEDURE NAME=&MAKEFILE 
/END-BLOCK 
//END-MAKE -----------------------------------------------------------------------  (4) 
//END 
/IF (SUBSTR( ́&(SUCC-PROC) ́,2,2) <>  ́CR ́)́  „NO CREATE-PROC" 
/   EXIT-PROC  „SUBSEQUENT PROCESSING ALREADY EXECUTED" 
/END-IF 
/INC-PROC &(PROCEDURE)  „EXECUTE, MAYBE NOT EXISTING" 
/SET-JOB-STEP 
/EXIT-PROCEDURE 

(2)

The make run is started.

(3)

MAKEDEFAULTS and MAKEFILE are called.

(4)

The sequence of make substatements is concluded and so also the make run. Continuation processing as specified in the BEGIN-MAKE statement (in this case the default INCLUDE-PROCEDURE) is initiated.

MAKEDEFAULTS file:

/RESUME-PROGRAM 
//MODIFY-MAKE-DEFAULTS LIBRARY=BSPLIB,- 
//   CURRENT-TARGET-VAR=CURT,FROM-OBJECTS-VAR=ALLOBJ ------------------------------  (5) 
//SET-STD-ACTION - ----------------------------------------------------------------  (6) 
//   TARGET-TYPE=R,FROM-TYPE=S,- 
//   ACTION='/CALL-PROCEDURE *LIB(BSPLIB,COMPILE),(&&(CURT.ELEMENT))' 
/HOLD-PROGRAM ---------------------------------------------------------------------  (7) 
/EXIT-PROC 

(5)

The default library and make variables are set. These settings are valid for the subsequent statements.

(6)

A standard action (compilation) is set for the transition from member type S to member type R.

(7)

Preparation for branching back out of the procedure.

MAKEFILE file:

/RESUME-PROGRAM 
//SET-DEPENDENCY - ---------------------------------------------------------------   (8) 
//   TARGET-OBJECT=PROG, -
//   FROM-OBJECT=(*LIB(,TEIL1,R),*LIB(,TEIL2,R)), - 
//   ACTION='/CALL-PROCEDURE LINK,(OBJVAR=ALLOBJ)' 
//SET-DEPENDENCY - ---------------------------------------------------------------   (9) 
//   TARGET-OBJECT=*LIB(,*,R),- 
//   FROM-OBJECT=(*LIB(,*,S), *LIB(,GLOBALDATA,M), *LIB(,HEADERS,M)) -------------  (10) 
//SET-DEPENDENCY - ---------------------------------------------------------------  (11) 
//   TARGET-OBJECT=CLEAR,- 
//   ACTION='/CALL-PROCEDURE *LIB(BSPLIB,DELETE.TEMPS)' 
//SET-DEPENDENCY - ---------------------------------------------------------------  (12) 
//   TARGET-OBJECT=PRINT,- 
//   ACTION='/CALL-PROCEDURE *LIB(BSPLIB,PRINT.LISTFILES)' 
//SET-PREPROCESSING - ------------------------------------------------------------  (13) 
//   ACTION=('/CALL-PROCEDURE *LIB(BSPLIB,INIT)',- 
//           '/DECL-VAR ALLOBJ(TYPE=STRING),MULT-ELEM=LIST,SCOPE=TASK')
//SET-POSTPROCESSING - -----------------------------------------------------------  (14) 
//   ACTION='/CALL-PROCEDURE *LIB(BSPLIB,STOP)' 
/HOLD-PROGRAM 
/EXIT-PROC 

(8)

Definition of the dependency “Phase is linked from object modules”. The phase file PROG is the first target of the make run (*FIRST-TARGET).

(9)

Definition of the dependency “Object module generated from source of same name; further components (type M) required.” The standard action specified in (3) is used.

(10)

“Of the same name” is formulated through the use of make selection and construction. The selection is specified at TARGET-OBJECT, and the construction at FROM-OBJECT. The LMS restriction that the construction must contain at least one wildcard symbol does not apply to make construction specifications. *LIB(,HEADERS,M) contains no wildcard symbol.

(11)

The target file CLEAR is not dependent on any FROM-OBJECT, i.e. is never current. If CLEAR is specified as the target of the make run, clearing actions are initiated for the program system. The CLEAR actions should not be executed every time the program system is updated.

(12)

As in (11). The printing of results is defined as the action for PRINT.

(13)

When a procedure is generated, the ́/CALL INIT ́ action is to be placed at its beginning. In addition, the variable ALLOBJ is to be defined globally for the task since it is to be imported into the LINK procedure later. The declaration is not overwritten during execution of the generated procedure.

(14)

When a procedure is generated, the ́/CALL STOP ́ action is to be placed at its end.

Written in a fashion similar to that of UNIX-make, the MAKEFILE file could look like this:

MAKEFILE file:

/RESUME-PROGRAM 
//SET-DEPENDENCY PROG, (*LIB(,TEIL1,R),*LIB(,TEIL2,R)), - 
//   '/CALL-PROCEDURE *LIB(BSPLIB,LINK),(OBJVAR=ALLOBJ)' 
//SET-DEPENDENCY *LIB(,*,R),(*LIB(,*,S),*LIB(,GLOBALDATA,M),*LIB(,HEADERS,M))
//SET-DEPENDENCY CLEAR, *NONE,- 
//   '/CALL-PROCEDURE *LIB(BSPLIB,DELETE.TEMPS)' 
//SET-DEPENDENCY PRINT, *NONE,- 
//   '/CALL-PROCEDURE *LIB(BSPLIB,PRINT.LISTFILES)' 
//SET-PREPROCESSING ('/CALL-PROCEDURE *LIB(BSPLIB,INIT)',- 
//   '/DECL-VAR ALLOBJ(TYPE=STRUC),MULT-ELEM=LIST,SCOPE=TASK')
//SET-POSTPROCESSING '/CALL-PROCEDURE *LIB(BSPLIB,STOP)' 
/HOLD-PROGRAM 
/EXIT-PROC 

If it is necessary to generate the program system in its entirety, the required procedure would look something like this:

/DECL-VAR SYSLMSMAKE(TYPE=STRUC(DEF=*DYN)) ---------------------------------------   (1) 
/CALL-PROCEDURE *LIB(BSPLIB,INIT)
/DECL-VAR ALLOBJ(TYPE=STRUC),MULT-ELEM=*LIST,SCOPE=*TASK
/IF-BLOCK-ERROR ------------------------------------------------------------------   (2) 
/EXIT-PROCEDURE 
/END-IF 
/DECLARE-VARIABLE CURT(TYPE=*STRUC) ----------------------------------------------   (3) 
/IF-BLOCK-ERROR 
/END-IF 
... 
/SET-VARIABLE CURT.ELEM = 'TEIL1' ------------------------------------------------   (4) 
... 
/CALL-PROCEDURE *LIB(BSPLIB,COMPILE),(&(CURT.ELEM)) 
... 
/SET-VARIABLE CURT.ELEM = 'TEIL2' 
... 
/CALL-PROCEDURE *LIB(BSPLIB,COMPILE),(&(CURT.ELEM)) 
... 
/DECLARE-VARIABLE ALLOBJ(TYPE=*STRUC),MULT-ELEM=*LIST ----------------------------   (5) 
/IF-BLOCK-ERROR 
/END-IF 
/FREE-VARIABLE ALLOBJ 
... 
/SET-VARIABLE SYSLMSMAKE.ELEM = 'TEIL1' 
... 
/SET-VARIABLE ALLOBJ = SYSLMSMAKE,MODE=APPEND ------------------------------------   (6) 
/SET-VARIABLE SYSLMSMAKE.ELEM = 'TEIL2' 
... 
/SET-VARIABLE ALLOBJ = SYSLMSMAKE,MODE=APPEND 
/CALL-PROCEDURE *LIB(BSPLIB,LINK),(OBJVAR=ALLOBJ) 
... 
/CALL-PROCEDURE *LIB(BSPLIB,STOP) 

(1)

The make-internal auxiliary variables for list creation are declared.

(2)

This sequence of statements is inserted after each action (except POSTPROCESSING) to ensure clean error exiting.

(3)

CURT is declared (errors are tolerated since CURT can be declared, for example, globally).

(4)

The other components of the S variables and the S list variable ALLOBJ are also set.

(5)

An empty S list variable for ALLOBJ is declared. ALLOBJ is also handled before the other procedure calls, but its result is not used in them.

(6)

The FROM-OBJECTS are appended to the S list variable ALLOBJ.

The procedures called in MAKEFILE have the following interfaces:

  1. INIT and STOP have no parameters.

  2. COMPILE has only one parameter, i.e. a member name. For the sake of simplicity, no library specification or other information is entered.

  3. LINK allows the entry of the name of an S list variable containing all the objects that are to be linked. The list variable is handled as follows:

/DECL-PAR NAME=INPUTVAR(TYPE=STRING) 
/DECL-VAR I(TYPE=STRUC(DEF=*DYN)) 
/IMPORT-VAR &(INPUTVAR) -----------------------------------------------------------  (1) 
... 
/FOR I=*LIST(&INPUTVAR) -----------------------------------------------------------  (2) 
/    DO-SOMETHING ... &(I) --------------------------------------------------------  (3) 
/END-FOR 

(1)

The specified list variables (which must be defined globally for the task) are imported.

(2)

The list variables are listed in variable I.

(3)

Variable I is used either directly in SDF entries or in /SEND-DATA or /SEND-STATEMENT.