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

User Commands (c) c89(1)
3. The command
c89 -c /home/me/app/test1.c
compiles the source file /home/me/app/test1.c into the object file test1.o in the current
working directory.
4. The command
c89 -g -o test2 x.c y.c z.c
-Wnostdinc
-I/dev/product/app/src
-I/new/usr/include
-lclient -lserver
-L/dev/product/lib
-L/new/usr/lib
compiles the source files x.c, y.c, and z.c and links their respective object files x.o, y.o,
and z.o into the executable file test2. Symbolic information is generated by the compiler
and retained by the linker utility for debugging.
Included files are searched for in the directories /dev/product/app/src and
/new/usr/include; /usr/include is not searched. nld searches for the libraries
libclient.srl and libserver.srl in the directories /dev/product/lib and /new/usr/lib before
searching in the directories /G/system/sysnn, /lib, /usr/lib, and /usr/local/lib.
5. The command
c89 -g -o test2 x.c y.c z.c
-Wcall_shared
-Wnostdinc
-I/dev/product/app/src
-I/new/usr/include
-lclient -lserver
-L/dev/product/lib
-L/new/usr/lib
compiles the source files x.c, y.c, and z.c and links their respective object files x.o, y.o,
and z.o into the loadfile test2. Symbolic information is generated by the compiler and
retained by the linker utility for debugging.
Included files are searched for in the directories /dev/product/app/src and
/new/usr/include; /usr/include is not searched. ld searches for the libraries libclient.so
and libserver.so in the directories /dev/product/lib and /new/usr/lib before searching in
the directories /G/system/sysnn, /lib, /usr/lib, and /usr/local/lib.
6. The command
c89 -o test3 -O -DTYPE=3
-I/usr/friend
-I/usr/myself/headers
foo.c bar.o baz.c
compiles the source files foo.c and baz.c and links their respective object files with bar.o
into the object file test3.o. The preprocessor symbol TYPE is defined to 3, and full
optimization is performed by the compiler. The compiler looks for included files in the
directory /usr/friend, then in /usr/myself/headers, then in /usr/include.
527188-021 Hewlett-Packard Company 231