4 * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, 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/3 1997/03/24 09:10:35 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 $(CC) -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 MSimpleUidLocaleTarget
94 #define MSimpleUidLocaleTarget(program,locale) @@\
95 AllTarget(program.uid) @@\
97 program.uid: program.uil $(DEPUIL) @@\
98 RemoveTargetProgram($@) @@\
99 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS) -o $@ program.uil $(UIL_INCLUDES) @@\
101 InstallNonExecFile(program.uid,$(LIBDIR)/locale/uid) @@\
107 #ifndef MComplexUidTarget_1
108 #define MComplexUidTarget_1(program) @@\
110 AllTarget(program.uid) @@\
112 program.uid: $(UILS1) $(DEPUIL) @@\
113 RemoveTargetProgram($@) @@\
114 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_1) -o $@ program.uil $(UIL_INCLUDES) @@\
116 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
122 #ifndef MComplexUidTarget_2
123 #define MComplexUidTarget_2(program) @@\
125 AllTarget(program.uid) @@\
127 program.uid: $(UILS2) $(DEPUIL) @@\
128 RemoveTargetProgram($@) @@\
129 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_2) -o $@ program.uil $(UIL_INCLUDES) @@\
131 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
137 #ifndef MComplexUidTarget_3
138 #define MComplexUidTarget_3(program) @@\
140 AllTarget(program.uid) @@\
142 program.uid: $(UILS3) $(DEPUIL) @@\
143 RemoveTargetProgram($@) @@\
144 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_3) -o $@ program.uil $(UIL_INCLUDES) @@\
146 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
152 #ifndef MComplexUidTarget_4
153 #define MComplexUidTarget_4(program) @@\
155 AllTarget(program.uid) @@\
157 program.uid: $(UILS4) $(DEPUIL) @@\
158 RemoveTargetProgram($@) @@\
159 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_4) -o $@ program.uil $(UIL_INCLUDES) @@\
161 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
167 #ifndef MComplexUidTarget_5
168 #define MComplexUidTarget_5(program) @@\
170 AllTarget(program.uid) @@\
172 program.uid: $(UILS5) $(DEPUIL) @@\
173 RemoveTargetProgram($@) @@\
174 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_5) -o $@ program.uil $(UIL_INCLUDES) @@\
176 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
182 #ifndef MComplexUidTarget_6
183 #define MComplexUidTarget_6(program) @@\
185 AllTarget(program.uid) @@\
187 program.uid: $(UILS6) $(DEPUIL) @@\
188 RemoveTargetProgram($@) @@\
189 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_6) -o $@ program.uil $(UIL_INCLUDES) @@\
191 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
197 #ifndef MComplexUidTarget_7
198 #define MComplexUidTarget_7(program) @@\
200 AllTarget(program.uid) @@\
202 program.uid: $(UILS7) $(DEPUIL) @@\
203 RemoveTargetProgram($@) @@\
204 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_7) -o $@ program.uil $(UIL_INCLUDES) @@\
206 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
212 #ifndef MComplexUidTarget_8
213 #define MComplexUidTarget_8(program) @@\
215 AllTarget(program.uid) @@\
217 program.uid: $(UILS8) $(DEPUIL) @@\
218 RemoveTargetProgram($@) @@\
219 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_8) -o $@ program.uil $(UIL_INCLUDES) @@\
221 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
227 #ifndef MComplexUidTarget_9
228 #define MComplexUidTarget_9(program) @@\
230 AllTarget(program.uid) @@\
232 program.uid: $(UILS9) $(DEPUIL) @@\
233 RemoveTargetProgram($@) @@\
234 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_9) -o $@ program.uil $(UIL_INCLUDES) @@\
236 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
242 #ifndef MComplexUidTarget_10
243 #define MComplexUidTarget_10(program) @@\
245 AllTarget(program.uid) @@\
247 program.uid: $(UILS10) $(DEPUIL) @@\
248 RemoveTargetProgram($@) @@\
249 $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_10) -o $@ program.uil $(UIL_INCLUDES) @@\
251 InstallNonExecFile(program.uid,$(UIDDIR)) @@\
257 #ifndef MComplexProgramTarget
258 #define MComplexProgramTarget(program,locallib,syslib) @@\
259 PROGRAM = program @@\
261 AllTarget(program) @@\
263 program: $(OBJS) $(DEPLIBS) @@\
264 RemoveTargetProgram($@) @@\
265 $(CC) -o $@ $(LDOPTIONS) $(OBJS) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
267 CenterProgramTarget(program,$(SRCS),$(OBJS),locallib,syslib) @@\
269 InstallProgram(program,$(BINDIR)) @@\
272 @echo To install documentation for $(PROGRAM), consult the Release Notes @@\
273 @echo and/or README file in the current directory. @@\
281 #ifndef MComplexProgramTarget_1
282 #define MComplexProgramTarget_1(program,locallib,syslib) @@\
283 OBJS = $(OBJS1) $(OBJS2) $(OBJS3) @@\
284 SRCS = $(SRCS1) $(SRCS2) $(SRCS3) @@\
286 AllTarget($(PROGRAMS)) @@\
288 program: $(OBJS1) $(DEPLIBS1) @@\
289 RemoveTargetProgram($@) @@\
290 $(CC) -o $@ $(LDOPTIONS) $(OBJS1) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
292 CenterProgramTarget(program,$(SRCS1),$(OBJS1),locallib,syslib) @@\
294 InstallProgram(program,$(BINDIR)) @@\
297 @echo To install documentation for $(PROGRAMS), consult the Release Notes @@\
298 @echo and/or README file in the current directory. @@\
306 #ifndef MComplexProgramTarget_2
307 #define MComplexProgramTarget_2(program,locallib,syslib) @@\
308 program: $(OBJS2) $(DEPLIBS2) @@\
309 RemoveTargetProgram($@) @@\
310 $(CC) -o $@ $(LDOPTIONS) $(OBJS2) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
312 CenterProgramTarget(program,$(SRCS2),$(OBJS2),locallib,syslib) @@\
314 InstallProgram(program,$(BINDIR))
317 #ifndef MComplexProgramTarget_3
318 #define MComplexProgramTarget_3(program,locallib,syslib) @@\
319 PROGRAM_3 = program @@\
320 program: $(OBJS3) $(DEPLIBS3) @@\
321 RemoveTargetProgram($@) @@\
322 $(CC) -o $@ $(LDOPTIONS) $(OBJS3) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
324 CenterProgramTarget(program,$(SRCS3),$(OBJS3),locallib,syslib) @@\
326 InstallProgram(program,$(BINDIR))
329 #ifndef MComplexProgramTarget_4
330 #define MComplexProgramTarget_4(program,locallib,syslib) @@\
331 PROGRAM_4 = program @@\
332 program: $(OBJS4) $(DEPLIBS4) @@\
333 RemoveTargetProgram($@) @@\
334 $(CC) -o $@ $(LDOPTIONS) $(OBJS4) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
336 CenterProgramTarget(program,$(SRCS4),$(OBJS4),locallib,syslib) @@\
338 InstallProgram(program,$(BINDIR))
341 #ifndef MComplexProgramTarget_5
342 #define MComplexProgramTarget_5(program,locallib,syslib) @@\
343 PROGRAM_5 = program @@\
344 program: $(OBJS5) $(DEPLIBS5) @@\
345 RemoveTargetProgram($@) @@\
346 $(CC) -o $@ $(LDOPTIONS) $(OBJS5) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
348 CenterProgramTarget(program,$(SRCS5),$(OBJS5),locallib,syslib) @@\
350 InstallProgram(program,$(BINDIR))
353 #ifndef MComplexProgramTarget_6
354 #define MComplexProgramTarget_6(program,locallib,syslib) @@\
355 PROGRAM_6 = program @@\
356 program: $(OBJS6) $(DEPLIBS6) @@\
357 RemoveTargetProgram($@) @@\
358 $(CC) -o $@ $(LDOPTIONS) $(OBJS6) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
360 CenterProgramTarget(program,$(SRCS6),$(OBJS6),locallib,syslib) @@\
362 InstallProgram(program,$(BINDIR))
365 #ifndef MComplexProgramTarget_7
366 #define MComplexProgramTarget_7(program,locallib,syslib) @@\
367 PROGRAM_7 = program @@\
368 program: $(OBJS7) $(DEPLIBS7) @@\
369 RemoveTargetProgram($@) @@\
370 $(CC) -o $@ $(LDOPTIONS) $(OBJS7) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
372 CenterProgramTarget(program,$(SRCS7),$(OBJS7),locallib,syslib) @@\
374 InstallProgram(program,$(BINDIR))
377 #ifndef MComplexProgramTarget_8
378 #define MComplexProgramTarget_8(program,locallib,syslib) @@\
379 PROGRAM_8 = program @@\
380 program: $(OBJS8) $(DEPLIBS8) @@\
381 RemoveTargetProgram($@) @@\
382 $(CC) -o $@ $(LDOPTIONS) $(OBJS8) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
384 CenterProgramTarget(program,$(SRCS8),$(OBJS8),locallib,syslib) @@\
386 InstallProgram(program,$(BINDIR))
389 #ifndef MComplexProgramTarget_9
390 #define MComplexProgramTarget_9(program,locallib,syslib) @@\
391 PROGRAM_9 = program @@\
392 program: $(OBJS9) $(DEPLIBS9) @@\
393 RemoveTargetProgram($@) @@\
394 $(CC) -o $@ $(LDOPTIONS) $(OBJS9) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
396 CenterProgramTarget(program,$(SRCS9),$(OBJS9),locallib,syslib) @@\
398 InstallProgram(program,$(BINDIR))
403 #define TestPPTarget(root) @@\
404 all:: root.Scr root.Dat @@\
406 root.Dat: root.dat @@\
408 $(COMMONPP) $(DEFINES) root.dat @@\
409 root.Scr: root.scr @@\
411 $(COMMONPP) $(DEFINES) root.scr
415 #define TestPPTarget(root) @@\
418 root.Dat: root.dat @@\
420 $(COMMONPP) $(DEFINES) root.dat
425 #ifndef TestPPTargetScr
426 #define TestPPTargetScr(root) @@\
429 root.Scr: root.scr @@\
431 $(COMMONPP) $(DEFINES) root.scr
434 #ifndef TestPPTargetScr
435 #define TestPPTargetScr(root) /**/
440 #ifndef TestPPTargetDat
441 #define TestPPTargetDat(root) @@\
444 root.Dat: root.dat @@\
446 $(COMMONPP) $(DEFINES) root.dat
450 #ifndef TestPPTargetDat
451 #define TestPPTargetDat(root) @@\
454 root.Dat: root.dat @@\
456 $(COMMONPP) $(DEFINES) root.dat
461 #ifndef NO_AUTOMATION
463 #define RunTarget() @@\
467 $(GENRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES) @@\
475 #define RunTarget() @@\
479 $(MANRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES) @@\
487 #define RunTarget() @@\
491 $(MANRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES) @@\
498 #define RunTarget() @@\
511 #define VistaMapRule(targetmap,depend) @@\
514 targetmap: depend @@\
515 $(RM) $(MTOP)/tests/Vista/targetmap @@\
516 CATCMD *.M > $(MTOP)/tests/Vista/targetmap
518 #ifndef ComplexVistaMapRule
519 #define ComplexVistaMapRule(program,filelist) @@\
522 program.M: filelist @@\
523 $(RM) program.vista.tmpfile @@\
524 touch program.vista.tmpfile @@\
525 @case '${MFLAGS}' in *[ik]*) set +e;; esac; @@\
526 @for i in filelist; do \ @@\
527 cat `basename $$i .o`.M >> program.vista.tmpfile ; done @@\
529 $(MV) program.vista.tmpfile program.M @@\
537 /* Rule for making shadow trees. */
538 #ifndef MakeShadowTree
539 #define MakeShadowTree(name,dirs) @@\
541 @case '${MFLAGS}' in *[ik]*) set +e;; esac; @@\
543 @for i in dirs; \ @@\
544 do if [ -d $$i/name ]; then \ @@\
545 exit 0; else set -x; mkdir $$i/name; fi \ @@\
547 @for i in dirs; \ @@\
548 do if [ -r name/$$i ]; then \ @@\
550 else (set -x; $(LN) ../$$i/name name/$$i); fi \@@\
559 * "CPlusPlusObjectCompile" - compile fragment for a normal C++ object file
561 #ifndef CPlusPlusObjectCompile
562 #define CPlusPlusObjectCompile(options) $(RM) $@ @@\
563 $(CPLUSPLUSCOM) -c $(CPLUSPLUSFLAGS) options $*.cxx
566 #ifndef CPlusPlusObjectRule
567 #define CPlusPlusObjectRule() @@\
569 CPlusPlusObjectCompile($(_NOOP_))
570 #endif /* CPlusPlusObjectRule */
572 #ifndef MCPlusPlusSimpleProgramTarget
573 #define MCPlusPlusSimpleProgramTarget(program) @@\
574 AllTarget(program) @@\
576 program: program.o $(DEPS) $(DEPLIBS) @@\
577 RemoveTargetProgram($@) @@\
578 $(CPLUSPLUSLINKCOM) -o $@ program.o $(LDOPTIONS) $(DEPS) $(LOCAL_LIBRARIES) $(CPLUSPLUSLIBS) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
584 #ifndef MCPlusPlusComplexProgramTarget
585 #define MCPlusPlusComplexProgramTarget(program,locallib,syslib) @@\
586 PROGRAM = program @@\
588 AllTarget(program) @@\
590 program: $(OBJS) $(DEPLIBS) @@\
591 RemoveTargetProgram($@) @@\
592 $(CPLUSPLUSLINKCOM) -o $@ $(LDOPTIONS) $(OBJS) locallib $(CPLUSPLUSLIBS) $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
594 CenterProgramTarget(program,$(SRCS),$(OBJS),locallib,syslib) @@\
596 InstallProgram(program,$(BINDIR)) @@\
599 @echo To install documentation for $(PROGRAM), consult the Release Notes @@\
600 @echo and/or README file in the current directory. @@\
608 #endif /* BuildPlusPlus */
610 /* Rules for message catalog building */
611 #ifndef Real_MessageCatalogRule
612 #define Real_MessageCatalogRule(prefix) @@\
613 prefix.cat Concat(prefix,MsgCatI.h): @@\
614 $(RM) Concat(prefix,MsgCatI.h) prefix.cat $(MLOCSRC)/C/msg/prefix.msg @@\
615 $(MKCATTOOL) Concat(prefix,MsgCatI.h) prefix.msg > $(MLOCSRC)/C/msg/prefix.msg @@\
616 $(GENCAT) prefix.cat $(MLOCSRC)/C/msg/prefix.msg @@\
618 includes:: prefix.cat Concat(prefix,MsgCatI.h) @@\
620 depend:: prefix.cat Concat(prefix,MsgCatI.h) @@\
625 $(RM) prefix.cat Concat(prefix,MsgCatI.h)
627 #define Stub_MessageCatalogRule(prefix) /**/
630 /* The X BuildLibDir is now an import, not an export. */
631 #if UseImports || ImportX11
632 # ifndef XBuildLibDir
633 # define XBuildLibDir $(TOP)/imports/x11/lib
638 /* Search the Motif ProjectRoot too if it is different. */
639 #ifdef MotifProjectRoot
640 # define MUsrLibDirPath Concat(XUsrLibDirPath,:$(MPROJECTROOT)/lib)
642 # define MUsrLibDirPath XUsrLibDirPath
645 # undef UsrLibDirPath
647 #define UsrLibDirPath MUsrLibDirPath
650 # define MLdPreLibs -L$(MLIBSRC)
651 #elif defined(UseInstalledMotif) && defined(MotifProjectRoot)
652 # define MLdPreLibs -L$(MPROJECTROOT)/lib
654 # define MLdPreLibs /**/
659 #define LdPreLibs LdPreLib MLdPreLibs XLdPreLibs
664 #ifdef MotifProjectRoot
665 # define MLdPostLibs -L$(MPROJECTROOT)/lib
667 # define MLdPostLibs /**/
669 #define LdPostLibs LdPostLib MLdPostLibs XLdPostLibs
674 #define TopIncludes TopInclude $(TOP_MOTIF_INCLUDES) $(TOP_X_INCLUDES)
676 #if UseInstalledMotif && defined(MotifProjectRoot)
677 # define MotifBuildLibPath $(MPROJECTROOT)/lib
678 #elif UseInstalledMotif
679 # define MotifBuildLibPath $(USRLIBDIR)
681 # define MotifBuildLibPath $(MLIBSRC)
683 # define MotifBuildLibPath $(TOP)/exports/lib
688 #ifdef SystemBuildLibPath
689 # define BuildLibPath $(MOTIFENVLIBDIR):$(XENVLIBDIR):$(SYSTEMENVLIBDIR)
691 # define BuildLibPath $(MOTIFENVLIBDIR):$(XENVLIBDIR)
694 #ifndef MotifProjectDefines
695 # define MotifProjectDefines MotifDefines MessageCatalogDefines
697 #ifdef ProjectDefines
698 # undef ProjectDefines
700 #define ProjectDefines X11ProjectDefines MotifProjectDefines
702 #ifndef MotifCplusplusProjectDefines
703 # define MotifCplusplusProjectDefines MotifProjectDefines
705 #ifdef CplusplusProjectDefines
706 # undef CplusplusProjectDefines
708 #define CplusplusProjectDefines \
709 X11CplusplusProjectDefines MotifCplusplusProjectDefines