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.
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.
16 XCOMM $TOG: Motif.rules /main/8 1999/03/22 15:12:48 mgreess $
18 /* Note whether we are the top level project. */
19 #ifndef SeenTopLevelProject
20 # define SeenTopLevelProject YES
21 # define MotifIsTopLevelProject YES
23 # define MotifIsTopLevelProject NO
26 /* Include the X11 project rules file. */
30 /* Use the in-tree Motif by default. */
31 #ifndef UseInstalledMotif
32 # define UseInstalledMotif NO
35 # undef UseInstalledMotif
36 # define UseInstalledMotif YES
41 # define ImportMotif YES
43 # define ImportMotif NO
48 # define ImportMotif NO
51 #ifndef MSimpleProgramTarget
52 #define MSimpleProgramTarget(program) @@\
53 AllTarget(program) @@\
55 program: program.o $(DEPS) $(DEPLIBS) @@\
56 RemoveTargetProgram($@) @@\
57 $(CCLINK) -o $@ program.o $(LDOPTIONS) $(DEPS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
63 #ifndef MSimpleUilTarget
64 #define MSimpleUilTarget(program) @@\
65 MSimpleProgramTarget(program) @@\
67 InstallProgram(program,$(BINDIR)) @@\
69 MSimpleUidTarget(program)
73 * UILFLAGS contains site/vendor-specific flags
74 * defined by UilFlags, which supposed to be set in *.cf or
76 * LOCAL_UILFLAGS(_n) contains client-specific uil flags set in Imakefile
79 #ifndef MSimpleUidTarget
80 #define MSimpleUidTarget(program) @@\
81 AllTarget(program.uid) @@\
83 program.uid: program.uil $(DEPUIL) @@\
84 RemoveTargetProgram($@) @@\
85 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS) -o $@ program.uil $(UIL_INCLUDES) @@\
87 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
93 #ifndef MSimpleUidSubdirTarget
94 #define MSimpleUidSubdirTarget(program,subdir) @@\
95 AllTarget(subdir/program.uid) @@\
97 subdir/program.uid: subdir/program.uil $(DEPUIL) @@\
98 RemoveTargetProgram($@) @@\
99 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS) -o $@ subdir/program.uil $(UIL_INCLUDES) @@\
101 InstallNamedTarget(install,subdir/program.uid,$(INSTDATFLAGS),$(UIDDIR)/subdir,program.uid) @@\
104 $(RM) subdir/program.uid
107 #ifndef MSimpleUidLocaleTarget
108 #define MSimpleUidLocaleTarget(program,locale) @@\
109 AllTarget(program.uid) @@\
111 program.uid: program.uil $(DEPUIL) @@\
112 RemoveTargetProgram($@) @@\
113 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS) -o $@ program.uil $(UIL_INCLUDES) @@\
115 InstallNonExecFile(program.uid,$(LIBDIR)/locale/uid) @@\
121 #ifndef MComplexUidTarget_1
122 #define MComplexUidTarget_1(program) @@\
124 AllTarget(program.uid) @@\
126 program.uid: $(UILS1) $(DEPUIL) @@\
127 RemoveTargetProgram($@) @@\
128 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_1) -o $@ program.uil $(UIL_INCLUDES) @@\
130 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
136 #ifndef MComplexUidTarget_2
137 #define MComplexUidTarget_2(program) @@\
139 AllTarget(program.uid) @@\
141 program.uid: $(UILS2) $(DEPUIL) @@\
142 RemoveTargetProgram($@) @@\
143 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_2) -o $@ program.uil $(UIL_INCLUDES) @@\
145 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
151 #ifndef MComplexUidTarget_3
152 #define MComplexUidTarget_3(program) @@\
154 AllTarget(program.uid) @@\
156 program.uid: $(UILS3) $(DEPUIL) @@\
157 RemoveTargetProgram($@) @@\
158 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_3) -o $@ program.uil $(UIL_INCLUDES) @@\
160 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
166 #ifndef MComplexUidTarget_4
167 #define MComplexUidTarget_4(program) @@\
169 AllTarget(program.uid) @@\
171 program.uid: $(UILS4) $(DEPUIL) @@\
172 RemoveTargetProgram($@) @@\
173 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_4) -o $@ program.uil $(UIL_INCLUDES) @@\
175 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
181 #ifndef MComplexUidTarget_5
182 #define MComplexUidTarget_5(program) @@\
184 AllTarget(program.uid) @@\
186 program.uid: $(UILS5) $(DEPUIL) @@\
187 RemoveTargetProgram($@) @@\
188 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_5) -o $@ program.uil $(UIL_INCLUDES) @@\
190 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
196 #ifndef MComplexUidTarget_6
197 #define MComplexUidTarget_6(program) @@\
199 AllTarget(program.uid) @@\
201 program.uid: $(UILS6) $(DEPUIL) @@\
202 RemoveTargetProgram($@) @@\
203 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_6) -o $@ program.uil $(UIL_INCLUDES) @@\
205 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
211 #ifndef MComplexUidTarget_7
212 #define MComplexUidTarget_7(program) @@\
214 AllTarget(program.uid) @@\
216 program.uid: $(UILS7) $(DEPUIL) @@\
217 RemoveTargetProgram($@) @@\
218 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_7) -o $@ program.uil $(UIL_INCLUDES) @@\
220 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
226 #ifndef MComplexUidTarget_8
227 #define MComplexUidTarget_8(program) @@\
229 AllTarget(program.uid) @@\
231 program.uid: $(UILS8) $(DEPUIL) @@\
232 RemoveTargetProgram($@) @@\
233 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_8) -o $@ program.uil $(UIL_INCLUDES) @@\
235 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
241 #ifndef MComplexUidTarget_9
242 #define MComplexUidTarget_9(program) @@\
244 AllTarget(program.uid) @@\
246 program.uid: $(UILS9) $(DEPUIL) @@\
247 RemoveTargetProgram($@) @@\
248 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_9) -o $@ program.uil $(UIL_INCLUDES) @@\
250 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
256 #ifndef MComplexUidTarget_10
257 #define MComplexUidTarget_10(program) @@\
259 AllTarget(program.uid) @@\
261 program.uid: $(UILS10) $(DEPUIL) @@\
262 RemoveTargetProgram($@) @@\
263 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_10) -o $@ program.uil $(UIL_INCLUDES) @@\
265 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
271 #ifndef MComplexProgramTarget
272 #define MComplexProgramTarget(program,locallib,syslib) @@\
273 PROGRAM = program @@\
275 AllTarget(program) @@\
277 program: $(OBJS) $(DEPLIBS) @@\
278 RemoveTargetProgram($@) @@\
279 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
281 CenterProgramTarget(program,$(SRCS),$(OBJS),locallib,syslib) @@\
283 InstallProgram(program,$(BINDIR)) @@\
286 @echo To install documentation for $(PROGRAM), consult the Release Notes @@\
287 @echo and/or README file in the current directory. @@\
295 #ifndef MComplexProgramTarget_1
296 #define MComplexProgramTarget_1(program,locallib,syslib) @@\
297 OBJS = $(OBJS1) $(OBJS2) $(OBJS3) @@\
298 SRCS = $(SRCS1) $(SRCS2) $(SRCS3) @@\
300 AllTarget($(PROGRAMS)) @@\
302 program: $(OBJS1) $(DEPLIBS1) @@\
303 RemoveTargetProgram($@) @@\
304 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS1) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
306 CenterProgramTarget(program,$(SRCS1),$(OBJS1),locallib,syslib) @@\
308 InstallProgram(program,$(BINDIR)) @@\
311 @echo To install documentation for $(PROGRAMS), consult the Release Notes @@\
312 @echo and/or README file in the current directory. @@\
320 #ifndef MComplexProgramTarget_2
321 #define MComplexProgramTarget_2(program,locallib,syslib) @@\
322 program: $(OBJS2) $(DEPLIBS2) @@\
323 RemoveTargetProgram($@) @@\
324 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS2) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
326 CenterProgramTarget(program,$(SRCS2),$(OBJS2),locallib,syslib) @@\
328 InstallProgram(program,$(BINDIR))
331 #ifndef MComplexProgramTarget_3
332 #define MComplexProgramTarget_3(program,locallib,syslib) @@\
333 PROGRAM_3 = program @@\
334 program: $(OBJS3) $(DEPLIBS3) @@\
335 RemoveTargetProgram($@) @@\
336 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS3) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
338 CenterProgramTarget(program,$(SRCS3),$(OBJS3),locallib,syslib) @@\
340 InstallProgram(program,$(BINDIR))
343 #ifndef MComplexProgramTarget_4
344 #define MComplexProgramTarget_4(program,locallib,syslib) @@\
345 PROGRAM_4 = program @@\
346 program: $(OBJS4) $(DEPLIBS4) @@\
347 RemoveTargetProgram($@) @@\
348 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS4) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
350 CenterProgramTarget(program,$(SRCS4),$(OBJS4),locallib,syslib) @@\
352 InstallProgram(program,$(BINDIR))
355 #ifndef MComplexProgramTarget_5
356 #define MComplexProgramTarget_5(program,locallib,syslib) @@\
357 PROGRAM_5 = program @@\
358 program: $(OBJS5) $(DEPLIBS5) @@\
359 RemoveTargetProgram($@) @@\
360 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS5) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
362 CenterProgramTarget(program,$(SRCS5),$(OBJS5),locallib,syslib) @@\
364 InstallProgram(program,$(BINDIR))
367 #ifndef MComplexProgramTarget_6
368 #define MComplexProgramTarget_6(program,locallib,syslib) @@\
369 PROGRAM_6 = program @@\
370 program: $(OBJS6) $(DEPLIBS6) @@\
371 RemoveTargetProgram($@) @@\
372 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS6) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
374 CenterProgramTarget(program,$(SRCS6),$(OBJS6),locallib,syslib) @@\
376 InstallProgram(program,$(BINDIR))
379 #ifndef MComplexProgramTarget_7
380 #define MComplexProgramTarget_7(program,locallib,syslib) @@\
381 PROGRAM_7 = program @@\
382 program: $(OBJS7) $(DEPLIBS7) @@\
383 RemoveTargetProgram($@) @@\
384 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS7) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
386 CenterProgramTarget(program,$(SRCS7),$(OBJS7),locallib,syslib) @@\
388 InstallProgram(program,$(BINDIR))
391 #ifndef MComplexProgramTarget_8
392 #define MComplexProgramTarget_8(program,locallib,syslib) @@\
393 PROGRAM_8 = program @@\
394 program: $(OBJS8) $(DEPLIBS8) @@\
395 RemoveTargetProgram($@) @@\
396 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS8) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
398 CenterProgramTarget(program,$(SRCS8),$(OBJS8),locallib,syslib) @@\
400 InstallProgram(program,$(BINDIR))
403 #ifndef MComplexProgramTarget_9
404 #define MComplexProgramTarget_9(program,locallib,syslib) @@\
405 PROGRAM_9 = program @@\
406 program: $(OBJS9) $(DEPLIBS9) @@\
407 RemoveTargetProgram($@) @@\
408 $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS9) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
410 CenterProgramTarget(program,$(SRCS9),$(OBJS9),locallib,syslib) @@\
412 InstallProgram(program,$(BINDIR))
417 #define TestPPTarget(root) @@\
418 all:: root.Scr root.Dat @@\
420 root.Dat: root.dat @@\
422 $(COMMONPP) $(DEFINES) root.dat @@\
423 root.Scr: root.scr @@\
425 $(COMMONPP) $(DEFINES) root.scr
429 #define TestPPTarget(root) @@\
432 root.Dat: root.dat @@\
434 $(COMMONPP) $(DEFINES) root.dat
439 #ifndef TestPPTargetScr
440 #define TestPPTargetScr(root) @@\
443 root.Scr: root.scr @@\
445 $(COMMONPP) $(DEFINES) root.scr
448 #ifndef TestPPTargetScr
449 #define TestPPTargetScr(root) /**/
454 #ifndef TestPPTargetDat
455 #define TestPPTargetDat(root) @@\
458 root.Dat: root.dat @@\
460 $(COMMONPP) $(DEFINES) root.dat
464 #ifndef TestPPTargetDat
465 #define TestPPTargetDat(root) @@\
468 root.Dat: root.dat @@\
470 $(COMMONPP) $(DEFINES) root.dat
475 #ifndef NO_AUTOMATION
477 #define RunTarget() @@\
481 $(GENRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES) @@\
489 #define RunTarget() @@\
493 $(MANRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES) @@\
501 #define RunTarget() @@\
505 $(MANRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES) @@\
512 #define RunTarget() @@\
525 #define VistaMapRule(targetmap,depend) @@\
528 targetmap: depend @@\
529 $(RM) $(MTOP)/tests/Vista/targetmap @@\
530 CATCMD *.M > $(MTOP)/tests/Vista/targetmap
532 #ifndef ComplexVistaMapRule
533 #define ComplexVistaMapRule(program,filelist) @@\
536 program.M: filelist @@\
537 $(RM) program.vista.tmpfile @@\
538 touch program.vista.tmpfile @@\
539 @case '${MFLAGS}' in *[ik]*) set +e;; esac; @@\
540 @for i in filelist; do \ @@\
541 cat `basename $$i .o`.M >> program.vista.tmpfile ; done @@\
543 $(MV) program.vista.tmpfile program.M @@\
551 /* Rule for making shadow trees. */
552 #ifndef MakeShadowTree
553 #define MakeShadowTree(name,dirs) @@\
555 @case '${MFLAGS}' in *[ik]*) set +e;; esac; @@\
557 @for i in dirs; \ @@\
558 do if [ -d $$i/name ]; then \ @@\
559 exit 0; else set -x; mkdir $$i/name; fi \ @@\
561 @for i in dirs; \ @@\
562 do if [ -r name/$$i ]; then \ @@\
564 else (set -x; $(LN) ../$$i/name name/$$i); fi \@@\
573 * "CPlusPlusObjectCompile" - compile fragment for a normal C++ object file
575 #ifndef CPlusPlusObjectCompile
576 #define CPlusPlusObjectCompile(options) $(RM) $@ @@\
577 $(CXX) -c $(CXXFLAGS) options $*.cxx
580 #ifndef CPlusPlusObjectRule
581 #define CPlusPlusObjectRule() @@\
585 CPlusPlusObjectCompile($(_NOOP_))
586 #endif /* CPlusPlusObjectRule */
588 #ifndef MCPlusPlusSimpleProgramTarget
589 #define MCPlusPlusSimpleProgramTarget(program) @@\
590 AllTarget(program) @@\
592 program: program.o $(DEPS) $(DEPLIBS) @@\
593 RemoveTargetProgram($@) @@\
594 $(CXXLINK) -o $@ program.o $(CXXLDOPTIONS) $(DEPS) $(LOCAL_LIBRARIES) $(CXXLIBS) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
600 #ifndef MCPlusPlusComplexProgramTarget
601 #define MCPlusPlusComplexProgramTarget(program,locallib,syslib) @@\
602 PROGRAM = program @@\
604 AllTarget(program) @@\
606 program: $(OBJS) $(DEPLIBS) @@\
607 RemoveTargetProgram($@) @@\
608 $(CXXLINK) -o $@ $(CXXLDOPTIONS) $(OBJS) locallib $(CXXLIBS) $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
610 CenterProgramTarget(program,$(SRCS),$(OBJS),locallib,syslib) @@\
612 InstallProgram(program,$(BINDIR)) @@\
615 @echo To install documentation for $(PROGRAM), consult the Release Notes @@\
616 @echo and/or README file in the current directory. @@\
624 #endif /* BuildPlusPlus */
626 /* Rules for message catalog building */
627 #ifndef Real_MessageCatalogRule
628 #define Real_MessageCatalogRule(prefix) @@\
629 prefix.cat Concat(prefix,MsgCatI.h): @@\
630 $(RM) Concat(prefix,MsgCatI.h) prefix.cat $(MLOCSRC)/C/msg/prefix.msg @@\
631 $(MKCATTOOL) Concat(prefix,MsgCatI.h) prefix.msg > $(MLOCSRC)/C/msg/prefix.msg @@\
632 $(GENCAT) prefix.cat $(MLOCSRC)/C/msg/prefix.msg @@\
634 includes:: prefix.cat Concat(prefix,MsgCatI.h) @@\
636 depend:: prefix.cat Concat(prefix,MsgCatI.h) @@\
641 $(RM) prefix.cat Concat(prefix,MsgCatI.h)
643 #define Stub_MessageCatalogRule(prefix) /**/
646 /* The X BuildLibDir is now an import, not an export. */
647 #if UseImports || ImportX11
648 # ifndef XBuildLibDir
649 # define XBuildLibDir $(TOP)/imports/x11/lib
654 /* Search the Motif ProjectRoot too if it is different. */
655 #ifdef MotifProjectRoot
656 # define MUsrLibDirPath Concat(XUsrLibDirPath,:$(MPROJECTROOT)/lib)
658 # define MUsrLibDirPath XUsrLibDirPath
661 # undef UsrLibDirPath
663 #define UsrLibDirPath MUsrLibDirPath
666 # define MLdPreLibs -L$(MLIBSRC)
667 #elif defined(UseInstalledMotif) && defined(MotifProjectRoot)
668 # define MLdPreLibs -L$(MPROJECTROOT)/lib
670 # define MLdPreLibs /**/
675 #define LdPreLibs LdPreLib MLdPreLibs XLdPreLibs
680 #ifdef MotifProjectRoot
681 # define MLdPostLibs -L$(MPROJECTROOT)/lib
683 # define MLdPostLibs /**/
685 #define LdPostLibs LdPostLib MLdPostLibs XLdPostLibs
690 #define TopIncludes TopInclude $(TOP_MOTIF_INCLUDES) $(TOP_X_INCLUDES)
692 #if UseInstalledMotif && defined(MotifProjectRoot)
693 # define MotifBuildLibPath $(MPROJECTROOT)/lib
694 #elif UseInstalledMotif
695 # define MotifBuildLibPath $(USRLIBDIR)
697 # define MotifBuildLibPath $(MLIBSRC)
699 # define MotifBuildLibPath $(TOP)/exports/lib
704 #ifdef SystemBuildLibPath
705 # define BuildLibPath $(MOTIFENVLIBDIR):$(XENVLIBDIR):$(SYSTEMENVLIBDIR)
707 # define BuildLibPath $(MOTIFENVLIBDIR):$(XENVLIBDIR)
710 #ifndef MotifProjectDefines
711 # define MotifProjectDefines MotifDefines MessageCatalogDefines
713 #ifdef ProjectDefines
714 # undef ProjectDefines
716 #define ProjectDefines X11ProjectDefines MotifProjectDefines
718 #ifndef MotifCplusplusProjectDefines
719 # define MotifCplusplusProjectDefines MotifProjectDefines
721 #ifdef CplusplusProjectDefines
722 # undef CplusplusProjectDefines
724 #define CplusplusProjectDefines \
725 X11CplusplusProjectDefines MotifCplusplusProjectDefines