linux: move dependancy handling out of linux.cf and into new lnxDep.rules file.
[oweals/cde.git] / cde / config / cf / Imake.tmpl
1 XCOMM ----------------------------------------------------------------------
2 XCOMM Makefile generated from IMAKE_TEMPLATE and INCLUDE_IMAKEFILE
3 XCOMM $TOG: Imake.tmpl /main/249 1997/10/13 15:28:56 kaleb $
4 XCOMM
5
6 /*
7  * generic imake template
8  */
9
10 /*
11  * Modify Imake.cf when adding a new architecture, do not modify this file.
12  * Platform-specific parameters may be set in the appropriate <vendor>.cf
13  * configuration files.  Site-specific parameters should be set in the file
14  * site.def.  Full rebuilds are recommended if any parameters are changed.
15  * If your C preprocessor does not define any unique symbols, you will need
16  * to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
17  * "make World" the first time).
18  */
19
20 #define ImakeConfigRelease 6
21
22 #define YES     1
23 #define NO      0
24
25 /* Ensure that "all" is the default target in the Makefile. */
26 all::
27
28 .SUFFIXES: .i
29
30 #include <Imake.cf>
31
32 XCOMM -----------------------------------------------------------------------
33 XCOMM site-specific configuration parameters that need to come before
34 XCOMM the platform-specific parameters - edit site.def to change
35 #define BeforeVendorCF
36 #include <site.def>
37 #undef BeforeVendorCF
38
39 #if defined(HasGcc2) && !defined(HasGcc)
40 # define HasGcc HasGcc2
41 #endif
42
43 #ifndef HasClearmake
44 # define HasClearmake NO
45 #endif
46
47 /*
48  * ClearmakeOSName - insert the current OS type into the clearmake
49  * build script, so .o files from different platforms cannot be winked in.
50  * If clearmake finds the build script for two .o files is the same, it
51  * will share the .o, even across different architectures.  Inserting the
52  * O/S name into the build script in a comment prevents unwanted sharing.
53  * Note the trailing double-@ in the macro: end a line using this macro
54  * with backslash without the double-@ usually used.
55  * Like this:
56  *
57  * #define SomeRule() @@\
58  *     something or other @@\
59  *     ClearmakeOSName \
60  *     something else @@\
61  *     and more
62  */
63 #ifndef ClearmakeOSName
64 # if HasClearmake
65 #  define ClearmakeOSName @ XCOMM $(OSNAME) @@
66 # else
67 #  define ClearmakeOSName /**/
68 # endif
69 #endif
70
71 #if HasClearmake
72 # ifndef MakeCmd
73 #  define MakeCmd clearmake
74 # endif
75 #endif
76
77 #if HasClearmake
78 XCOMM ----------------------------------------------------------------------
79 .c.o:
80         ClearmakeOSName $(CC) -c $(CFLAGS) $*.c
81 #endif
82
83 XCOMM ----------------------------------------------------------------------
84 XCOMM platform-specific configuration parameters - edit MacroFile to change
85 #include MacroIncludeFile
86
87 XCOMM ----------------------------------------------------------------------
88 XCOMM site-specific configuration parameters that go after
89 XCOMM the platform-specific parameters - edit site.def to change
90 #define AfterVendorCF
91 #include <site.def>
92 #undef AfterVendorCF
93
94 /*
95  * defaults for various generic parameters; set in site.def if needed
96  */
97
98 /* the following are needed before we can include Imake.rules */
99
100 #ifndef SystemV
101 #define SystemV                 NO      /* SYSV (R3) */
102 #endif
103 #ifndef SystemV4
104 #define SystemV4                NO      /* SVR4 */
105 #endif
106 #ifndef HasCodeCenter
107 #define HasCodeCenter           NO
108 #endif
109 #ifndef HasSentinel
110 #define HasSentinel             NO
111 #endif
112 #ifndef HasPurify
113 #define HasPurify               NO
114 #endif
115 #ifndef HasTestCenter
116 #define HasTestCenter           NO
117 #endif
118 #ifndef RemoveTargetProgramByMoving
119 #define RemoveTargetProgramByMoving NO
120 #endif
121 #ifndef DoRanlibCmd
122 #if SystemV || SystemV4
123 #define DoRanlibCmd NO
124 #else
125 #define DoRanlibCmd YES
126 #endif
127 #endif
128 #ifndef ExecableScripts
129 #if SystemV
130 #define ExecableScripts         NO
131 #else
132 #define ExecableScripts         YES     /* kernel exec() can handle #! */
133 #endif
134 #endif
135
136 #ifndef HasMakefileSafeInclude      /* -include or sinclude in a Makefile */
137 #if HasClearmake
138 #define HasMakefileSafeInclude  YES
139 #else
140 #define HasMakefileSafeInclude  NO   /* see also vendor-specific .cf files */
141 #endif
142 #endif
143
144 #ifndef HasVarDirectory
145 #define HasVarDirectory         YES
146 #endif
147
148 #include <Imake.rules>
149
150 #ifndef HasSharedLibraries
151 #define HasSharedLibraries NO
152 #endif
153 #ifndef OSMajorVersion
154 #define OSMajorVersion          0
155 #endif
156 #ifndef OSMinorVersion
157 #define OSMinorVersion          0
158 #endif
159 #ifndef UnalignedReferencesAllowed
160 #define UnalignedReferencesAllowed NO   /* if arbitrary deref is okay */
161 #endif
162 #ifndef AvoidNullMakeCommand
163 #define AvoidNullMakeCommand NO
164 #endif
165 #if AvoidNullMakeCommand
166 #ifndef NullMakeCommand
167 #define NullMakeCommand         @ echo -n
168 #endif
169 /*
170  * An obscure bug in BSD4.3's original make causes it not to recognize a
171  * macro definition if the macro name starts with a non-alpha and in
172  * column one.
173  */
174  _NULLCMD_ = NullMakeCommand
175 #endif
176
177 #ifndef CrossCompiling
178 #define CrossCompiling          NO
179 #endif
180 #ifndef BourneShell                     /* to force shell in makefile */
181 #define BourneShell             /bin/sh
182 #endif
183 #ifndef KornShell
184 #define KornShell               /bin/ksh
185 #endif
186 #ifndef DtKornShell
187 #define DtKornShell             /usr/dt/bin/dtksh
188 #endif
189 #ifndef ConstructMFLAGS
190 #if SystemV
191 #define ConstructMFLAGS         YES     /* build MFLAGS from MAKEFLAGS */
192 #else
193 #define ConstructMFLAGS         NO      /* build MFLAGS from MAKEFLAGS */
194 #endif
195 #endif
196
197 #ifndef ConstructMAKEFLAGS              /* needed on old BSD-based? */
198 #define ConstructMAKEFLAGS      NO      /* build MAKEFLAGS from MFLAGS */
199 #endif
200
201 #ifndef HasLargeTmp
202 #define HasLargeTmp             NO      /* be paranoid */
203 #endif
204
205 #ifndef HasBSD44Sockets
206 #define HasBSD44Sockets         NO
207 #endif
208 #ifndef HasSockets
209 #define HasSockets              YES
210 #endif
211 #ifndef HasStreams
212 #define HasStreams              !HasSockets
213 #endif
214 #ifndef HasDECnet
215 #define HasDECnet               NO
216 #endif
217 #ifndef HasPoll
218 #if SystemV || SystemV4
219 #define HasPoll                 YES
220 #else
221 #define HasPoll                 NO
222 #endif
223 #endif
224 #ifndef HasVFork
225 #if SystemV
226 #define HasVFork                NO      /* not yet... */
227 #else
228 #define HasVFork                YES
229 #endif
230 #endif
231 #ifndef HasSetUserContext
232 #define HasSetUserContext       NO
233 #endif
234 #ifndef HasLibCrypt
235 #define HasLibCrypt             NO
236 #endif
237 #ifndef HasPutenv
238 #define HasPutenv               NO      /* assume not */
239 #endif
240 #ifndef HasVoidSignalReturn
241 #define HasVoidSignalReturn     YES     /* assume yes */
242 #endif
243 #ifndef HasBsearch
244 #define HasBsearch              YES     /* assume yes */
245 #endif
246 #ifndef HasFortran
247 #define HasFortran              NO
248 #endif
249 #ifndef HasCplusplus
250 #define HasCplusplus            YES
251 #endif
252 #ifndef HasNdbm
253 #define HasNdbm                 NO
254 #endif
255 #ifndef HasSecureRPC
256 #define HasSecureRPC            NO      /* if you have Secure RPC */
257 #endif
258 #ifndef HasKrb5
259 #define HasKrb5                 NO      /* if you have Kerberos V5 */
260 #endif
261 #ifndef HasLatex
262 #define HasLatex                YES
263 #endif
264 #ifndef HasShm
265 #if SystemV || SystemV4
266 #define HasShm                  YES
267 #else
268 #define HasShm                  NO
269 #endif
270 #endif
271 #ifndef HasCbrt
272 #define HasCbrt                 YES
273 #endif
274 #ifndef HasFfs
275 #define HasFfs                  YES
276 #endif
277 #ifndef HasZlib
278 #define HasZlib                 NO
279 #endif
280 #if HasKrb5
281 #ifndef Krb5Includes
282 #define Krb5Includes -I/krb5/include
283 #endif
284 #ifndef Krb5Libraries
285 #define Krb5Libraries -L/krb5/lib -L/usr/isode/lib -lkrb5 -lcrypto -lisode -lcom_err -ldbm
286 #endif
287 #else
288 #undef Krb5Includes
289 #define Krb5Includes /**/
290 #undef Krb5Libraries
291 #define Krb5Libraries /**/
292 #endif
293 #ifndef NeedConstPrototypes
294 #define NeedConstPrototypes     NO
295 #endif
296 #ifndef NeedVarargsPrototypes
297 #define NeedVarargsPrototypes   NO
298 #endif
299 #ifndef NeedNestedPrototypes
300 #define NeedNestedPrototypes    NO
301 #endif
302 #ifndef NeedFunctionPrototypes
303 #define NeedFunctionPrototypes (NeedVarargsPrototypes || NeedNestedPrototypes)
304 #endif
305 #ifndef NeedWidePrototypes
306 #define NeedWidePrototypes      YES     /* mix and match ANSI-C, non-ANSI */
307 #endif
308
309 #ifndef StripInstalledPrograms
310 #define StripInstalledPrograms NO       /* leave symbol table just in case */
311 #endif
312 #ifndef UseCCMakeDepend                 /* use slow cc -E script */
313 #define UseCCMakeDepend NO
314 #endif
315
316 /* DefaultUsrBin is independent of ProjectRoot.
317    This is a directory where programs will be found even if PATH
318    is not set, for example when coming in remotely via rsh. */
319 #ifndef DefaultUsrBin
320 #define DefaultUsrBin /usr/bin
321 #endif
322
323 #ifndef UsrLibDir
324 #ifdef ProjectRoot
325 #define UsrLibDir Concat(ProjectRoot,/lib)
326 #ifndef AlternateUsrLibDir
327 #define AlternateUsrLibDir YES
328 #endif
329 #else
330 #define UsrLibDir /usr/lib
331 #ifndef AlternateUsrLibDir
332 #define AlternateUsrLibDir NO
333 #endif
334 #endif
335 #else
336 #ifndef AlternateUsrLibDir
337 #define AlternateUsrLibDir YES
338 #endif
339 #endif
340 #ifndef ShLibDir
341 #define ShLibDir UsrLibDir
342 #endif
343 #ifndef IncRoot
344 #ifdef ProjectRoot
345 #define IncRoot Concat(ProjectRoot,/include)
346 #ifndef AlternateIncRoot
347 #define AlternateIncRoot YES
348 #endif
349 #else
350 #define IncRoot /usr/include
351 #ifndef AlternateIncRoot
352 #define AlternateIncRoot NO
353 #endif
354 #endif
355 #else
356 #ifndef AlternateIncRoot
357 #define AlternateIncRoot YES
358 #endif
359 #endif
360 #ifndef LintlibDir
361 #define LintlibDir $(USRLIBDIR)/lint
362 #endif
363 #ifndef SystemManDirectory
364 #if SystemV4
365 #define SystemManDirectory /usr/share/man
366 #else
367 #define SystemManDirectory /usr/man
368 #endif
369 #endif
370 #ifndef ManDirectoryRoot
371 #ifdef ProjectRoot
372 #define ManDirectoryRoot Concat(ProjectRoot,/man)
373 #else
374 #define ManDirectoryRoot SystemManDirectory
375 #endif
376 #endif
377 #ifndef ManPath
378 #define ManPath ManDirectoryRoot
379 #endif
380 #ifndef ManSourcePath
381 #define ManSourcePath $(MANPATH)/man
382 #endif
383 #ifndef ManDir
384 #define ManDir $(MANSOURCEPATH)$(MANSUFFIX)
385 #endif
386 #ifndef LibmanDir
387 #define LibmanDir $(MANSOURCEPATH)$(LIBMANSUFFIX)
388 #endif
389 #ifndef FileManDir
390 #define FileManDir $(MANSOURCEPATH)$(FILEMANSUFFIX)
391 #endif
392 #ifndef MiscManDir
393 #define MiscManDir $(MANSOURCEPATH)$(MISCMANSUFFIX)
394 #endif
395 #ifndef ConfigSrc
396 #define ConfigSrc $(TOP)/config
397 #endif
398 #ifndef DependDir
399 #if UseCCMakeDepend
400 #define DependDir $(CONFIGSRC)/util
401 #else
402 #define DependDir $(CONFIGSRC)/makedepend
403 #endif
404 #endif
405 #ifndef DependDefines
406 #define DependDefines /**/
407 #endif
408 #ifndef UNCOMPRESSPATH
409 #define UNCOMPRESSPATH /usr/ucb/uncompress
410 #endif
411 #ifndef OptimizedCDebugFlags
412 #define OptimizedCDebugFlags -O
413 #endif
414 #ifndef OptimizedCplusplusDebugFlags
415 #define OptimizedCplusplusDebugFlags OptimizedCDebugFlags
416 #endif
417 #ifndef DebuggableCDebugFlags
418 #define DebuggableCDebugFlags -g
419 #endif
420 #ifndef DebuggableCplusplusDebugFlags
421 #define DebuggableCplusplusDebugFlags DebuggableCDebugFlags
422 #endif
423 #ifndef ProfiledCDebugFlags
424 #define ProfiledCDebugFlags -pg
425 #endif
426 #ifndef ProfiledCplusplusDebugFlags
427 #define ProfiledCplusplusDebugFlags ProfiledCDebugFlags
428 #endif
429 #ifndef NoOpCDebugFlags
430 #define NoOpCDebugFlags /**/
431 #endif
432 #ifndef DefaultCDebugFlags
433 #define DefaultCDebugFlags OptimizedCDebugFlags
434 #endif
435 #ifndef DefaultCplusplusDebugFlags
436 #define DefaultCplusplusDebugFlags OptimizedCplusplusDebugFlags
437 #endif
438 #ifndef DefaultCCOptions
439 #define DefaultCCOptions /* floating point, etc. */
440 #endif
441 #ifndef DefaultCplusplusOptions
442 #define DefaultCplusplusOptions /* floating point, etc. */
443 #endif
444 #ifndef NoRConst
445 #define NoRConst NO /* YES if const for structs of funcs is bad */
446 #endif
447 #ifndef InstPgmFlags
448 #define InstPgmFlags -s
449 #endif
450 #ifndef InstBinFlags
451 #define InstBinFlags -m 0755
452 #endif
453 #ifndef InstUidFlags
454 #define InstUidFlags -m 4711
455 #endif
456 #ifndef InstLibFlags
457 #define InstLibFlags -m 0644
458 #endif
459 #ifndef InstIncFlags
460 #define InstIncFlags -m 0444
461 #endif
462 #ifndef InstManFlags
463 #define InstManFlags -m 0444
464 #endif
465 #ifndef InstDatFlags
466 #define InstDatFlags -m 0444
467 #endif
468 #ifndef InstKmemFlags     /* put -g kmem -m 2711 in site.def... */
469 #define InstKmemFlags InstUidFlags
470 #endif
471 #ifndef ArCmdBase
472 #define ArCmdBase ar
473 #endif
474 #ifndef ArCmd
475 #if HasLargeTmp || SystemV4
476 #define ArCmd ArCmdBase cq
477 #else
478 #define ArCmd ArCmdBase clq
479 #endif
480 #endif
481 #ifndef ArAddCmd
482 #if HasLargeTmp || SystemV4
483 #define ArAddCmd ArCmdBase ru
484 #else
485 #define ArAddCmd ArCmdBase rul
486 #endif
487 #endif
488 #ifndef ArExtCmd
489 #if HasLargeTmp || SystemV4
490 #define ArExtCmd ArCmdBase x
491 #else
492 #define ArExtCmd ArCmdBase xl
493 #endif
494 #endif
495 #ifndef BootstrapCFlags
496 #define BootstrapCFlags /**/
497 #endif
498 #ifndef HasGcc2
499 #define HasGcc2 NO
500 #endif
501 #ifndef HasGcc
502 #define HasGcc HasGcc2
503 #endif
504 #ifndef HasGcc2ForCplusplus
505 #define HasGcc2ForCplusplus NO
506 #endif
507 #ifndef HasCenterLineC
508 #define HasCenterLineC NO
509 #endif
510 #ifndef HasCenterLineCplusplus
511 #define HasCenterLineCplusplus NO
512 #endif
513 #ifndef CcCmd
514 #if HasGcc2
515 #define CcCmd gcc -fpcc-struct-return 
516 #else
517 #if HasGcc
518 #define CcCmd gcc -fstrength-reduce -fpcc-struct-return 
519 #else
520 #if HasCenterLineC
521 #define CcCmd clcc
522 #else
523 #define CcCmd cc
524 #endif
525 #endif
526 #endif
527 #endif
528 #ifndef CplusplusCmd
529 #if HasGcc2ForCplusplus
530 #define CplusplusCmd g++
531 #else
532 #define CplusplusCmd CC
533 #endif
534 #endif
535 #ifndef CplusplusFilt
536 # define CplusplusFilt  c++filt
537 #endif
538 #ifndef CplusplusLibC
539 #define CplusplusLibC /**/
540 #endif
541 #ifndef CplusplusStandardDefines
542 #define CplusplusStandardDefines StandardDefines
543 #endif
544 #ifndef CplusplusExtraDefines
545 #define CplusplusExtraDefines /**/
546 #endif
547 #ifndef CplusplusExtraIncludes
548 #define CplusplusExtraIncludes /**/
549 #endif
550 #ifndef CplusplusDependIncludes
551 #define CplusplusDependIncludes /**/
552 #endif
553 #ifndef CplusplusOptions
554 #define CplusplusOptions /**/
555 #endif
556 #ifndef CplusplusSpecialOptions
557 #define CplusplusSpecialOptions /**/
558 #endif
559 #if HasFortran
560 #ifndef FortranCmd
561 #define FortranCmd f77
562 #endif
563 #ifndef FortranFlags
564 #define FortranFlags /**/
565 #endif
566 #ifndef FortranDebugFlags       /* for -O or -g */
567 #define FortranDebugFlags /**/
568 #endif
569 #endif
570 #ifndef AsCmd
571 #define AsCmd as
572 #endif
573 #ifndef CompressCmd
574 #define CompressCmd compress
575 #endif
576 #ifndef GzipCmd
577 #define GzipCmd gzip
578 #endif
579 #ifndef CppCmd
580 #define CppCmd /lib/cpp
581 #endif
582 #ifndef CppNoLineInfoOption
583 #define CppNoLineInfoOption /**/
584 #endif
585 #ifndef PreProcessCmd
586 #define PreProcessCmd CcCmd -E
587 #endif
588 #ifndef InstallCmd              /* hack should be in project */
589 #if SystemV || SystemV4
590 #ifdef UseInstalled             /* assume BINDIR in path */
591 #define InstallCmd bsdinst
592 #else
593 #define InstallCmd $(SHELL) $(CONFIGSRC)/util/bsdinst.sh
594 #endif
595 #else
596 #define InstallCmd install
597 #endif
598 #endif
599 #ifndef InstallFlags
600 #define InstallFlags -c
601 #endif
602 #ifndef LdCmd
603 #define LdCmd ld
604 #endif
605 #ifndef LexCmd
606 #define LexCmd lex
607 #endif
608 #ifndef LexLib
609 #define LexLib -ll
610 #endif
611 #ifndef YaccCmd
612 #define YaccCmd yacc
613 #endif
614 #ifndef CplusplusYaccCmd
615 #define CplusplusYaccCmd YaccCmd
616 #endif
617 #ifndef LintCmd
618 #define LintCmd lint
619 #endif
620 #ifndef LintLibFlag
621 #if SystemV || SystemV4
622 #define LintLibFlag -o
623 #else
624 #define LintLibFlag -C
625 #endif
626 #endif
627 #ifndef LintOpts
628 #if SystemV || SystemV4
629 #define LintOpts -bh
630 #else
631 #define LintOpts -axz
632 #endif
633 #endif
634 #ifndef CpCmd
635 #define CpCmd cp
636 #endif
637 #ifndef HasSymLinks
638 #define HasSymLinks YES
639 #endif
640 #ifndef LnCmd /* can use cp instead of ln if necessary */
641 #if HasSymLinks
642 #define LnCmd ln -s
643 #else
644 #define LnCmd ln
645 #endif
646 #endif
647 #ifndef MakeCmd
648 #define MakeCmd make
649 #endif
650 #ifndef MvCmd
651 #define MvCmd mv
652 #endif
653 #ifndef SedCmd
654 #define SedCmd sed
655 #endif
656 #ifndef PerlCmd
657 #define PerlCmd /usr/bin/perl
658 #endif
659 #ifndef RanlibCmd
660 #define RanlibCmd ranlib
661 #endif
662 #ifndef RanlibInstFlags
663 #define RanlibInstFlags /**/
664 #endif
665 #ifndef RmCmd
666 #define RmCmd rm -f
667 #endif
668 #ifndef StandardIncludes        /* for platform-specifics */
669 #define StandardIncludes /**/
670 #endif
671 #ifndef StandardDefines
672 #if SystemV
673 #define StandardDefines -DSYSV
674 #else
675 #if SystemV4
676 #define StandardDefines -DSVR4
677 #else
678 #define StandardDefines /**/
679 #endif
680 #endif
681 #endif
682 #ifndef StandardCppDefines
683 #define StandardCppDefines StandardDefines
684 #endif
685 #ifndef Malloc0ReturnsNull
686 #define Malloc0ReturnsNull NO
687 #endif
688 #if Malloc0ReturnsNull
689 #ifndef Malloc0ReturnsNullDefines
690 #define Malloc0ReturnsNullDefines -DMALLOC_0_RETURNS_NULL
691 #endif
692 #endif
693 #ifndef ToolkitStringsABIOptions
694 #define ToolkitStringsABIOptions /**/
695 #endif
696 #ifndef NdbmDefines
697 #if HasNdbm
698 #define NdbmDefines -DNDBM
699 #else
700 #define NdbmDefines /**/
701 #endif
702 #endif
703 #ifndef LdPreLib
704 #if !defined(UseInstalled)
705 #define LdPreLib -L$(BUILDLIBDIR)
706 #else
707 #if AlternateUsrLibDir
708 #define LdPreLib -L$(USRLIBDIR)
709 #else
710 #define LdPreLib /**/
711 #endif
712 #endif
713 #endif
714 #ifndef LdPostLib
715 #if !defined(UseInstalled) && AlternateUsrLibDir && !HasLdRunPath
716 #define LdPostLib -L$(USRLIBDIR)
717 #else
718 #define LdPostLib /**/
719 #endif
720 #endif
721 #ifndef MathLibrary
722 #define MathLibrary -lm
723 #endif
724 #ifndef DBMLibrary
725 #define DBMLibrary -ldbm
726 #endif
727 #ifndef DlLibrary
728 #define DlLibrary -ldl
729 #endif
730 #ifndef ExtraLibraries
731 #if SystemV4
732 #if HasSockets
733 #define ExtraLibraries -lsocket -lnsl -lw
734 #else
735 #define ExtraLibraries -lnsl -lw
736 #endif
737 #else
738 #define ExtraLibraries /**/
739 #endif
740 #endif
741 #ifndef ExtraLoadOptions
742 #define ExtraLoadOptions /**/
743 #endif
744 #ifndef ExtraLoadFlags
745 #define ExtraLoadFlags /**/
746 #endif
747 #ifndef LdCombineFlags
748 #if SystemV4
749 #define LdCombineFlags -r
750 #else
751 #define LdCombineFlags -X -r
752 #endif
753 #endif
754 #ifndef LdStripFlags
755 #define LdStripFlags -x
756 #endif
757 #ifndef TagsCmd
758 #define TagsCmd ctags
759 #endif
760 #ifndef LoaderLibPrefix
761 #define LoaderLibPrefix /**/
762 #endif
763 #ifndef ImakeCmd
764 #ifdef UseInstalled             /* assume BINDIR in path */
765 #define ImakeCmd imake
766 #else
767 #define ImakeCmd $(IMAKESRC)/imake
768 #endif
769 #endif
770 #ifndef DependCmd
771 #ifdef UseInstalled             /* assume BINDIR in path */
772 #define DependCmd makedepend
773 #else
774 #define DependCmd $(DEPENDSRC)/makedepend
775 #endif
776 #endif
777 #ifndef DependFlags
778 #define DependFlags /**/
779 #endif
780 #ifndef DependFileName
781 #define DependFileName Makefile.dep
782 #endif
783 #ifndef ExportListCmd
784 # ifndef ExportListGenSource
785 #  define ExportListCmd         /**/
786 # elif !defined(UseInstalled)
787 #  define ExportListCmd         $(CONFIGSRC)/util/exportlistgen
788 # else
789 #  define ExportListCmd         exportlistgen
790 # endif
791 #endif
792 #ifndef MkdirHierCmd
793 #ifdef UseInstalled             /* assume BINDIR in path */
794 #define MkdirHierCmd mkdirhier
795 #else
796 #define MkdirHierCmd $(SHELL) $(CONFIGSRC)/util/mkdirhier.sh
797 #endif
798 #endif
799 #ifndef TroffCmd
800 #define TroffCmd psroff
801 #endif
802 #ifndef NroffCmd
803 #define NroffCmd nroff
804 #endif
805 #ifndef MsMacros
806 #define MsMacros -ms
807 #endif
808 #ifndef ManMacros
809 #define ManMacros -man
810 #endif
811 #ifndef TblCmd
812 #define TblCmd tbl
813 #endif
814 #ifndef EqnCmd
815 #define EqnCmd eqn
816 #endif
817 #ifndef NeqnCmd
818 #define NeqnCmd neqn
819 #endif
820 #ifndef ColCmd
821 #define ColCmd col
822 #endif
823 #ifndef DvipsCmd
824 #define DvipsCmd dvips
825 #endif
826 #ifndef LatexCmd
827 #define LatexCmd latex
828 #endif
829 #if HasSentinel
830 #ifndef SentinelCmd
831 #define SentinelCmd sentinel
832 #endif
833 #ifndef SentinelOptions
834 #define SentinelOptions /**/
835 #endif
836 #endif
837 #if HasPurify
838 #ifndef PurifyCmd
839 #define PurifyCmd purify
840 #endif
841 #ifndef PurifyOptions
842 #define PurifyOptions /**/
843 #endif
844 #endif
845 #if HasTestCenter
846 #ifndef ProofCmd
847 #define ProofCmd proof
848 #endif
849 #ifndef ProofOptions
850 #define ProofOptions /**/
851 #endif
852 #endif
853 #ifndef PathSeparator
854 #define PathSeparator /
855 #endif
856 #ifndef Osuf
857 #define Osuf o
858 #endif
859 #ifndef CCsuf
860 #define CCsuf cc
861 #endif
862 #ifndef ManSuffix
863 #define ManSuffix       n               /* use just one tab or cpp will die */
864 #endif
865 #ifndef LibManSuffix
866 #define LibManSuffix    3               /* use just one tab or cpp will die */
867 #endif
868 #ifndef FileManSuffix
869 #if SystemV || SystemV4 || defined(OSF1Architecture)
870 #define FileManSuffix   4               /* use just one tab or cpp will die */
871 #else
872 #define FileManSuffix   5               /* use just one tab or cpp will die */
873 #endif
874 #endif
875 #ifndef MiscManSuffix
876 #if SystemV || SystemV4 || defined(OSF1Architecture)
877 #define MiscManSuffix   5               /* use just one tab or cpp will die */
878 #else
879 #define MiscManSuffix   7               /* use just one tab or cpp will die */
880 #endif
881 #endif
882 #ifndef ExpandManNames
883 #if SystemV
884 #define ExpandManNames NO
885 #else
886 #define ExpandManNames YES
887 #endif
888 #endif
889 #ifndef TOPDIR
890 #define TOPDIR .
891 #endif
892 #ifndef CURDIR
893 #define CURDIR .
894 #endif
895 #ifndef SiteIConfigFiles
896 #define SiteIConfigFiles /**/
897 #endif
898 #ifndef ExtraFilesToClean
899 #define ExtraFilesToClean /**/
900 #endif
901 #ifndef FilesToClean
902 #define FilesToClean *.CKP *.ln *.BAK *.bak *.Osuf core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut 
903 #endif
904
905           PATHSEP = PathSeparator
906             SHELL = BourneShell
907         KORNSHELL = KornShell
908       DTKORNSHELL = DtKornShell
909
910               TOP = TOPDIR
911       CURRENT_DIR = CURDIR
912
913             IMAKE = ImakeCmd
914            DEPEND = DependCmd
915         MKDIRHIER = MkdirHierCmd
916     EXPORTLISTGEN = ExportListCmd
917         CONFIGSRC = ConfigSrc
918          IMAKESRC = $(CONFIGSRC)/imake
919         DEPENDSRC = DependDir
920     DEPENDDEFINES = DependDefines
921
922           INCROOT = IncRoot             /* base of where to put header files */
923         USRLIBDIR = UsrLibDir           /* nonshared libraries */
924          SHLIBDIR = ShLibDir            /* shared libraries */
925        LINTLIBDIR = LintlibDir          /* lint libraries */
926           MANPATH = ManPath             /* top of manual page tree */
927     MANSOURCEPATH = ManSourcePath       /* prefix for man page sources */
928            MANDIR = ManDir              /* man pages for commands */
929         LIBMANDIR = LibmanDir           /* man pages for library routines */
930        FILEMANDIR = FileManDir          /* man pages for config files */
931        MISCMANDIR = MiscManDir          /* man pages for miscellaneous files */
932
933                AR = ArCmd
934   BOOTSTRAPCFLAGS = BootstrapCFlags     /* set if cpp does not have uniq sym */
935                CC = CcCmd
936                AS = AsCmd
937 #if HasFortran
938                FC = FortranCmd
939       FDEBUGFLAGS = FortranDebugFlags
940           FCFLAGS = FortranFlags $(FDEBUGFLAGS)
941 #endif
942 #if HasCplusplus
943
944 .SUFFIXES: .CCsuf
945
946               CXX = CplusplusCmd
947           CXXFILT = CplusplusFilt
948            CXXLIB = CplusplusLibC
949     CXXDEBUGFLAGS = DefaultCplusplusDebugFlags
950 CXXDEPENDINCLUDES = CplusplusDependIncludes
951  CXXEXTRA_DEFINES = CplusplusExtraDefines
952 CXXEXTRA_INCLUDES = CplusplusExtraIncludes
953    CXXSTD_DEFINES = CplusplusStandardDefines $(CXXPROJECT_DEFINES)
954        CXXOPTIONS = CplusplusOptions
955       CXXINCLUDES = $(INCLUDES) $(TOP_INCLUDES) $(CXXEXTRA_INCLUDES) 
956        CXXDEFINES = $(CXXINCLUDES) $(CXXSTD_DEFINES) $(THREADS_CXXDEFINES) $(CXXEXTRA_DEFINES) $(DEFINES)
957          CXXFLAGS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(THREADS_CXXFLAGS) $(CXXDEFINES)
958 #endif
959          COMPRESS = CompressCmd
960           GZIPCMD = GzipCmd
961               CPP = CppCmd $(STD_CPP_DEFINES)           /* simple filters */
962     PREPROCESSCMD = PreProcessCmd $(STD_CPP_DEFINES)    /* prefered; mdep */
963           INSTALL = InstallCmd
964      INSTALLFLAGS = InstallFlags
965                LD = LdCmd
966               LEX = LexCmd
967            LEXLIB = LexLib
968              YACC = YaccCmd
969            CCYACC = CplusplusYaccCmd
970              LINT = LintCmd
971       LINTLIBFLAG = LintLibFlag
972          LINTOPTS = LintOpts
973                LN = LnCmd
974              MAKE = MakeCmd
975                MV = MvCmd
976                CP = CpCmd
977               SED = SedCmd
978              PERL = PerlCmd
979 #if DoRanlibCmd
980            RANLIB = RanlibCmd
981   RANLIBINSTFLAGS = RanlibInstFlags
982 #endif
983                RM = RmCmd
984         MANSUFFIX = ManSuffix           /* suffix for command man pages */
985      LIBMANSUFFIX = LibManSuffix        /* suffix for library man pages */
986     FILEMANSUFFIX = FileManSuffix       /* suffix for file format man pages */
987     MISCMANSUFFIX = MiscManSuffix       /* suffix for misc man pages */
988
989             TROFF = TroffCmd
990             NROFF = NroffCmd
991          MSMACROS = MsMacros
992         MANMACROS = ManMacros
993               TBL = TblCmd
994               EQN = EqnCmd
995              NEQN = NeqnCmd
996               COL = ColCmd
997 #if HasLatex
998             DVIPS = DvipsCmd
999             LATEX = LatexCmd
1000 #endif
1001 #if HasSentinel
1002          SENTINEL = SentinelCmd
1003   SENTINELOPTIONS = SentinelOptions
1004 #endif
1005 #if HasPurify
1006            PURIFY = PurifyCmd
1007     PURIFYOPTIONS = PurifyOptions
1008 #endif
1009 #if HasTestCenter
1010            PROOF = ProofCmd
1011     PROOFOPTIONS = ProofOptions
1012 #endif
1013      STD_INCLUDES = StandardIncludes
1014   STD_CPP_DEFINES = StandardCppDefines $(PROJECT_DEFINES)
1015       STD_DEFINES = StandardDefines $(PROJECT_DEFINES)
1016  EXTRA_LOAD_FLAGS = ExtraLoadFlags
1017   EXTRA_LDOPTIONS = ExtraLoadOptions
1018   EXTRA_LIBRARIES = ExtraLibraries Krb5Libraries
1019              TAGS = TagsCmd
1020 #if ConstructMFLAGS
1021            MFLAGS = -$(MAKEFLAGS)
1022 #endif
1023 #if ConstructMAKEFLAGS
1024         MAKEFLAGS = $(MFLAGS)
1025 #endif
1026 #if HasSharedLibraries
1027     SHAREDCODEDEF = SharedCodeDef
1028          SHLIBDEF = SharedLibraryDef
1029 #ifdef SharedLibraryLoadFlags
1030      SHLIBLDFLAGS = SharedLibraryLoadFlags
1031 #endif
1032 /*
1033  * Here we set up flags needed to produce position-independent code 
1034  * when doing C and C++ compilation.  The default if you specify C
1035  * PIC flags without also specifying C++ PIC flags is to assume that 
1036  * the C flags work for both.  If your C++ compiler requires different
1037  * flags, specify them explicitly in PositionIndependentCplusplusFlags.
1038  */
1039 #ifdef PositionIndependentCFlags
1040          PICFLAGS = PositionIndependentCFlags
1041 #endif
1042 #ifdef PositionIndependentCplusplusFlags
1043       CXXPICFLAGS = PositionIndependentCplusplusFlags
1044 #else
1045 #ifdef PositionIndependentCFlags
1046       CXXPICFLAGS = PositionIndependentCFlags
1047 #endif
1048 #endif
1049 #endif
1050 #if !HasVoidSignalReturn
1051    SIGNAL_DEFINES = -DSIGNALRETURNSINT
1052 #endif
1053 /*
1054  * The following supports forcing of function prototypes
1055  */
1056 #if NeedFunctionPrototypes && NeedVarargsPrototypes && NeedConstPrototypes && NeedNestedPrototypes
1057 #define _funcprotodef -DFUNCPROTO=15
1058 #else
1059 #if NeedFunctionPrototypes && NeedVarargsPrototypes && NeedNestedPrototypes
1060 #define _funcprotodef -DFUNCPROTO=11
1061 #else
1062 #if NeedFunctionPrototypes && NeedNestedPrototypes
1063 #define _funcprotodef -DFUNCPROTO=9
1064 #else
1065 #if NeedFunctionPrototypes && NeedVarargsPrototypes && NeedConstPrototypes
1066 #define _funcprotodef -DFUNCPROTO=7
1067 #else
1068 #if NeedFunctionPrototypes && NeedConstPrototypes
1069 #define _funcprotodef -DFUNCPROTO=5
1070 #else
1071 #if NeedFunctionPrototypes && NeedVarargsPrototypes
1072 #define _funcprotodef -DFUNCPROTO=3
1073 #else
1074 #if NeedFunctionPrototypes
1075 #define _funcprotodef -DFUNCPROTO
1076 #else
1077 #define _funcprotodef /**/
1078 #endif
1079 #endif
1080 #endif
1081 #endif
1082 #endif
1083 #endif
1084 #endif
1085 #if NeedWidePrototypes
1086 #define _wideprotodef /**/
1087 #else
1088 #define _wideprotodef -DNARROWPROTO
1089 #endif
1090     PROTO_DEFINES = _funcprotodef _wideprotodef 
1091 #undef _funcprotodef
1092 #undef _wideprotodef
1093
1094 #if StripInstalledPrograms
1095      INSTPGMFLAGS = InstPgmFlags        /* install flags for stripping */
1096 #else
1097      INSTPGMFLAGS = 
1098 #endif
1099      INSTBINFLAGS = InstBinFlags        /* install flags for programs */
1100      INSTUIDFLAGS = InstUidFlags        /* install flags for setuid programs */
1101      INSTLIBFLAGS = InstLibFlags        /* install flags for libraries */
1102      INSTINCFLAGS = InstIncFlags        /* install flags for headers */
1103      INSTMANFLAGS = InstManFlags        /* install flags for man pages */
1104      INSTDATFLAGS = InstDatFlags        /* install flags for data files */
1105     INSTKMEMFLAGS = InstKmemFlags       /* install flags for /dev/kmem progs */
1106
1107 #ifdef ProjectRoot
1108       PROJECTROOT = ProjectRoot
1109 #endif
1110 #ifdef UseInstalled
1111 # if AlternateIncRoot
1112 #  define TopInclude    -I$(INCROOT)
1113 # else
1114 #  define TopInclude    /**/
1115 # endif
1116 #else
1117 # define TopInclude     -I$(TOP)
1118 #endif
1119       CDEBUGFLAGS = DefaultCDebugFlags
1120         CCOPTIONS = DefaultCCOptions    /* to distinguish from param flags */
1121 /*
1122  * STD_INCLUDES contains system-specific includes
1123  * TOP_INCLUDES specifies how to get to /usr/include or its build substitute
1124  * EXTRA_INCLUDES contains project-specific includes set in project incfiles
1125  * INCLUDES contains client-specific includes set in Imakefile
1126  * LOCAL_LDFLAGS contains client-specific ld flags flags set in Imakefile
1127  */
1128       ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
1129        ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES)
1130            CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(ALLDEFINES)
1131         LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
1132          LDPRELIB = LdPreLib
1133         LDPOSTLIB = LdPostLib
1134         LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)  $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
1135      CXXLDOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
1136
1137            LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
1138 #if HasBrokenCCForLink
1139            CCLINK = LdCmd
1140 #else
1141 #if AlternateUsrLibDir && HasLdRunPath
1142        CCENVSETUP = LD_RUN_PATH=$(USRLIBDIRPATH)
1143            CCLINK = $(CCENVSETUP) $(CC)
1144 #else
1145            CCLINK = $(CC)
1146 #endif
1147 #endif
1148 #if AlternateUsrLibDir && HasLdRunPath
1149       CXXENVSETUP = LD_RUN_PATH=$(USRLIBDIRPATH)
1150           CXXLINK = $(CXXENVSETUP) $(CXX)
1151 #else
1152           CXXLINK = $(CXX)
1153 #endif
1154      LDSTRIPFLAGS = LdStripFlags
1155    LDCOMBINEFLAGS = LdCombineFlags
1156       DEPENDFLAGS = DependFlags
1157
1158         MACROFILE = MacroFile
1159            RM_CMD = $(RM)
1160
1161     IMAKE_DEFINES = /* leave blank, for command line use only */
1162 #ifdef UseInstalled
1163          IRULESRC = $(CONFIGDIR)        /* used in rules file */
1164         IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
1165 #else
1166          IRULESRC = $(CONFIGSRC)/cf
1167         IMAKE_CMD = $(IMAKE) -I$(IRULESRC) $(IMAKE_DEFINES)
1168 #endif
1169 #if !HasClearmake
1170      /* clearmake records relevant defines and flags in the build script,
1171         so it knows when they change and we don't need this coarser-level
1172         dependency.  We also don't want it, since it prevents sharing if
1173         even one config file, say site.def or host.def, changes. */
1174      ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/X11.tmpl \
1175                         $(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE) \
1176                         SiteIConfigFiles $(EXTRA_ICONFIGFILES)
1177 #endif
1178
1179 #ifndef TopLevelProject
1180 # define TopLevelProject        X11
1181 #endif
1182 #ifndef ProjectRulesFile
1183 # define ProjectRulesFile       Concat3(<,TopLevelProject,.rules>)
1184 #endif
1185 #include ProjectRulesFile
1186 #ifndef LocalRulesFile
1187 /* need this to make ANSI-style preprocessors happy */
1188 #define LocalRulesFile <noop.rules>
1189 #endif
1190 #include LocalRulesFile
1191
1192 /*
1193  * get project-specific configuration and rules
1194  */
1195 #ifndef ProjectTmplFile
1196 #define ProjectTmplFile         Concat3(<,TopLevelProject,.tmpl>)
1197 #endif
1198 #include ProjectTmplFile
1199 #ifndef LocalTmplFile
1200 /* need this to make ANSI-style preprocessors happy */
1201 #define LocalTmplFile <noop.rules>
1202 #endif
1203 #include LocalTmplFile
1204
1205 #ifdef FixupLibReferences
1206 FixupLibReferences()
1207 #endif
1208
1209 /* ConfigDir comes from X11.tmpl */
1210         CONFIGDIR = ConfigDir           /* build configuration information */
1211 #if HasClearmake
1212            OSNAME = OSName
1213 #endif
1214     USRLIBDIRPATH = UsrLibDirPath
1215         LDPRELIBS = LdPreLibs
1216        LDPOSTLIBS = LdPostLibs
1217      TOP_INCLUDES = TopIncludes
1218   PROJECT_DEFINES = ProjectDefines
1219 #if HasCplusplus
1220 CXXPROJECT_DEFINES = CplusplusProjectDefines
1221 #endif
1222
1223 XCOMM ----------------------------------------------------------------------
1224 XCOMM start of Imakefile
1225 #include INCLUDE_IMAKEFILE
1226
1227 XCOMM ----------------------------------------------------------------------
1228 XCOMM common rules for all Makefiles - do not edit
1229
1230 .c.i:
1231         CPPOnlyCompile($*.c,$(_NOOP_))
1232 /*
1233  * These need to be here so that rules in Imakefile occur first;  the blank
1234  * emptyrule is to make sure that an empty Imakefile does not default to make
1235  * clean.
1236  */
1237 emptyrule::
1238
1239 CleanTarget()
1240
1241 #ifndef IHaveSpecialMakefileTarget
1242 MakefileTarget()
1243 #endif
1244
1245 TagsTarget()
1246 #ifdef MakefileAdditions
1247 MakefileAdditions()
1248 #endif
1249
1250 CenterLoadTarget(debug_src,$(SRCS),NullParameter,$(ALLDEFINES))
1251
1252 CenterLoadTarget(debug_obj,$(OBJS),NullParameter,$(ALLDEFINES))
1253
1254 ManKeywordsTarget($(MANPATH))
1255
1256 #ifdef IHaveSubdirs
1257 XCOMM ----------------------------------------------------------------------
1258 XCOMM rules for building in SUBDIRS - do not edit
1259
1260 InstallSubdirs($(SUBDIRS))
1261 InstallManSubdirs($(SUBDIRS))
1262 InstallLinkKitSubdirs($(SUBDIRS))
1263 CleanSubdirs($(SUBDIRS))
1264 TagSubdirs($(SUBDIRS))
1265 MakefileSubdirs($(SUBDIRS))
1266 IncludesSubdirs($(SUBDIRS))
1267
1268 #endif
1269
1270 /* must be after all install.man rules that install anything */
1271 #if MakeManKeywords             /* typically only at top level */
1272 install.man:: man_keywords
1273 #endif
1274
1275 #ifndef IHaveSubdirs
1276 XCOMM ----------------------------------------------------------------------
1277 XCOMM empty rules for directories that do not have SUBDIRS - do not edit
1278
1279 install::
1280         @echo "install in $(CURRENT_DIR) done"
1281
1282 install.man::
1283         @echo "install.man in $(CURRENT_DIR) done"
1284
1285 install.linkkit::
1286         @echo "install.linkkit in $(CURRENT_DIR) done"
1287
1288 Makefiles::
1289
1290 includes::
1291
1292 depend::
1293
1294 #endif /* if subdirectory rules are needed */
1295
1296 XCOMM ----------------------------------------------------------------------
1297 XCOMM dependencies generated by makedepend
1298 IncludeMakefile(DependFileName)