Use -O2 -fno-strict-aliasing optimization for FreeBSD
[oweals/cde.git] / cde / config / cf / Motif.rules
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  */ 
16 XCOMM $TOG: Motif.rules /main/8 1999/03/22 15:12:48 mgreess $
17
18 /* Note whether we are the top level project. */
19 #ifndef SeenTopLevelProject
20 # define SeenTopLevelProject    YES
21 # define MotifIsTopLevelProject YES
22 #else
23 # define MotifIsTopLevelProject NO
24 #endif
25
26 /* Include the X11 project rules file. */
27 #include <X11.rules>
28
29
30 /* Use the in-tree Motif by default. */
31 #ifndef UseInstalledMotif
32 # define UseInstalledMotif      NO
33 #endif
34 #ifdef UseInstalled
35 # undef UseInstalledMotif
36 # define UseInstalledMotif      YES
37 #endif
38
39 #ifndef ImportMotif
40 # ifdef UseImports
41 #  define ImportMotif           YES
42 # else
43 #  define ImportMotif           NO
44 # endif
45 #endif
46 #if UseInstalledMotif
47 # undef ImportMotif
48 # define ImportMotif            NO
49 #endif
50
51 #ifndef MSimpleProgramTarget
52 #define MSimpleProgramTarget(program)                                   @@\
53 AllTarget(program)                                                      @@\
54                                                                         @@\
55 program: program.o $(DEPS) $(DEPLIBS)                                   @@\
56         RemoveTargetProgram($@)                                         @@\
57         $(CCLINK) -o $@ program.o $(LDOPTIONS) $(DEPS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)  @@\
58                                                                         @@\
59 clean::                                                                 @@\
60         $(RM) program
61 #endif
62
63 #ifndef MSimpleUilTarget
64 #define MSimpleUilTarget(program)                                       @@\
65 MSimpleProgramTarget(program)                                           @@\
66                                                                         @@\
67 InstallProgram(program,$(BINDIR))                                       @@\
68                                                                         @@\
69 MSimpleUidTarget(program)
70 #endif
71
72 /*
73  * UILFLAGS contains site/vendor-specific flags
74  * defined by UilFlags, which supposed to be set in *.cf or
75  * site.def files.
76  * LOCAL_UILFLAGS(_n) contains client-specific uil flags set in Imakefile
77  */
78
79 #ifndef MSimpleUidTarget
80 #define MSimpleUidTarget(program)                                       @@\
81 AllTarget(program.uid)                                                  @@\
82                                                                         @@\
83 program.uid: program.uil $(DEPUIL)                                      @@\
84         RemoveTargetProgram($@)                                         @@\
85         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS) -o $@ program.uil $(UIL_INCLUDES)        @@\
86                                                                         @@\
87 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
88                                                                         @@\
89 clean::                                                                 @@\
90         $(RM) program.uid
91 #endif
92
93 #ifndef MSimpleUidSubdirTarget
94 #define MSimpleUidSubdirTarget(program,subdir)                          @@\
95 AllTarget(subdir/program.uid)                                           @@\
96                                                                         @@\
97 subdir/program.uid: subdir/program.uil $(DEPUIL)                        @@\
98         RemoveTargetProgram($@)                                         @@\
99         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS) -o $@ subdir/program.uil $(UIL_INCLUDES) @@\
100                                                                         @@\
101 InstallNamedTarget(install,subdir/program.uid,$(INSTDATFLAGS),$(UIDDIR)/subdir,program.uid) @@\
102                                                                         @@\
103 clean::                                                                 @@\
104         $(RM) subdir/program.uid
105 #endif
106
107 #ifndef MSimpleUidLocaleTarget
108 #define MSimpleUidLocaleTarget(program,locale)                          @@\
109 AllTarget(program.uid)                                                  @@\
110                                                                         @@\
111 program.uid: program.uil $(DEPUIL)                                      @@\
112         RemoveTargetProgram($@)                                         @@\
113         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS) -o $@ program.uil $(UIL_INCLUDES)        @@\
114                                                                         @@\
115 InstallNonExecFile(program.uid,$(LIBDIR)/locale/uid)                    @@\
116                                                                         @@\
117 clean::                                                                 @@\
118         $(RM) program.uid
119 #endif
120
121 #ifndef MComplexUidTarget_1
122 #define MComplexUidTarget_1(program)                                    @@\
123                                                                         @@\
124 AllTarget(program.uid)                                                  @@\
125                                                                         @@\
126 program.uid:  $(UILS1) $(DEPUIL)                                        @@\
127         RemoveTargetProgram($@)                                         @@\
128         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_1) -o $@ program.uil $(UIL_INCLUDES)      @@\
129                                                                         @@\
130 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
131                                                                         @@\
132 clean::                                                                 @@\
133         $(RM) program.uid
134 #endif
135
136 #ifndef MComplexUidTarget_2
137 #define MComplexUidTarget_2(program)                                    @@\
138                                                                         @@\
139 AllTarget(program.uid)                                                  @@\
140                                                                         @@\
141 program.uid:  $(UILS2) $(DEPUIL)                                        @@\
142         RemoveTargetProgram($@)                                         @@\
143         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_2) -o $@ program.uil $(UIL_INCLUDES)      @@\
144                                                                         @@\
145 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
146                                                                         @@\
147 clean::                                                                 @@\
148         $(RM) program.uid
149 #endif
150
151 #ifndef MComplexUidTarget_3
152 #define MComplexUidTarget_3(program)                                    @@\
153                                                                         @@\
154 AllTarget(program.uid)                                                  @@\
155                                                                         @@\
156 program.uid:  $(UILS3) $(DEPUIL)                                        @@\
157         RemoveTargetProgram($@)                                         @@\
158         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_3) -o $@ program.uil $(UIL_INCLUDES)      @@\
159                                                                         @@\
160 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
161                                                                         @@\
162 clean::                                                                 @@\
163         $(RM) program.uid
164 #endif
165
166 #ifndef MComplexUidTarget_4
167 #define MComplexUidTarget_4(program)                                    @@\
168                                                                         @@\
169 AllTarget(program.uid)                                                  @@\
170                                                                         @@\
171 program.uid:  $(UILS4) $(DEPUIL)                                        @@\
172         RemoveTargetProgram($@)                                         @@\
173         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_4) -o $@ program.uil $(UIL_INCLUDES)      @@\
174                                                                         @@\
175 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
176                                                                         @@\
177 clean::                                                                 @@\
178         $(RM) program.uid
179 #endif
180
181 #ifndef MComplexUidTarget_5
182 #define MComplexUidTarget_5(program)                                    @@\
183                                                                         @@\
184 AllTarget(program.uid)                                                  @@\
185                                                                         @@\
186 program.uid:  $(UILS5) $(DEPUIL)                                        @@\
187         RemoveTargetProgram($@)                                         @@\
188         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_5) -o $@ program.uil $(UIL_INCLUDES)      @@\
189                                                                         @@\
190 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
191                                                                         @@\
192 clean::                                                                 @@\
193         $(RM) program.uid
194 #endif
195
196 #ifndef MComplexUidTarget_6
197 #define MComplexUidTarget_6(program)                                    @@\
198                                                                         @@\
199 AllTarget(program.uid)                                                  @@\
200                                                                         @@\
201 program.uid:  $(UILS6) $(DEPUIL)                                        @@\
202         RemoveTargetProgram($@)                                         @@\
203         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_6) -o $@ program.uil $(UIL_INCLUDES)      @@\
204                                                                         @@\
205 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
206                                                                         @@\
207 clean::                                                                 @@\
208         $(RM) program.uid
209 #endif
210
211 #ifndef MComplexUidTarget_7
212 #define MComplexUidTarget_7(program)                                    @@\
213                                                                         @@\
214 AllTarget(program.uid)                                                  @@\
215                                                                         @@\
216 program.uid:  $(UILS7) $(DEPUIL)                                        @@\
217         RemoveTargetProgram($@)                                         @@\
218         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_7) -o $@ program.uil $(UIL_INCLUDES)      @@\
219                                                                         @@\
220 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
221                                                                         @@\
222 clean::                                                                 @@\
223         $(RM) program.uid
224 #endif
225
226 #ifndef MComplexUidTarget_8
227 #define MComplexUidTarget_8(program)                                    @@\
228                                                                         @@\
229 AllTarget(program.uid)                                                  @@\
230                                                                         @@\
231 program.uid:  $(UILS8) $(DEPUIL)                                        @@\
232         RemoveTargetProgram($@)                                         @@\
233         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_8) -o $@ program.uil $(UIL_INCLUDES)      @@\
234                                                                         @@\
235 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
236                                                                         @@\
237 clean::                                                                 @@\
238         $(RM) program.uid
239 #endif
240
241 #ifndef MComplexUidTarget_9
242 #define MComplexUidTarget_9(program)                                    @@\
243                                                                         @@\
244 AllTarget(program.uid)                                                  @@\
245                                                                         @@\
246 program.uid:  $(UILS9) $(DEPUIL)                                        @@\
247         RemoveTargetProgram($@)                                         @@\
248         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_9) -o $@ program.uil $(UIL_INCLUDES)      @@\
249                                                                         @@\
250 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
251                                                                         @@\
252 clean::                                                                 @@\
253         $(RM) program.uid
254 #endif
255
256 #ifndef MComplexUidTarget_10
257 #define MComplexUidTarget_10(program)                                   @@\
258                                                                         @@\
259 AllTarget(program.uid)                                                  @@\
260                                                                         @@\
261 program.uid:  $(UILS10) $(DEPUIL)                                       @@\
262         RemoveTargetProgram($@)                                         @@\
263         $(CLIENTENVSETUP) $(UIL) $(UILFLAGS) $(LOCAL_UILFLAGS_10) -o $@ program.uil $(UIL_INCLUDES)     @@\
264                                                                         @@\
265 InstallNonExecFile(program.uid,$(UIDDIR))                               @@\
266                                                                         @@\
267 clean::                                                                 @@\
268         $(RM) program.uid
269 #endif
270
271 #ifndef MComplexProgramTarget
272 #define MComplexProgramTarget(program,locallib,syslib)                  @@\
273         PROGRAM = program                                               @@\
274                                                                         @@\
275 AllTarget(program)                                                      @@\
276                                                                         @@\
277 program: $(OBJS) $(DEPLIBS)                                             @@\
278         RemoveTargetProgram($@)                                         @@\
279         $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS)      @@\
280                                                                         @@\
281 CenterProgramTarget(program,$(SRCS),$(OBJS),locallib,syslib)            @@\
282                                                                         @@\
283 InstallProgram(program,$(BINDIR))                                       @@\
284                                                                         @@\
285 install.man::                                                           @@\
286         @echo To install documentation for $(PROGRAM), consult the Release Notes        @@\
287         @echo and/or README file in the current directory.              @@\
288 DependTarget()                                                          @@\
289 LintTarget()                                                            @@\
290                                                                         @@\
291 clean::                                                                 @@\
292         $(RM) $(PROGRAM)
293 #endif
294
295 #ifndef MComplexProgramTarget_1
296 #define MComplexProgramTarget_1(program,locallib,syslib)                @@\
297             OBJS = $(OBJS1) $(OBJS2) $(OBJS3)                           @@\
298             SRCS = $(SRCS1) $(SRCS2) $(SRCS3)                           @@\
299                                                                         @@\
300 AllTarget($(PROGRAMS))                                                  @@\
301                                                                         @@\
302 program: $(OBJS1) $(DEPLIBS1)                                           @@\
303         RemoveTargetProgram($@)                                         @@\
304         $(CCLINK) -o $@ $(LDOPTIONS) $(OBJS1) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS)     @@\
305                                                                         @@\
306 CenterProgramTarget(program,$(SRCS1),$(OBJS1),locallib,syslib)          @@\
307                                                                         @@\
308 InstallProgram(program,$(BINDIR))                                       @@\
309                                                                         @@\
310 install.man::                                                           @@\
311         @echo To install documentation for $(PROGRAMS), consult the Release Notes       @@\
312         @echo and/or README file in the current directory.              @@\
313 DependTarget()                                                          @@\
314 LintTarget()                                                            @@\
315                                                                         @@\
316 clean::                                                                 @@\
317         $(RM) $(PROGRAMS)
318 #endif
319
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)     @@\
325                                                                         @@\
326 CenterProgramTarget(program,$(SRCS2),$(OBJS2),locallib,syslib)          @@\
327                                                                         @@\
328 InstallProgram(program,$(BINDIR))
329 #endif
330
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)     @@\
337                                                                         @@\
338 CenterProgramTarget(program,$(SRCS3),$(OBJS3),locallib,syslib)          @@\
339                                                                         @@\
340 InstallProgram(program,$(BINDIR))
341 #endif
342
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)     @@\
349                                                                         @@\
350 CenterProgramTarget(program,$(SRCS4),$(OBJS4),locallib,syslib)          @@\
351                                                                         @@\
352 InstallProgram(program,$(BINDIR))
353 #endif
354
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)     @@\
361                                                                         @@\
362 CenterProgramTarget(program,$(SRCS5),$(OBJS5),locallib,syslib)          @@\
363                                                                         @@\
364 InstallProgram(program,$(BINDIR))
365 #endif
366
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)     @@\
373                                                                         @@\
374 CenterProgramTarget(program,$(SRCS6),$(OBJS6),locallib,syslib)          @@\
375                                                                         @@\
376 InstallProgram(program,$(BINDIR))
377 #endif
378
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)     @@\
385                                                                         @@\
386 CenterProgramTarget(program,$(SRCS7),$(OBJS7),locallib,syslib)          @@\
387                                                                         @@\
388 InstallProgram(program,$(BINDIR))
389 #endif
390
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)     @@\
397                                                                         @@\
398 CenterProgramTarget(program,$(SRCS8),$(OBJS8),locallib,syslib)          @@\
399                                                                         @@\
400 InstallProgram(program,$(BINDIR))
401 #endif
402
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)     @@\
409                                                                         @@\
410 CenterProgramTarget(program,$(SRCS9),$(OBJS9),locallib,syslib)          @@\
411                                                                         @@\
412 InstallProgram(program,$(BINDIR))
413 #endif
414
415 #ifdef AUTOMATION
416 #ifndef TestPPTarget
417 #define TestPPTarget(root)                                              @@\
418 all:: root.Scr root.Dat                                                 @@\
419                                                                         @@\
420 root.Dat: root.dat                                                      @@\
421         $(RM) root.Dat                                                  @@\
422         $(COMMONPP) $(DEFINES) root.dat                                 @@\
423 root.Scr: root.scr                                                      @@\
424         $(RM) root.Scr                                                  @@\
425         $(COMMONPP) $(DEFINES) root.scr
426 #endif 
427 #else
428 #ifndef TestPPTarget
429 #define TestPPTarget(root)                                              @@\
430 all:: root.Dat                                                          @@\
431                                                                         @@\
432 root.Dat: root.dat                                                      @@\
433         $(RM) root.Dat                                                  @@\
434         $(COMMONPP) $(DEFINES) root.dat
435 #endif
436 #endif
437
438 #ifdef AUTOMATION
439 #ifndef TestPPTargetScr
440 #define TestPPTargetScr(root)                                           @@\
441 all:: root.Scr                                                          @@\
442                                                                         @@\
443 root.Scr: root.scr                                                      @@\
444         $(RM) root.Scr                                                  @@\
445         $(COMMONPP) $(DEFINES) root.scr
446 #endif
447 #else
448 #ifndef TestPPTargetScr
449 #define TestPPTargetScr(root)  /**/
450 #endif
451 #endif
452
453 #ifdef AUTOMATION
454 #ifndef TestPPTargetDat
455 #define TestPPTargetDat(root)                                              @@\
456 all:: root.Dat                                                          @@\
457                                                                         @@\
458 root.Dat: root.dat                                                      @@\
459         $(RM) root.Dat                                                  @@\
460         $(COMMONPP) $(DEFINES) root.dat
461 #endif
462 #endif
463 #ifndef AUTOMATION
464 #ifndef TestPPTargetDat
465 #define TestPPTargetDat(root)                                              @@\
466 all:: root.Dat                                                          @@\
467                                                                         @@\
468 root.Dat: root.dat                                                      @@\
469         $(RM) root.Dat                                                  @@\
470         $(COMMONPP) $(DEFINES) root.dat
471 #endif
472 #endif
473
474
475 #ifndef NO_AUTOMATION
476 #ifndef RunTarget
477 #define RunTarget()                                                     @@\
478 all::   RUN                                                             @@\
479                                                                         @@\
480 RUN:    always                                                          @@\
481         $(GENRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES)                     @@\
482                                                                         @@\
483 always:                                                                 @@\
484         $(RM) RUN
485 #endif
486 #else
487 #ifdef UseVista
488 #ifndef RunTarget
489 #define RunTarget()                                                     @@\
490 all::   RUN                                                             @@\
491                                                                         @@\
492 RUN:    always                                                          @@\
493         $(MANRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES)                     @@\
494                                                                         @@\
495 always:                                                                 @@\
496         $(RM) RUN
497 #endif
498 #else
499 #ifdef UsePurify
500 #ifndef RunTarget
501 #define RunTarget()                                                     @@\
502 all::   RUN                                                             @@\
503                                                                         @@\
504 RUN:    always                                                          @@\
505         $(MANRUN) $(CURRENT_DIR) $(MTOP) $(DEFINES)                     @@\
506                                                                         @@\
507 always:                                                                 @@\
508         $(RM) RUN
509 #endif
510 #else
511 #ifndef RunTarget
512 #define RunTarget()                                                     @@\
513 all::   RUN                                                             @@\
514                                                                         @@\
515 RUN:    always                                                          @@\
516                                                                         @@\
517 always:                                                                 @@\
518
519 #endif
520 #endif
521 #endif
522 #endif
523 #ifdef UseVista
524 #ifndef VistaMapRule
525 #define VistaMapRule(targetmap,depend)                                  @@\
526 all:: targetmap                                                         @@\
527                                                                         @@\
528 targetmap: depend                                                       @@\
529         $(RM) $(MTOP)/tests/Vista/targetmap                             @@\
530         CATCMD *.M > $(MTOP)/tests/Vista/targetmap
531 #endif
532 #ifndef ComplexVistaMapRule
533 #define ComplexVistaMapRule(program,filelist)                           @@\
534 all::   program.M                                                       @@\
535                                                                         @@\
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 @@\
542         $(RM) program.M                                                 @@\
543         $(MV) program.vista.tmpfile program.M                           @@\
544                                                                         @@\
545 clean::                                                                 @@\
546         $(RM) *.M
547 #endif
548
549 #endif
550
551 /*  Rule for making shadow trees.       */
552 #ifndef MakeShadowTree
553 #define MakeShadowTree(name,dirs)                       @@\
554 all::                                                   @@\
555         @case '${MFLAGS}' in *[ik]*) set +e;; esac;     @@\
556         MakeDir(name)                                   @@\
557         @for i in dirs; \                               @@\
558         do if [ -d $$i/name ]; then \                   @@\
559         exit 0; else set -x; mkdir $$i/name; fi \       @@\
560         done                                            @@\
561         @for i in dirs; \                               @@\
562         do if [ -r name/$$i ]; then \                   @@\
563                 set +x; \                               @@\
564                 else (set -x; $(LN) ../$$i/name  name/$$i); fi \@@\
565         done
566 #endif
567
568 #ifdef BuildPlusPlus
569
570 /* Rules for C++ */
571
572 /*
573  * "CPlusPlusObjectCompile" - compile fragment for a normal C++ object file
574 */
575 #ifndef CPlusPlusObjectCompile
576 #define CPlusPlusObjectCompile(options) $(RM) $@                       @@\
577         $(CXX) -c $(CXXFLAGS) options $*.cxx
578 #endif
579
580 #ifndef CPlusPlusObjectRule
581 #define CPlusPlusObjectRule()                                           @@\
582 .SUFFIXES: .cxx                                                         @@\
583                                                                         @@\
584 .cxx.o:                                                                 @@\
585         CPlusPlusObjectCompile($(_NOOP_))
586 #endif /* CPlusPlusObjectRule */
587
588 #ifndef MCPlusPlusSimpleProgramTarget
589 #define MCPlusPlusSimpleProgramTarget(program)                          @@\
590 AllTarget(program)                                                      @@\
591                                                                         @@\
592 program: program.o $(DEPS) $(DEPLIBS)                                   @@\
593         RemoveTargetProgram($@)                                         @@\
594         $(CXXLINK) -o $@ program.o $(CXXLDOPTIONS) $(DEPS) $(LOCAL_LIBRARIES) $(CXXLIBS) $(LDLIBS) $(EXTRA_LOAD_FLAGS)  @@\
595                                                                         @@\
596 clean::                                                                 @@\
597         $(RM) program
598 #endif
599
600 #ifndef MCPlusPlusComplexProgramTarget
601 #define MCPlusPlusComplexProgramTarget(program,locallib,syslib)         @@\
602         PROGRAM = program                                               @@\
603                                                                         @@\
604 AllTarget(program)                                                      @@\
605                                                                         @@\
606 program: $(OBJS) $(DEPLIBS)                                             @@\
607         RemoveTargetProgram($@)                                         @@\
608         $(CXXLINK) -o $@ $(CXXLDOPTIONS) $(OBJS) locallib $(CXXLIBS) $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS)       @@\
609                                                                         @@\
610 CenterProgramTarget(program,$(SRCS),$(OBJS),locallib,syslib)            @@\
611                                                                         @@\
612 InstallProgram(program,$(BINDIR))                                       @@\
613                                                                         @@\
614 install.man::                                                           @@\
615         @echo To install documentation for $(PROGRAM), consult the Release Notes        @@\
616         @echo and/or README file in the current directory.              @@\
617 DependTarget()                                                          @@\
618 LintTarget()                                                            @@\
619                                                                         @@\
620 clean::                                                                 @@\
621         $(RM) $(PROGRAM)
622 #endif
623
624 #endif /* BuildPlusPlus */
625
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                @@\
633                                                                         @@\
634 includes:: prefix.cat Concat(prefix,MsgCatI.h)                          @@\
635                                                                         @@\
636 depend:: prefix.cat Concat(prefix,MsgCatI.h)                            @@\
637                                                                         @@\
638 all:: prefix.cat                                                        @@\
639                                                                         @@\
640 clean::                                                                 @@\
641         $(RM) prefix.cat Concat(prefix,MsgCatI.h)
642 #endif
643 #define Stub_MessageCatalogRule(prefix) /**/
644
645
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
650 # endif
651 #endif
652
653
654 /* Search the Motif ProjectRoot too if it is different. */
655 #ifdef MotifProjectRoot
656 # define MUsrLibDirPath Concat(XUsrLibDirPath,:$(MPROJECTROOT)/lib)
657 #else
658 # define MUsrLibDirPath XUsrLibDirPath
659 #endif
660 #ifdef UsrLibDirPath
661 # undef UsrLibDirPath
662 #endif
663 #define UsrLibDirPath   MUsrLibDirPath
664
665 #if ImportMotif
666 # define MLdPreLibs     -L$(MLIBSRC)
667 #elif defined(UseInstalledMotif) && defined(MotifProjectRoot)
668 # define MLdPreLibs     -L$(MPROJECTROOT)/lib
669 #else
670 # define MLdPreLibs     /**/
671 #endif
672 #ifdef LdPreLibs
673 # undef LdPreLibs
674 #endif
675 #define LdPreLibs       LdPreLib MLdPreLibs XLdPreLibs
676
677 #ifdef LdPostLibs
678 # undef LdPostLibs
679 #endif
680 #ifdef MotifProjectRoot
681 # define MLdPostLibs    -L$(MPROJECTROOT)/lib
682 #else
683 # define MLdPostLibs    /**/
684 #endif
685 #define LdPostLibs      LdPostLib MLdPostLibs XLdPostLibs
686
687 #ifdef TopIncludes
688 # undef TopIncludes
689 #endif
690 #define TopIncludes     TopInclude $(TOP_MOTIF_INCLUDES) $(TOP_X_INCLUDES)
691
692 #if UseInstalledMotif && defined(MotifProjectRoot)
693 # define MotifBuildLibPath      $(MPROJECTROOT)/lib
694 #elif UseInstalledMotif
695 # define MotifBuildLibPath      $(USRLIBDIR)
696 #elif ImportMotif
697 # define MotifBuildLibPath      $(MLIBSRC)
698 #else
699 # define MotifBuildLibPath      $(TOP)/exports/lib
700 #endif
701 #ifdef BuildLibPath
702 # undef BuildLibPath
703 #endif
704 #ifdef SystemBuildLibPath
705 # define BuildLibPath   $(MOTIFENVLIBDIR):$(XENVLIBDIR):$(SYSTEMENVLIBDIR)
706 #else
707 # define BuildLibPath   $(MOTIFENVLIBDIR):$(XENVLIBDIR)
708 #endif
709
710 #ifndef MotifProjectDefines
711 # define MotifProjectDefines    MotifDefines MessageCatalogDefines
712 #endif
713 #ifdef ProjectDefines
714 # undef ProjectDefines
715 #endif
716 #define ProjectDefines  X11ProjectDefines MotifProjectDefines
717
718 #ifndef MotifCplusplusProjectDefines
719 # define MotifCplusplusProjectDefines   MotifProjectDefines
720 #endif
721 #ifdef CplusplusProjectDefines
722 # undef CplusplusProjectDefines
723 #endif
724 #define CplusplusProjectDefines \
725         X11CplusplusProjectDefines MotifCplusplusProjectDefines