The Package Makefile File

Once you have created the appropriate prototype and library files, you must compile the prototype for each system type. The result is a system-specific configuration file.

The Makefile file defines the prototype and library files used and the order of compilation. We recommend that you create your Makefile file by modifying the example provided with the AFS distribution, as described in this section. In the conventional configuration, it is located at /afs/cellname/wsadmin/src/Makefile.

Overview

The following list summarizes the sections in the package Makefile file, identifying each by the header name that begins the section. More detailed descriptions follow.

CONFIG=

Lists all of the configuration files to be created and defines which prototype files are compiled for which system types. See The CONFIG Section.

BASE_LIBS=

Lists the pathnames of all operating-system- and function independent library files included in any prototype files. See The BASE_LIBS Section.

MACHINE_LIBS=

Lists the pathnames of all operating-system-specific library files included in any prototype files. See The MACHINE_LIBS Section.

LIBS=

A one-line instruction that defines LIBS as the combination of BASE_LIBS and MACHINE_LIBS. See The LIBS Section.

.SUFFIXES

Defines all of the suffixes that can appear on a prototype or configuration file. See The .SUFFIXES Section.

Finally, the Makefile file contains a set of instructions that the package program follows to generate configuration files. It is not generally necessary to alter this section. See The Makefile Instructions Section.

The CONFIG Section

As mentioned, a configuration file is a prototype file that has been compiled for a specific operating system type. The CONFIG section of the Makefile file defines the prototype files to compile for each system type. The resulting compiled file is a system-specific configuration file.

Study the following example taken from the sample Makefile file. Configuration files are defined by specifying the prototype-system combination as prototype_file.sysname. Note that it is not necessary to generate a configuration file for each prototype-system type combination.

   #Makefile...
   #    (C) Copyright IBM Corporation 1999
   #    Licensed Materials - Property of IBM
   #    All Rights Reserved.
   #
   CONFIG = \
            staff.rs_aix42 \
            staff.alpha_dux40 \
            staff.xdm.alpha_dux40 \
            staff.sun4x_56 \
            staff.hp_ux110 \
            minimal.rs_aix42 \
            minimal.alpha_dux40 \
            minimal.hp_ux110 \
            minimal.sun4x_56

An entry in the CONFIG section has the following format:

  • The first part of the entry defines the prototype file and is the same as the prototype file name (without the .proto extension). The second part of the entry indicates the system type for which the prototype file is to be compiled. A complete list of these suffixes is in the .SUFFIXES section of the Makefile file, as described in The .SUFFIXES Section. This prototype_file.sysname definition becomes the name of the compiled configuration file.

    For example, staff.rs_aix42 indicates that the staff.proto file is compiled for machines running AIX 4.2. The resulting compiled configuration file is called staff.rs_aix42.

  • Each configuration file must appear on a separate line.

  • A backslash must follow the CONFIG= header and every name but the last one. A backslash must also appear on blank lines.

The BASE_LIBS Section

This section defines the complete pathname of all system- and function-independent library files included in any prototype file. (System-specific library files are defined in the MACHINE_LIBS section). The pathnames can include the ${wsadmin} variable, whose value is supplied on the make command line.

You must include all of the library files referred to in your prototype files; files included but not used are ignored.

Study the following example. Note that the all entries (except the last one) must be followed by a backslash.

   BASE_LIBS = \
           ${wsadmin}/src/admin \
           ${wsadmin}/lib/devel \
           ${wsadmin}/lib/base.generic

The MACHINE_LIBS Section

This section lists the complete pathname of all operating-system-specific library files included in prototype files. (System- and function-independent library files are defined in the BASE_LIBS section.)

Study the following example. Note that in this example, library files were grouped by operating-system type. Again, all lines (except the last one) must be followed by a backslash, the ${wsadmin} variable is allowed, and files included but not used are ignored.

   MACHINE_LIBS = \
           ${wsadmin}/lib/rs_aix42.generic \
           ${wsadmin}/lib/rs_aix42.generic.dev \
           ${wsadmin}/lib/rs_aix42.readonly \
           ${wsadmin}/lib/rs_aix42.readwrite \
           ${wsadmin}/lib/rt_aix42.generic.printer \
    \
    .
    .
           ${wsadmin}/lib/alpha_dux40.AFS \
           ${wsadmin}/lib/hp_ux110.AFS \
           ${wsadmin}/lib/sun4x_56.AFS \
           ${wsadmin}/lib/rs_aix42.AFS

The LIBS Section

This section contains only one instruction, which indicates that LIBS is defined as the combination of MACHINE_LIBS and BASE_LIBS. Insert a blank line after the line to separate this section from the next.

   LIBS = ${MACHINE_LIBS} ${BASE_LIBS}

The .SUFFIXES Section

This section lists the valid machine-type suffixes. This list includes system types currently supported for AFS. Unused suffixes are ignored.

   .SUFFIXES: .rs_aix42 \
              .alpha_dux40 \
              .proto \
              .sun4x_56 \
              .i386_linux22 \
              .hp_ux110

The Makefile Instructions Section

The remainder of the Makefile file controls how the package program generates configuration files.

Study the following instructions; it is assumed that you are familiar with programming and Makefile concepts.

   #The following appear on a single line each in the actual file
   .proto.rs_aix42: ;  mpp -Dwsadmin=${wsadmin} -Dsys=rs_aix42  
                           -Dname=$* $*.proto > $@
   .proto.alpha_dux40: ; mpp -Dwsadmin=${wsadmin} -Dsys=alpha_dux40 
                           -Dname=$* $*.proto > $@
   .proto.sun4x_56:  ; mpp -Dwsadmin=${wsadmin} -Dsys=sun4x_56 
                           -Dname=$* $*.proto > $@
   .proto.hp_ux110:  ; mpp -Dwsadmin=${wsadmin} -Dsys=hp_ux110  
                           -Dname=$* $*.proto > $@
   all: ${CONFIG}
   ${CONFIG}: ${LIBS}
   system: install
   install: ${CONFIG}
           cp ${CONFIG} ${wsadmin}/etc
   clean:
           rm -f ${CONFIG} *.BAK *.CKP