Create a single-segment BSO using a generic makefile

This task shows you how to create and build a generic makefile that you can use to assemble and link a BSO that has one assembler source file (as specified by the BEGIN macro) and one entry point, with the convention that the assembler source file has the same base name as the application name, but is in lowercase with a .asm file extension. The application name itself will be in uppercase. This enables one makefile to be used for all BAL applications that match that criteria.

To create a single-segment BSO using a generic makefile, follow these steps:
  1. Create a new makefile (/home/joe/mywork/billing/rt/src/generic_bso.mak) as shown in the following example:
    APP := $(shell echo $(TPF_PGM_NAME) | tr [:lower:] [:upper:] )
    ASM_SRC := $(shell echo $(TPF_PGM_NAME) | tr [:upper:] [:lower:]).asm
    maketpf_env := billing
    maketpf_env += base_rt
    include maketpf.rules

    This makefile is very similar to the single-segment BSO makefile described in Create a single-segment BSO; however, the value of variable TPF_PGM_NAME is derived at build time as input to the maketpf command.

  2. Create a source segment named /home/joe/mywork/billing/rt/src/bill.asm.
  3. Update the user control file with an entry for the new program:
    1. Create a copy of the control file in your working directory:
      cp /tpf/z11/local_mod/base/cntl/usr.cntl /home/joe/mywork/base/cntl/usr.cntl
    2. Edit the file that you just copied and add a new entry for the program named BILL. Enter the following information on one line.
      BILL;APP;billing/rt/src/generic_bso.mak;1;ALL;OBJ;TPF_SBALL;LOADONLINE;STUB;DEMAND;
      DEBUG;50;PROGRAM;NOGRP;IBM_DEFT;BPAUTH;RESTRICT;MONTC;KEY0;NOCMB;TIMESLICE;;;;;;;;;;;;; 
    Again, this makefile is similar to the entry added in Create a single-segment BSO; however, you can use the same generic makefile for many applications.
  4. Enter the maketpf command to build the program. This assumes that a file named maketpf.cfg exists in the /home/joe/mywork/build directory.
     cd /home/joe/mywork/build
     maketpf bill 
    The string bill is supplied to the generic_bso.mak file to be used as the value of "TPF_PGM_NAME".