1/*
2 *  @OSF_COPYRIGHT@
3 *  COPYRIGHT NOTICE
4 *  Copyright (c) 1990, 1991, 1992, 1993, 1998 The Open Group, Inc.
5 *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
6 *  the full copyright text.
7 *
8 * (c) Copyright 1996 Digital Equipment Corporation.
9 * (c) Copyright 1996 Hewlett-Packard Company.
10 * (c) Copyright 1996 International Business Machines Corp.
11 * (c) Copyright 1996 Sun Microsystems, Inc.
12 * (c) Copyright 1996 Novell, Inc.
13 * (c) Copyright 1996 FUJITSU LIMITED.
14 * (c) Copyright 1996 Hitachi.
15 */
16XCOMM $Xorg: Motif.tmpl,v 1.3 2000/08/17 19:41:46 cpqbld Exp $
17
18/* Include the X11 project template file. */
19#include <X11.tmpl>
20
21#ifdef AUTOMATION
22# ifndef Automation
23#  define Automation 	YES
24# endif
25#else
26# define NO_AUTOMATION
27#endif
28
29#ifdef USE_VISTACC
30# ifndef UseVista
31#  define UseVista
32# endif
33# ifndef CATCMD
34#  define CATCMD cat
35# endif
36#endif
37
38#ifdef USE_PURIFY
39# ifndef UsePurify
40#  define UsePurify
41# endif
42#endif
43
44#ifdef DEBUG_GEOMETRY
45# ifndef DebugGeometry
46#  define DebugGeometry YES
47# endif
48#endif
49
50
51#ifndef _MUse
52# if UseInstalledMotif
53#  define _MUse(a,b) a
54# else
55#  define _MUse(a,b) b
56# endif
57#endif
58
59#ifndef _MUseCat
60# if (defined(__STDC__) && !defined(UnixCpp)) || defined(AnsiCpp)
61#  if UseInstalledMotif
62#   define _MUseCat(a,b,c) a##c
63#  else
64#   define _MUseCat(a,b,c) b##c
65#  endif
66# else
67#  if UseInstalledMotif
68#   define _MUseCat(a,b,c) a/**/c
69#  else
70#   define _MUseCat(a,b,c) b/**/c
71#  endif
72# endif
73#endif
74
75#ifndef MTop
76# if ImportMotif
77#  define MTop $(TOP)/imports/motif
78# else
79#  define MTop $(TOP)
80# endif
81#endif
82
83#ifndef BuildDocDir
84# define BuildDocDir $(BUILDINCROOT)/doc
85#endif
86#ifndef BuildLocDir
87# define BuildLocDir $(BUILDINCROOT)/localized
88#endif
89
90#ifndef MotifDefines
91# define MotifDefines /**/
92#endif
93
94#ifndef XmDefines
95# define XmDefines  /**/
96#endif
97
98/* To compile without SHAPE extension, set this to -DNO_SHAPE */
99#ifndef MwmDefines
100# define MwmDefines /**/
101#endif
102
103#ifndef UilFlags
104# define UilFlags /**/
105#endif
106
107#ifndef TestDefines
108# define TestDefines /**/
109#endif
110
111#ifndef AutoDefines
112# if Automation
113#  define AutoDefines -DAUTOMATION
114# else
115#  define AutoDefines /**/
116# endif
117#endif
118
119#ifndef AutoIncludes
120# if Automation
121#  define AutoIncludes -I$(AUTOSCRIPTSRC)
122# else
123#  define AutoIncludes /**/
124# endif
125#endif
126
127#ifdef UsePurify
128# define PurifyFilesToClean *.pure_linkinfo *.pure_hardlink
129#else
130# define PurifyFilesToClean
131#endif
132#if Automation
133# define TestExtraFilesToClean *.Dat *.Scr PurifyFilesToClean
134#else
135# define TestExtraFilesToClean *.Dat PurifyFilesToClean
136#endif
137
138#ifndef UsrIncDir
139# define UsrIncDir IncRoot
140#endif
141
142/* Place to install .uid files */
143#ifndef UidDir
144# define UidDir $(LIBDIR)/uid
145#endif
146
147#ifndef XmExtraLibraries
148# define XmExtraLibraries /**/
149#endif
150
151#ifndef YaccFlags
152# define YaccFlags /**/
153#endif
154
155#define MotifSharedRev		2.1
156
157#ifndef SharedLibXm
158# define SharedLibXm		HasSharedLibraries
159#endif
160#ifndef NormalLibXm
161# define NormalLibXm		(!SharedLibXm | ForceNormalLib)
162#endif
163#ifndef DebugLibXm
164# define DebugLibXm		NO
165#endif
166#ifndef ProfileLibXm
167# define ProfileLibXm		NO
168#endif
169#ifndef SharedXmRev
170# define SharedXmRev		MotifSharedRev
171#endif
172
173#ifndef SharedLibMrm
174# define SharedLibMrm		HasSharedLibraries
175#endif
176#ifndef NormalLibMrm
177# define NormalLibMrm		(!SharedLibMrm | ForceNormalLib)
178#endif
179#ifndef DebugLibMrm
180# define DebugLibMrm		NO
181#endif
182#ifndef ProfileLibMrm
183# define ProfileLibMrm		NO
184#endif
185#ifndef SharedMrmRev
186# define SharedMrmRev		MotifSharedRev
187#endif
188
189#ifndef SharedLibUil
190# define SharedLibUil		HasSharedLibraries
191#endif
192#ifndef NormalLibUil
193# define NormalLibUil		(!SharedLibUil | ForceNormalLib)
194#endif
195#ifndef DebugLibUil
196# define DebugLibUil		NO
197#endif
198#ifndef ProfileLibUil
199# define ProfileLibUil		NO
200#endif
201#ifndef SharedUilRev
202# define SharedUilRev		MotifSharedRev
203#endif
204
205#ifndef SharedLibACommon
206# define SharedLibACommon	HasSharedLibraries
207#endif
208#ifndef NormalLibACommon
209# define NormalLibACommon	(!SharedLibACommon | ForceNormalLib)
210#endif
211#ifndef DebugLibACommon
212# define DebugLibACommon	NO
213#endif
214#ifndef ProfileLibACommon
215# define ProfileLibACommon	NO
216#endif
217#ifndef SharedACommonRev
218# define SharedACommonRev	MotifSharedRev
219#endif
220
221#ifndef SharedLibScript
222# define SharedLibScript	HasSharedLibraries
223#endif
224#ifndef NormalLibScript
225# define NormalLibScript	(!SharedLibScript | ForceNormalLib)
226#endif
227#ifndef DebugLibScript
228# define DebugLibScript		NO
229#endif
230#ifndef ProfileLibScript
231# define ProfileLibScript	NO
232#endif
233#ifndef SharedScriptRev
234# define SharedScriptRev	MotifSharedRev
235#endif
236
237#ifndef SharedLibUtil
238# define SharedLibUtil		HasSharedLibraries
239#endif
240#ifndef NormalLibUtil
241# define NormalLibUtil		(!SharedLibUtil | ForceNormalLib)
242#endif
243#ifndef DebugLibUtil
244# define DebugLibUtil		NO
245#endif
246#ifndef ProfileLibUtil
247# define ProfileLibUtil		NO
248#endif
249#ifndef SharedUtilRev
250# define SharedUtilRev		MotifSharedRev
251#endif
252
253#ifndef SharedLibCreate
254# define SharedLibCreate	HasSharedLibraries
255#endif
256#ifndef NormalLibCreate
257# define NormalLibCreate	(!SharedLibCreate | ForceNormalLib)
258#endif
259#ifndef DebugLibCreate
260# define DebugLibCreate		NO
261#endif
262#ifndef ProfileLibCreate
263# define ProfileLibCreate	NO
264#endif
265#ifndef SharedCreateRev
266# define SharedCreateRev	MotifSharedRev
267#endif
268
269#ifndef SharedLibVisual
270# define SharedLibVisual	HasSharedLibraries
271#endif
272#ifndef NormalLibVisual
273# define NormalLibVisual	(!SharedLibVisual | ForceNormalLib)
274#endif
275#ifndef DebugLibVisual
276# define DebugLibVisual		NO
277#endif
278#ifndef ProfileLibVisual
279# define ProfileLibVisual	NO
280#endif
281#ifndef SharedVisualRev
282# define SharedVisualRev	MotifSharedRev
283#endif
284
285#ifndef SharedLibSynth
286# define SharedLibSynth		HasSharedLibraries
287#endif
288#ifndef NormalLibSynth
289# define NormalLibSynth		(!SharedLibSynth | ForceNormalLib)
290#endif
291#ifndef DebugLibSynth
292# define DebugLibSynth		NO
293#endif
294#ifndef ProfileLibSynth
295# define ProfileLibSynth	NO
296#endif
297#ifndef SharedSynthRev
298# define SharedSynthRev		MotifSharedRev
299#endif
300
301#ifndef SharedLibMCommon
302# define SharedLibMCommon	HasSharedLibraries
303#endif
304#ifndef NormalLibMCommon
305# define NormalLibMCommon	(!SharedLibMCommon | ForceNormalLib)
306#endif
307#ifndef DebugLibMCommon
308# define DebugLibMCommon	NO
309#endif
310#ifndef ProfileLibMCommon
311# define ProfileLibMCommon	NO
312#endif
313#ifndef SharedMCommonRev
314# define SharedMCommonRev	MotifSharedRev
315#endif
316
317#ifndef XmClientLibs
318# define XmClientLibs $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(XMEXTRA_LIBS)
319#endif
320#ifndef XmClientDepLibs
321# define XmClientDepLibs $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
322#endif
323
324#ifndef MrmClientLibs
325# define MrmClientLibs $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(XMEXTRA_LIBS)
326#endif
327#ifndef MrmClientDepLibs
328# define MrmClientDepLibs $(DEPMRESOURCELIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
329#endif
330
331#ifndef UilClientLibs
332# define UilClientLibs $(UILLIB) $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(XMEXTRA_LIBS)
333#endif
334#ifndef UilClientDepLibs
335# define UilClientDepLibs $(DEPUILLIB) $(DEPMRESOURCELIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
336#endif
337
338#ifndef TestClientLibs
339# define TestClientLibs $(PURIFYLIBS) $(TESTCOMLIB) \
340		$(AUTOSCRIPTLIB) $(AUTOUTILLIB) \
341		$(AUTOCREATELIB) $(AUTOVISUALLIB) $(AUTOSYNTHLIB) \
342	$(XMLIB) $(TESTGEOLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) \
343	$(AUTOEXTRALIBS) $(XMEXTRA_LIBS)
344#endif
345#ifndef TestUilClientLibs
346# define TestUilClientLibs $(PURIFYLIBS) $(TESTUILCOMLIB) $(TESTCOMLIB) \
347		$(AUTOSCRIPTLIB) $(AUTOUTILLIB) \
348		$(AUTOCREATELIB) $(AUTOVISUALLIB) $(AUTOSYNTHLIB) \
349	$(UILLIB) $(MRESOURCELIB) $(XMLIB) $(TESTGEOLIB) \
350	$(XTOOLLIB) $(XPLIB) $(XLIB) $(AUTOEXTRALIBS) $(XMEXTRA_LIBS)
351#endif
352#ifndef TestClientDepLibs
353# define TestClientDepLibs XmClientDepLibs
354#endif
355#ifndef TestUilClientDepLibs
356# define TestUilClientDepLibs UilClientDepLibs
357#endif
358
359/* hardcoded default path.  Contrary to the original duplicate of USRLIBDIR
360   in the Imakefiles. */
361#ifndef VirtualBindingsPath
362# define VirtualBindingsPath /usr/lib/Xm/bindings
363#endif
364
365              MTOP = MTop
366TOP_MOTIF_INCLUDES = -I$(MINCLUDESRC)
367#if defined(UseInstalled) || (UseInstalledMotif && UseInstalledX11)
368      UIL_INCLUDES = -I$(USRINCDIR)/uil
369#else
370      UIL_INCLUDES = -I$(UILSRC)
371#endif
372#ifdef BuildLibPathVar
373    MOTIFENVLIBDIR = MotifBuildLibPath
374#endif
375
376/* Message catalog usage */
377#ifndef GencatCmd
378# define GencatCmd		gencat
379#endif
380#ifndef GencatFlags
381# define GencatFlags		/**/
382#endif
383#if defined(NoMessageCatalog)
384# define BuildMessageCatalog	NO
385# define MessageCatalogDefines	-DNO_MESSAGE_CATALOG
386#else
387# define BuildMessageCatalog	YES
388# define MessageCatalogDefines	/**/
389#endif
390#ifndef MessageCatalogRule
391# if BuildMessageCatalog
392#  define MessageCatalogRule(prefix)	Real_MessageCatalogRule(prefix)
393# else
394#  define MessageCatalogRule(prefix)	Stub_MessageCatalogRule(prefix)
395# endif
396#endif
397
398      USRINCDIR = UsrIncDir
399         UIDDIR = UidDir
400        TESTSRC = $(MTOP)/tests
401        TESTLIB = $(TESTSRC)/lib
402  GENERALSRCLIB = $(TESTSRC)/General/lib
403  GENERALSRCBIN = $(TESTSRC)/General/bin
404   MANUALSRCLIB = $(TESTSRC)/Manual/lib
405   MANUALSRCBIN = $(TESTSRC)/Manual/bin
406     AUTOSRCLIB = $(TESTSRC)/Auto/lib
407     AUTOSRCBIN = $(TESTSRC)/Auto/bin
408       COMMONPP = $(GENERALSRCBIN)/Commonpp
409         GENRUN = $(GENERALSRCBIN)/Genrun
410         MANRUN = $(GENERALSRCBIN)/Manrun
411#ifdef DebugLib
412  TESTMALLOCSRC = $(GENERALSRCLIB)/Malloc
413#endif
414#ifdef DebugGeometry
415     TESTGEOSRC = $(TESTLIB)/Geometry
416#endif
417#ifdef Automation
418     TESTCOMSRC = $(AUTOSRCLIB)/Common
419  AUTOSCRIPTSRC = $(AUTOSRCLIB)/Script
420   AUTOSYNTHSRC = $(AUTOSRCLIB)/Synth
421  AUTOCREATESRC = $(AUTOSRCLIB)/Create
422  AUTOVISUALSRC = $(AUTOSRCLIB)/Visual
423    AUTOUTILSRC = $(AUTOSRCLIB)/Util
424  AUTOEXTRALIBS = -ll -ly -lm
425#else
426     TESTCOMSRC = $(MANUALSRCLIB)/Common
427#endif
428
429    BUILDDOCDIR = BuildDocDir
430    BUILDLOCDIR = BuildLocDir
431
432/* MTOOLKITSRC  should be removed */
433    MTOOLKITSRC = $(TOOLKITSRC)
434#if ImportMotif || UseInstalledMotif
435    MINCLUDESRC = $(MTOP)/include
436        MDOCSRC = $(MTOP)/doc
437        MLOCSRC = $(MTOP)/localized
438#else
439    MINCLUDESRC = $(MTOP)/exports/include
440        MLOCSRC = $(MTOP)/exports/localized
441#endif
442        MLIBSRC = $(MTOP)/lib
443     MCLIENTSRC = $(MTOP)/clients
444       MDEMOSRC = $(MTOP)/demos
445     MWIDGETSRC = $(MLIBSRC)/Xm
446   MRESOURCESRC = $(MLIBSRC)/Mrm
447         UILSRC = $(MCLIENTSRC)/uil
448#ifdef MotifProjectRoot
449   MPROJECTROOT = MotifProjectRoot
450#endif
451
452            UIL = _MUse(uil,$(UILSRC)/uil)
453         DEPUIL = _MUseCat($(BINDIR),$(UILSRC),/uil)
454
455   XMEXTRA_LIBS = XmExtraLibraries
456
457/* These libraries use UseInstalledMotif instead of UseInstalled. */
458#undef _Use
459#undef _UseCat
460#define _Use    _MUse
461#define _UseCat _MUseCat
462
463#ifndef MBuildLibDir
464# define MBuildLibDir	BuildLibDir
465#endif
466
467#if SharedLibXm
468SharedLibReferences(XM,Xm,$(MWIDGETSRC),SOXMREV,SharedXmRev)
469#else
470ProjectUnsharedLibReferences(XM,Xm,$(MWIDGETSRC),MBuildLibDir)
471#endif
472
473#if SharedLibMrm
474SharedLibReferences(MRESOURCE,Mrm,$(MRESOURCESRC),SOMRMREV,SharedMrmRev)
475#else
476ProjectUnsharedLibReferences(MRESOURCE,Mrm,$(MRESOURCESRC),MBuildLibDir)
477#endif
478
479#if SharedLibUil
480SharedLibReferences(UIL,Uil,$(UILSRC),SOUILREV,SharedUilRev)
481#else
482ProjectUnsharedLibReferences(UIL,Uil,$(UILSRC),MBuildLibDir)
483#endif
484
485#ifdef DebugGeometry
486ProjectUnsharedLibReferences(TESTGEO,XtGeo,$(TESTGEOSRC),MBuildLibDir)
487#endif
488
489#if Automation
490
491# if SharedLibACommon
492SharedLibReferences(TESTCOM,ACommon,$(TESTCOMSRC),SOACOMMONREV,SharedACommonRev)
493# else
494ProjectUnsharedLibReferences(TESTCOM,ACommon,$(TESTCOMSRC),MBuildLibDir)
495# endif
496
497TESTUILCOMLIB = $(TESTCOMSRC)/libACommonUil.a
498
499# if SharedLibScript
500SharedLibReferences(AUTOSCRIPT,Script,$(AUTOSCRIPTSRC),SOSCRIPTREV,SharedScriptRev)
501# else
502ProjectUnsharedLibReferences(AUTOSCRIPT,Script,$(AUTOSCRIPTSRC),MBuildLibDir)
503# endif
504
505# if SharedLibSynth
506SharedLibReferences(AUTOSYNTH,Synth,$(AUTOSYNTHSRC),SOSYNTHREV,SharedSynthRev)
507# else
508ProjectUnsharedLibReferences(AUTOSYNTH,Synth,$(AUTOSYNTHSRC),MBuildLibDir)
509# endif
510
511# if SharedLibCreate
512SharedLibReferences(AUTOCREATE,Create,$(AUTOCREATESRC),SOCREATEREV,SharedCreateRev)
513# else
514ProjectUnsharedLibReferences(AUTOCREATE,Create,$(AUTOCREATESRC),MBuildLibDir)
515# endif
516
517# if SharedLibVisual
518SharedLibReferences(AUTOVISUAL,Visual,$(AUTOVISUALSRC),SOVISUALREV,SharedVisualRev)
519# else
520ProjectUnsharedLibReferences(AUTOVISUAL,Visual,$(AUTOVISUALSRC),MBuildLibDir)
521# endif
522
523# if SharedLibUtil
524SharedLibReferences(AUTOUTIL,Util,$(AUTOUTILSRC),SOUTILREV,SharedUtilRev)
525# else
526ProjectUnsharedLibReferences(AUTOUTIL,Util,$(AUTOUTILSRC),MBuildLibDir)
527# endif
528
529#else   /* Manual */
530
531# if SharedLibMCommon
532SharedLibReferences(TESTCOM,MCommon,$(TESTCOMSRC),SOMCOMMONREV,SharedMCommonRev)
533# else
534ProjectUnsharedLibReferences(TESTCOM,MCommon,$(TESTCOMSRC),MBuildLibDir)
535# endif
536TESTUILCOMLIB = $(TESTCOMSRC)/libMCommonUil.a
537
538#endif  /* Automation */
539
540
541/* Revert to the normal library rules. */
542#undef _Use
543#undef _UseCat
544#define _Use    _XUse
545#define _UseCat _XUseCat
546
547
548#ifdef UsePurify
549     PURIFYLIBS = $(PURIFYHOME)/purify_stubs.a
550#endif
551  LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
552LINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
553     LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
554     LINTUILLIB = $(UILSRC)/llib-lUil.ln
555
556      YACCFLAGS = YaccFlags
557       UILFLAGS = UilFlags
558    GENCATFLAGS = GencatFlags
559         GENCAT = GencatCmd $(GENCATFLAGS)
560      MKCATTOOL = $(MLOCSRC)/util/mkcatdefs
561
562         RM_CMD = $(RM) FilesToClean ExtraFilesToClean TestExtraFilesToClean
563
564#if NeedDefaultDepLibs
565# if HasSharedLibraries || defined(UseInstalled)
566        DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
567# else
568        DEPLIBS = $(LOCAL_LIBRARIES)
569# endif
570        DEPLIBS1 = $(DEPLIBS)
571        DEPLIBS2 = $(DEPLIBS)
572        DEPLIBS3 = $(DEPLIBS)
573#endif /* NeedDefaultDepLibs */
574