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