Since intr has been setup in the last step of vr_attach(), mii_phy_probe()
[dragonfly.git] / contrib / tcsh / Imakefile
1 XCOMM
2 XCOMM $Id: Imakefile,v 1.81 2002/07/23 16:18:31 christos Exp $
3 XCOMM
4 XCOMM Imakefile for tcsh 6.12
5 XCOMM Marc Horowitz, MIT SIPB
6 XCOMM
7
8 #ifdef DestDir
9 #undef DestDir
10 #endif
11 #ifdef ManSuffix
12 #undef ManSuffix
13 #endif
14
15 /* All config options go in a separate file. */
16
17 #include "imake.config"
18
19 #ifndef HasGcc
20 # define HasGcc 0
21 #endif
22
23 #ifndef HasGcc2
24 # define HasGcc2 0
25 #endif
26
27 /* This is a giant conditional block.  It should be set up right for
28 platforms which are in here, but it may need to be changed for new
29 ones.  Please send in your fixes and additions! */
30
31 /**** tcsh configuration defines ****/
32
33 /* specific platforms */
34
35 #ifndef ConfigH
36 # ifdef UltrixArchitecture
37 #  define ConfigH ultrix
38 # endif
39
40 # ifdef UxpArchitecture
41 #  define ConfigH sysv4
42 # endif
43
44 # ifdef LinuxArchitecture
45 #  define ConfigH linux
46 # endif
47
48 # ifdef AlphaArchitecture
49 #  ifndef LinuxArchitecture
50 #    define ConfigH decosf1
51 #  endif
52 #  if !HasGcc
53 #   define MyCflags -std1 -Olimit 2000
54 #  else
55 #   define NoCombineRegs
56 #  endif
57 # endif
58
59 # if defined(VaxArchitecture) && !defined(UltrixArchitecture)
60 #  define ConfigH bsd
61 # endif
62
63 # ifdef NeXTArchitecture
64 #  define ConfigH mach
65 # endif
66
67 # if defined(SunArchitecture)
68 #  if (OSMajorVersion == 3)
69 #   define ConfigH sunos35
70 #  else
71 #   if (OSMajorVersion == 4)
72 #    if (OSMinorVersion == 0)
73 #     define ConfigH sunos40
74 #    else /* OSMinorVersion == 1 */
75 #     if (OSTeenyVersion == 3)
76 #      define ConfigH sunos413
77 #     else /* OsTeenyVersion in [0,1,2] */
78 #      define ConfigH sunos41
79 #     endif
80 #    endif
81 #    define NoCombineRegs
82 #   else /* OSMajorVersion == 5 */
83 #    if (OSMinorVersion < 3)
84 #     if (OSMinorVersion < 2)
85 #      define ConfigH sol2
86 #     else
87 #      define ConfigH sol22
88 #     endif
89 #    else
90 #     if (OSMinorVersion < 4)
91 #      define ConfigH sol23
92 #     else
93 #      if (OSMinorVersion < 6)
94 #       define ConfigH sol24
95 #      else
96 #       define ConfigH sol26
97 #      endif
98 #     endif
99 #    endif
100 #    define NoCombineRegs
101 #   endif
102 #  endif
103 # endif
104
105 # ifdef HPArchitecture
106 /* For some stupid reason makedepend on HP requires this */
107 DEPENDFLAGS = -o.o
108 #  if (OSMajorVersion >= 8)
109 #   define ConfigH hpux8
110 #  else
111 #   define ConfigH hpux7
112 #  endif
113 # endif
114
115 # ifdef CrayArchitecture
116 #  define ConfigH cray
117 # endif
118
119 # ifdef SGIArchitecture
120 #   define ConfigH irix
121 #   define UseLibBSD
122 #  if (OSMajorVersion < 5)
123 #   ifdef you_are_using_yp
124 #    define UseSunLib 
125 #   endif
126 #   if !HasGCC
127 #    define MyStdc -D__STDC__
128 #    if SGICompilerMajorVersion < 4
129 CCOPTIONS=-float        # We don't want -cckr and -prototypes
130 #    endif
131 #   endif
132 #  endif
133 #  if (OSMajorVersion == 6)
134 #   if (OSMinorVersion >= 2)
135 #    undef UseLibBSD
136 #    define ConfigH irix62
137 #   endif
138 #  endif
139 # endif
140
141 # ifdef IBMArchitecture
142 #  undef UseLibBSD
143 #  if (SystemV == YES)
144 #   define ConfigH aix
145 #   if OSMajorVersion < 3 
146 #    if OSMinorVersion < 2
147 #     define UseLibBSD
148 #    endif
149 #   endif
150 #  else
151 #   define ConfigH bsd
152 #   define AOSArchitecture
153 #  endif
154 # endif
155
156
157 #ifdef AOSArchitecture
158 #define MyStdc -U__STDC__
159 #endif
160
161 # if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture)
162 #  define ConfigH mips
163 # endif
164
165 # ifdef DguxArchitecture
166 #  define ConfigH dgux
167 # endif
168
169 # ifdef ConvexArchitecture
170 #  define ConfigH convex
171 # endif
172
173 # if defined(SQNTArchitecture) || defined(SequentArchitecture)
174 #  define ConfigH sequent
175 # endif
176
177 # ifdef MacIIArchitecture
178 #  define ConfigH mac2
179 # endif
180
181 # ifdef MinixArchitecture
182 /* Maybe conditional on MACH? */
183 SYSSRCS=mi.termios.c mi.wait.h mi.varargs.h
184 SYSOBJS=mi.termios.${SUF}
185 EXTF=ma.setp.c vms.termcap.c
186 # else
187 /* Maybe conditional on MACH? */
188 SYSSRCS=ma.setp.c
189 SYSOBJS=ma.setp.${SUF}
190 EXTF=mi.termios.c mi.wait.h mi.varargs.h vms.termcap.c
191 # endif
192
193 # ifdef i386Isc
194 #  if IscVersion != 202
195 #   define ConfigH isc
196 #   define UseLibCposix
197 #  else
198 #   define ConfigH isc202
199 #  endif
200 # endif /* i386Isc */
201
202 # ifdef OpenBSDArchitecture
203 #  define ConfigH bsd4.4
204 # endif /* OpenBsdArchitecture */
205
206 # ifdef NetBSDArchitecture
207 #  define ConfigH bsd4.4
208 # endif /* NetBsdArchitecture */
209
210 # ifdef FreeBSDArchitecture
211 #  define ConfigH bsd4.4
212 # endif /* FreeBsdArchitecture */
213
214 # ifdef i386SVR4Architecture
215 #  define ConfigH sysv4
216 #  ifdef DELL
217 #   define NoCombineRegs
218 #  endif
219 # endif
220
221 #endif /* !ConfigH */
222
223 /* generic os's */
224
225 #ifndef ConfigH
226
227 #if (SystemV == YES)
228 #define ConfigH sysv3
229 #else
230 /* why this as a default?  Why not? */
231 #define ConfigH bsd
232 #endif
233
234 #endif /* !ConfigH */
235
236 /**** libraries ****/
237
238 #if (SystemV == NO) || defined(HPArchitecture) || \
239         defined(SQNTArchitecture) || defined(SequentArchitecture) || \
240         defined(MacIIArchitecture) || defined(UseLibTermcap)
241 LIBTERMCAP = -ltermcap
242 #else
243 LIBTERMCAP =
244 #endif
245
246 #if defined(SQNTArchitecture) || defined(SequentArchitecture)
247 LIBSQNT=-lsocket -linet -lnsl -lseq
248 #endif
249
250 /* This may not be good enough - I don't have access to enough systems
251 to really test it. */
252 #if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture)
253 LIBCURSES = -lcurses
254 #else
255 LIBCURSES =
256 #endif
257
258 #if defined(UseLibNet)
259 LIBNET = -lnet
260 #else
261 LIBNET =
262 #endif
263
264 #if defined(UseLibSocket)
265 LIBSOCKET = -lsocket
266 #else
267 LIBSOCKET =
268 #endif
269
270 #if defined(UseLibBSD)
271 LIBBSD = -lbsd
272 #else
273 LIBBSD = 
274 #endif
275
276 #if (defined(SGIArchitecture) && \
277      (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \
278         defined(UseLibC_S)
279 LIBC_S = -lc_s
280 #else
281 LIBC_S =
282 #endif
283
284 #if defined(UseLibSun)
285 LIBSUN = -lsun
286 #else
287 LIBSUN =
288 #endif
289
290 #if defined(UseLibCposix)
291 LIBCPOSIX = -lcposix
292 #else
293 LIBCPOSIX =
294 #endif
295
296 #if defined(UseLibInet)
297 LIBINET = -linet
298 #else
299 LIBINET =
300 #endif
301
302 #if defined(UseLibDir)
303 LIBDIRECT = -ldir
304 #else
305 LIBDIRECT = 
306 #endif
307
308 #if defined(UseLibX)
309 LIBX = -lx
310 #else
311 LIBX =
312 #endif
313
314 #if defined(UseLibIntl)
315 LIBINTL = -lintl
316 #else
317 LIBINTL =
318 #endif
319
320 #if (HasLibCrypt == YES)
321 LIBCRYPT = -lcrypt
322 #else
323 LIBCRYPT =
324 #endif
325
326 #if defined(MacIIArchitecture) || defined(UseLibPosix)
327 LIBPOSIX = -lposix
328 #else
329 LIBPOSIX =
330 #endif
331
332 #if defined(ATTArchitecture) || defined(UseLibDirent)
333 LIBDIRECTENT = -ldirent
334 #else
335 LIBDIRECTENT =
336 #endif
337
338 /* The order here is significant.  Although nothing uses all of these, 
339 some platforms which use more than one do care about the order. */
340
341 SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \
342         $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \
343         $(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT) $(LIBCRYPT)
344
345 /* Past here, nothing should need to be changed to compile on a different
346 platform, unless you have a really weird architecture. */
347
348 #ifdef MyCC
349 CC = MyCC
350 #else
351 # if HasGcc
352 #  if HasGcc2
353 CC = gcc 
354 #  else
355 #   ifdef NoCombineRegs
356 CC = gcc -finline-functions -fstrength-reduce
357 #   else
358 CC = gcc -fcombine-regs -finline-functions -fstrength-reduce
359 #   endif
360 #  endif
361 # else
362 CC = cc
363 # endif
364 #endif
365
366 #ifdef HESIOD
367 HESLIB = -L/usr/athena/lib -lhesiod
368 /* it seems to me that the -I shouldn't be necessary, but there seems
369 to be a bug in the Imake stuff, so here it is. */
370 HESDEF = -DHESIOD -I/usr/athena/include
371 #else
372 HESLIB =
373 HESDEF =
374 #endif
375
376 #ifdef AFS
377 #ifndef AFSDIR
378 AFSDIR = /usr/afsws
379 #endif
380 #ifdef AFS33
381 #define AFS33LIB -laudit
382 #else
383 #define AFS33LIB
384 #endif
385 /* Auxilliary libs needed for AFS */
386 /* Both HPUX and Solaris need the BSD libraries.  We need -lc before
387  * the bsd library to avoid using any more of it than is necessary.
388  */
389 #if defined(HPArchitecture)
390 #define AFSAUXLIB -lc -lBSD
391 /* This is probably a kludge, but so is imake. */
392 #else
393 #if defined(SunArchitecture) && (OSMajorVersion == 5)
394 #define AFSAUXLIB -lsocket -lnsl -lc -lucb
395 #else
396 #define AFSAUXLIB
397 #endif
398 #endif /* AFSAUXLIB */
399 AFSLIB = -L$(AFSDIR)/lib -L$(AFSDIR)/lib/afs -lkauth -lprot -lubik\
400          -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\
401          $(AFSDIR)/lib/afs/util.a AFS33LIB AFSAUXLIB
402 AFSDEF = -DAFS -I$(AFSDIR)/include
403 #else
404 AFSLIB =
405 AFSDEF =
406 #endif
407
408 /* This is encore specific, but I don't know what encore's #define is,
409 and it shouldn't hurt to have it here, so here it is */
410 PARALLEL=12                             # Make the multi-max run fast.
411
412 #ifndef TcshTop
413 #define TcshTop /usr/local
414 #endif
415 TCSHTOP = TcshTop
416
417 #ifndef ManSuffix
418 #define ManSuffix 1
419 #endif
420 MANSUFFIX = ManSuffix
421
422 #ifdef TcshPath
423 PATH_TCSHELL = TcshPath
424 TCSHPATH = -D_PATH_TCSHELL='"$(PATH_TCSHELL)"'
425 #else
426 TCSHPATH =
427 #endif
428
429 #ifdef DestBin
430 TCSH_BINDIR = DestBin
431 #else
432 TCSH_BINDIR = $(TCSHTOP)/bin
433 #endif
434 #ifdef DestMan
435 TCSH_MANDIR = DestMan
436 #else
437 TCSH_MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX)
438 #endif
439
440 LOCALLIBS =
441
442 #ifndef MyCflags
443 #define MyCflags
444 #endif
445
446 #ifndef MyDefines
447 #define MyDefines
448 #endif
449
450 #ifndef MyIncludes
451 #define MyIncludes
452 #endif
453
454 #ifndef MyStdc
455 #define MyStdc
456 #endif
457
458 #ifdef CDebugFlags
459 CDEBUGFLAGS = CDebugFlags
460 #else
461 # if HasGcc2
462 CDEBUGFLAGS = -O2
463 # else
464 CDEBUGFLAGS = -O
465 # endif
466 #endif
467
468
469 #ifdef HostType
470 HOSTTYPE=HostType
471 HTDEF = -DHOSTTYPE='"$(HOSTTYPE)"'
472 #else
473 HTDEF =
474 #endif
475
476 DEFINES = $(TCSHPATH) $(HESDEF) $(AFSDEF) $(HTDEF) MyDefines MyCflags MyStdc
477 INCLUDES = -I. MyIncludes
478 #ifdef MyLibs
479 LDLIBS = MyLibs
480 #endif
481
482 SUF = o
483 VERSION = 6.12
484
485 SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
486         sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
487         sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
488         sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \
489         sh.decls.h glob.c glob.h ${SYSSRCS}
490 SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
491         sh.char.${SUF} sh.exp.${SUF} sh.func.${SUF} sh.glob.${SUF} \
492         sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} sh.misc.${SUF} \
493         sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} sh.sem.${SUF} \
494         sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS}
495
496 TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
497         tw.comp.c tw.color.c
498 TWOBJS= tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
499         tw.comp.${SUF} tw.color.${SUF}
500
501 EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
502         ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
503 EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
504         ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
505
506 TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
507         tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
508         tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
509         tc.who.c tc.h 
510 TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
511         tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
512         tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
513         tc.vers.${SUF} tc.who.${SUF} 
514
515 MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
516         WishList config_f.h eight-bit.me glob.3 patchlevel.h \
517         pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
518         README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \
519         snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.in \
520         Makefile.win32
521 CONFSRCS=config/[a-z]*
522
523
524 SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS)
525 OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS)
526
527 ALLSRCS= $(MISCF) $(SRCS) $(EXTF)
528
529 AllTarget(tcsh)
530
531 ed.defns.h: config.h ed.defns.c
532         @rm -f $@
533         @echo '/* Do not edit this file, make creates it. */' > $@
534         @echo '#ifndef _h_ed_defns' >> $@
535         @echo '#define _h_ed_defns' >> $@
536         egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
537         @echo '#endif /* _h_ed_defns */' >> $@
538
539 sh.err.h: config.h sh.err.c
540         @rm -f $@
541         @echo '/* Do not edit this file, make creates it. */' > $@
542         @echo '#ifndef _h_sh_err' >> $@
543         @echo '#define _h_sh_err' >> $@
544         egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
545         @echo '#endif /* _h_sh_err */' >> $@
546
547 tc.const.h: config.h tc.const.c
548         @rm -f $@
549         @echo '/* Do not edit this file, make creates it. */' > $@
550         @echo '#ifndef _h_tc_const' >> $@
551         @echo '#define _h_tc_const' >> $@
552         ${CC} -E $(INCLUDES) ${DEFINES} -D_h_tc_const tc.const.c | \
553             grep 'Char STR' | \
554             sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \
555             sort >> $@
556         @echo '#endif /* _h_tc_const */' >> $@
557
558 config.h: config_f.h
559         cp config/ConfigH config.h
560
561 $(OBJS): sh.err.h tc.const.h ed.defns.h
562
563 tar.Z:
564         rm -f tcsh-${VERSION}.tar.Z
565         rm -rf tcsh-${VERSION} 
566         mkdir tcsh-${VERSION} tcsh-${VERSION}/config
567         cp ${ALLSRCS} tcsh-${VERSION}
568         cp ${CONFSRCS} tcsh-${VERSION}/config
569         tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
570         tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
571         rm -rf tcsh-${VERSION}
572
573 tar.gz:
574         rm -f tcsh-${VERSION}.tar.gz
575         rm -rf tcsh-${VERSION} 
576         mkdir tcsh-${VERSION} tcsh-${VERSION}/config
577         cp ${ALLSRCS} tcsh-${VERSION}
578         cp ${CONFSRCS} tcsh-${VERSION}/config
579         tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
580         tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
581         rm -rf tcsh-${VERSION}
582
583 shar:
584         rm -f tcsh-*.shar
585         rm -rf tcsh-${VERSION} 
586         mkdir tcsh-${VERSION} tcsh-${VERSION}/config
587         cp ${ALLSRCS} tcsh-${VERSION}
588         cp ${CONFSRCS} tcsh-${VERSION}/config
589         tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
590         MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
591                  tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
592                  tcsh-${VERSION}/?*/set?*
593         rm -rf tcsh-${VERSION}
594
595 catalogs:
596         @(cd nls; make catalogs)
597         
598 world:
599         $(MAKE) clean ; $(MAKE) depend ; $(MAKE) tcsh ; $(MAKE) install
600
601 clean::
602         rm -f ed.defns.h sh.err.h tc.const.h config.h tc.defs.*
603         rm -f tcsh.*.m tcsh.*.cat
604
605 depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS) tc.defs.c
606
607 tc.defs.${SUF}: tc.defs.c sh.h
608
609 tc.defs.c:      gethost host.defs
610         @rm -f $@
611         @echo "/* Do not edit this file, make creates it */" > $@
612         ./gethost host.defs >> $@
613
614 ALIB=$(HESLIB) $(AFSLIB) $(SYSLIBS)
615 AINC=ed.defns.h sh.err.h tc.const.h sh.h
616
617 NormalProgramTarget(tcsh, $(OBJS), $(AINC), $(LOCALLIBS), $(ALIB))
618 NormalProgramTarget(gethost, gethost.${SUF}, $(AINC), $(LOCALLIBS), $(ALIB))
619
620 InstallProgram(tcsh,$(TCSH_BINDIR))
621 InstallManPage(tcsh,$(TCSH_MANDIR))
622 DependTarget()