Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

User Commands (m - o) make(1)
3. To compile, link, and run a TNS/R program using different DLLs and the files mainstr.c,
mystrng.c, and mystrng.h, use the following makefile:
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: mystrng.dll
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
unset _RLD_FIRST_LIB_PATH
run: revstr
export _RLD_FIRST_LIB_PATH=/home/les/dll3; \
../dll2/revstr abc 45678
4. To compile, link, and run a TNS/R program that dynamically adds a DLL and uses the
files hello.c, main.c, and hello.h, use the following makefile:
TOOLS = /G/SYSTEM/SYSTEM
CFLAGS_NON_PIC = -Woptimize=0 -g -Werrors=5 -Wextensions \
-I /G/SYSTEM/ZSYSDEFS -I ${TOOLS}
CFLAGS= ${CFLAGS_NON_PIC} -Wcall_shared
LDFLAGS = -obey /G/SYSTEM/SYSTEM/libcobey -L .
LDFLAGS_DLL = ${LDFLAGS} -shared
all: main.exe hello.dll
main.exe: main.c
c89 -o $@ $? ${CFLAGS} -l zrldsrl
hello.dll : hello.o
ld -o $@ ${LDFLAGS_DLL} hello.o -export hello
hello.o : hello.c
c89 -o $@ $? ${CFLAGS} -c
clean:
rm *.o revstr *.dll
5. To compile, link, and run a TNS/R program that dynamically adds a DLL, uses the qsort
utility, and uses the files sort.c, main.c, and sort.h, use the following makefile:
TOOLS = /G/SYSTEM/SYSTEM
CFLAGS_NON_PIC = -Woptimize=0 -g -Werrors=5 -Wextensions \
-I /G/SYSTEM/ZSYSDEFS -I ${TOOLS}
CFLAGS= ${CFLAGS_NON_PIC} -Wcall_shared
LDFLAGS = -obey /G/SYSTEM/SYSTEM/libcobey -L .
LDFLAGS_DLL = ${LDFLAGS} -shared
all: main.exe sort.dll
527188-021 Hewlett-Packard Company 69