Rational Developer for System z
PL/I for Windows, Version 7.6, Programming Guide

Linking from a make file

Use a make file to organize the sequence of actions (such as compiling and linking) required to build your project. You can then invoke all the actions in one step. The NMAKE utility saves you time by performing actions on only the files that have changed, and on the files that incorporate or depend on the changed files.

The following figure contains a basic make file example.

Figure 4. Make file example
#--------------------------------------------------------
#
#  fun.mak - sample makefile
#
#    Usage:  nmake fun.mak
#
#    The following commands are done only when needed:
#
#       - Compiles fun, text, table, care,
#                   xlib1, and xlib2
#       - Adds xlib1 and xlib2 to library xlib
#       - Links fun, text, table, care, and xlib
#          to build fun.exe
#
#    Each block is as follows:
#      <target>: <list of dependencies for target>
#           <action(s) required to build target>
#
#--------------------------------------------------------

OBJS = fun.obj text.obj table.obj care.obj
LIBS = xlib.lib

fun.exe: $(OBJS) $(LIBS)
  ilink /MAP:funlist $(OBJS) $(LIBS)

xlib.lib: xlib1.obj xlib2.obj
  ilib /OUT:xlib.lib xlib1.obj xlib2.obj
fun.obj:  fun.pli
  pli fun.pli

text.obj:  text.pli
  pli text.pli

table.obj:  table.pli
  pli table.pli

care.obj:  care.pli
  pli care.pli

xlib1.obj:  xlib1.pli
  pli xlib1.pli

xlib2.obj:  xlib2.pli
  pli xlib2.pli

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)