Common Desktop Environment: Programmer's Overview

Makefiles

Certain libraries that the Common Desktop Environment depends on, for example X11R6, are likely to be installed in different locations on different platforms. Include platform-specific references to accommodate this or write a separate makefile for each platform.

Also, the make program functionality can differ across platforms. If you want to write just one makefile for your application, use the common make functionality used by the platforms to which you want to port your program. Avoid platform-specific make features.

The Common Desktop Environment requires no additional defined constants (-D parameters) to integrate with the desktop. If you do follow a standard, such as POSIX, you might need to compile with additional standard-specific flags. Read about the standard to find out if it includes special compiler considerations.

Each subdirectory of /usr/dt/examples contains sample makefile source files for different platforms. These makefiles take into account system differences. In particular, see the /usr/dt/examples/dtdts directory for generic examples of makefiles.

Compile Options

To enable your application to find the desktop include files, add:

-I/usr/dt/include

to each makefile's compile line.

Link Options

To enable your application to reference desktop libraries, add:

-L/usr/dt/lib

-l<libname1>

-l<libname2>...

to each makefile's link line, where libname1, libname2 are the names of libraries your application needs to reference. You can include as many desktop library names in this line as you want. For example:

-L/usr/dt/lib -lDtSvc

-ltt -lXm

enables your application to reference the Desktop Services, ToolTalk Messaging System, and Motif 1.2 libraries.