Before you begin: Rebuild an application after making a change to a single source file.
Perform the following steps to rebind a changed compile unit using c89:
c89 -o unit1.o -W c,"CSECT(myprog)" unit1.c
_______________________________________________________________
cp -m myprog myprog.old
c89 -o myprog unit1.o myprog
The cp command is optional. It saves a copy of the old executable in case the bind fails in such a way as to damage the executable. myprog is overwritten with the result of the bind of unit1.o. Like-named sections in unit1.o replace those in the myprog executable.
_______________________________________________________________
_C89_EXTRA_ARGS=1
.EXPORT : _C89_EXTRA_ARGS 1
SRCS = unit0.c unit1.c unit2.c 2
myprog.PRECIOUS : $(SRCS) 3
@if [ -e $@ ]; then OLD=$@; else OLD=; fi;\
CMD="$(CC) -Wc,csect $(CFLAGS) $(LDFLAGS) -o $@ $? $$OLD";\ 4
echo $$CMD; $$CMD;
-@rm -f $(?:b+"$O")
The attribute .PRECIOUS prevents such parts from being deleted if make fails. $? are the dependencies which are newer than the target.
For a complete description of all c89 options see c89 — Compiler invocation using host environment variables. For a description of make, see z/OS UNIX System Services Command Reference and for a make tutorial, see z/OS UNIX System Services Programming Tools.
Rebinds are fast because most of the program is already bound. Also, none of the intermediate object modules need to be retained because they are available from the program itself.