Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

make(1) OSS Shell and Utilities Reference Manual
over the -f and -p ags in this variable.
EXAMPLES
1. To compile, link, and run a TNS/R program using a non-PIC library and the les
mainstr.c, mystrng.c, and mystrng.h, use the following makele:
TOOLS = /G/SYSTEM/SYSTEM
CFLAGS = -Woptimize=0 -g -Werrors=5 -Wextensions \
-I /G/SYSTEM/ZSYSDEFS -I ${TOOLS} -c
LDFLAGS = -obey /G/SYSTEM/SYSTEM/libcobey -L .
all: revstr
revstr : mainstr.o mystrng.o
nld -o $@ ${LDFLAGS} mainstr.o mystrng.o \
${TOOLS}/crtlmain
mainstr.o : mainstr.c
c89 -o $@ $? ${CFLAGS}
mystrng.c : mystrng.h
touch mystrng.c
mystrng.o : mystrng.c
c89 -o $@ $? ${CFLAGS}
clean:
rm *.o revstr *.dll
run: revstr
./revstr abc 45678
2. To compile, link, and run a TNS/R program using a PIC DLL and the les mainstr.c,
mystrng.c, and mystrng.h, use the following makele:
TOOLS = /G/SYSTEM/SYSTEM
CFLAGS_NON_PIC = -Woptimize=0 -g -Werrors=5 -Wextensions \
-I /G/SYSTEM/ZSYSDEFS -I ${TOOLS} -c
CFLAGS= ${CFLAGS_NON_PIC} -Wcall_shared
LDFLAGS = -obey /G/SYSTEM/SYSTEM/libcobey -L .
LDFLAGS_DLL = ${LDFLAGS} -shared
all: revstr
revstr : mainstr.o mystrng.dll
ld -o $@ ${LDFLAGS} mainstr.o -l mystrng.dll \
${TOOLS}/ccppmain
mainstr.o : mainstr.c
c89 -o $@ $? ${CFLAGS}
mystrng.c : mystrng.h
touch mystrng.c
mystrng.dll : mystrng.o
ld -o $@ ${LDFLAGS_DLL} mystrng.o \
-export MyStr_Version -export StrRev
mystrng.o : mystrng.c
c89 -o $@ $? ${CFLAGS}
clean:
rm *.o revstr *.dll
run: revstr
./revstr abc 45678
68 Hewlett-Packard Company 527188-007