2 XCOMM $tcsh: Imakefile,v 1.85 2006/03/02 18:46:44 christos Exp $
4 XCOMM Imakefile for tcsh 6.12
5 XCOMM Marc Horowitz, MIT SIPB
15 /* All config options go in a separate file. */
17 #include "imake.config"
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! */
31 /**** tcsh configuration defines ****/
33 /* specific platforms */
36 # ifdef UltrixArchitecture
37 # define ConfigH ultrix
40 # ifdef UxpArchitecture
41 # define ConfigH sysv4
44 # if defined(LinuxArchitecture) || defined(GNUArchitecture)
45 # define ConfigH linux
48 # ifdef AlphaArchitecture
49 # if !defined(LinuxArchitecture) && !defined(GNUArchitecture)
50 # define ConfigH decosf1
53 # define MyCflags -std1 -Olimit 2000
55 # define NoCombineRegs
59 # if defined(VaxArchitecture) && !defined(UltrixArchitecture)
63 # ifdef NeXTArchitecture
67 # if defined(SunArchitecture)
68 # if (OSMajorVersion == 3)
69 # define ConfigH sunos35
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
81 # define NoCombineRegs
82 # else /* OSMajorVersion == 5 */
83 # if (OSMinorVersion < 3)
84 # if (OSMinorVersion < 2)
87 # define ConfigH sol22
90 # if (OSMinorVersion < 4)
91 # define ConfigH sol23
93 # if (OSMinorVersion < 6)
94 # define ConfigH sol24
96 # define ConfigH sol26
100 # define NoCombineRegs
105 # ifdef HPArchitecture
106 /* For some stupid reason makedepend on HP requires this */
108 # if (OSMajorVersion >= 8)
109 # define ConfigH hpux8
111 # define ConfigH hpux7
115 # ifdef CrayArchitecture
116 # define ConfigH cray
119 # ifdef SGIArchitecture
120 # define ConfigH irix
122 # if (OSMajorVersion < 5)
123 # ifdef you_are_using_yp
127 # define MyStdc -D__STDC__
128 # if SGICompilerMajorVersion < 4
129 CCOPTIONS=-float # We don't want -cckr and -prototypes
133 # if (OSMajorVersion == 6)
134 # if (OSMinorVersion >= 2)
136 # define ConfigH irix62
141 # ifdef IBMArchitecture
143 # if (SystemV == YES)
145 # if OSMajorVersion < 3
146 # if OSMinorVersion < 2
152 # define AOSArchitecture
157 #ifdef AOSArchitecture
158 #define MyStdc -U__STDC__
161 # if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture)
162 # define ConfigH mips
165 # ifdef DguxArchitecture
166 # define ConfigH dgux
169 # ifdef ConvexArchitecture
170 # define ConfigH convex
173 # if defined(SQNTArchitecture) || defined(SequentArchitecture)
174 # define ConfigH sequent
177 # ifdef MacIIArchitecture
178 # define ConfigH mac2
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
187 /* Maybe conditional on MACH? */
189 SYSOBJS=ma.setp.${SUF}
190 EXTF=mi.termios.c mi.wait.h mi.varargs.h vms.termcap.c
194 # if IscVersion != 202
196 # define UseLibCposix
198 # define ConfigH isc202
200 # endif /* i386Isc */
202 # ifdef OpenBSDArchitecture
203 # define ConfigH bsd4.4
204 # endif /* OpenBsdArchitecture */
206 # ifdef NetBSDArchitecture
207 # define ConfigH bsd4.4
208 # endif /* NetBsdArchitecture */
210 # ifdef FreeBSDArchitecture
211 # define ConfigH bsd4.4
212 # endif /* FreeBsdArchitecture */
214 # ifdef i386SVR4Architecture
215 # define ConfigH sysv4
217 # define NoCombineRegs
221 #endif /* !ConfigH */
228 #define ConfigH sysv3
230 /* why this as a default? Why not? */
234 #endif /* !ConfigH */
236 /**** libraries ****/
238 #if (SystemV == NO) || defined(HPArchitecture) || \
239 defined(SQNTArchitecture) || defined(SequentArchitecture) || \
240 defined(MacIIArchitecture) || defined(UseLibTermcap)
241 LIBTERMCAP = -ltermcap
246 #if defined(SQNTArchitecture) || defined(SequentArchitecture)
247 LIBSQNT=-lsocket -linet -lnsl -lseq
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)
258 #if defined(UseLibNet)
264 #if defined(UseLibSocket)
270 #if defined(UseLibBSD)
276 #if (defined(SGIArchitecture) && \
277 (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \
284 #if defined(UseLibSun)
290 #if defined(UseLibCposix)
296 #if defined(UseLibInet)
302 #if defined(UseLibDir)
314 #if defined(UseLibIntl)
320 #if (HasLibCrypt == YES)
326 #if defined(MacIIArchitecture) || defined(UseLibPosix)
332 #if defined(ATTArchitecture) || defined(UseLibDirent)
333 LIBDIRECTENT = -ldirent
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. */
341 SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \
342 $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \
343 $(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT) $(LIBCRYPT)
345 /* Past here, nothing should need to be changed to compile on a different
346 platform, unless you have a really weird architecture. */
355 # ifdef NoCombineRegs
356 CC = gcc -finline-functions -fstrength-reduce
358 CC = gcc -fcombine-regs -finline-functions -fstrength-reduce
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
381 #define AFS33LIB -laudit
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.
389 #if defined(HPArchitecture)
390 #define AFSAUXLIB -lc -lBSD
391 /* This is probably a kludge, but so is imake. */
393 #if defined(SunArchitecture) && (OSMajorVersion == 5)
394 #define AFSAUXLIB -lsocket -lnsl -lc -lucb
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
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.
413 #define TcshTop /usr/local
420 MANSUFFIX = ManSuffix
423 PATH_TCSHELL = TcshPath
424 TCSHPATH = -D_PATH_TCSHELL='"$(PATH_TCSHELL)"'
430 TCSH_BINDIR = DestBin
432 TCSH_BINDIR = $(TCSHTOP)/bin
435 TCSH_MANDIR = DestMan
437 TCSH_MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX)
459 CDEBUGFLAGS = CDebugFlags
471 HTDEF = -DHOSTTYPE='"$(HOSTTYPE)"'
476 DEFINES = $(TCSHPATH) $(HESDEF) $(AFSDEF) $(HTDEF) MyDefines MyCflags MyStdc
477 INCLUDES = -I. MyIncludes
485 SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \
486 sh.char.c sh.exp.c sh.file.c sh.func.c \
487 sh.glob.c sh.hist.c sh.init.c sh.lex.c \
488 sh.misc.c sh.parse.c sh.print.c sh.proc.c \
489 sh.sem.c sh.set.c sh.time.c glob.c \
490 sh.char.h sh.dir.h sh.proc.h sh.h \
491 sh.decls.h glob.h ${SYSSRCS}
492 SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
493 sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
494 sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
495 sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
496 sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS}
498 TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
500 TWOBJS= tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
501 tw.comp.${SUF} tw.color.${SUF}
503 EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
504 ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
505 EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
506 ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
508 TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
509 tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
510 tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
512 TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
513 tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
514 tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
515 tc.vers.${SUF} tc.who.${SUF}
517 MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
518 WishList config_f.h eight-bit.me glob.3 patchlevel.h \
519 pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
520 README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \
521 snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.in \
523 CONFSRCS=config/[a-z]*
526 SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS)
527 OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS)
529 ALLSRCS= $(MISCF) $(SRCS) $(EXTF)
533 ed.defns.h: config.h ed.defns.c
535 @echo '/* Do not edit this file, make creates it. */' > $@
536 @echo '#ifndef _h_ed_defns' >> $@
537 @echo '#define _h_ed_defns' >> $@
538 egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
539 @echo '#endif /* _h_ed_defns */' >> $@
541 sh.err.h: config.h sh.err.c
543 @echo '/* Do not edit this file, make creates it. */' > $@
544 @echo '#ifndef _h_sh_err' >> $@
545 @echo '#define _h_sh_err' >> $@
546 egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
547 @echo '#endif /* _h_sh_err */' >> $@
549 tc.const.h: config.h tc.const.c
551 @echo '/* Do not edit this file, make creates it. */' > $@
552 @echo '#ifndef _h_tc_const' >> $@
553 @echo '#define _h_tc_const' >> $@
554 ${CC} -E $(INCLUDES) ${DEFINES} -D_h_tc_const tc.const.c | \
556 sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \
558 @echo '#endif /* _h_tc_const */' >> $@
561 cp config/ConfigH config.h
563 $(OBJS): sh.err.h tc.const.h ed.defns.h
566 rm -f tcsh-${VERSION}.tar.Z
567 rm -rf tcsh-${VERSION}
568 mkdir tcsh-${VERSION} tcsh-${VERSION}/config
569 cp ${ALLSRCS} tcsh-${VERSION}
570 cp ${CONFSRCS} tcsh-${VERSION}/config
571 tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
572 tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
573 rm -rf tcsh-${VERSION}
576 rm -f tcsh-${VERSION}.tar.gz
577 rm -rf tcsh-${VERSION}
578 mkdir tcsh-${VERSION} tcsh-${VERSION}/config
579 cp ${ALLSRCS} tcsh-${VERSION}
580 cp ${CONFSRCS} tcsh-${VERSION}/config
581 tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
582 tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
583 rm -rf tcsh-${VERSION}
587 rm -rf tcsh-${VERSION}
588 mkdir tcsh-${VERSION} tcsh-${VERSION}/config
589 cp ${ALLSRCS} tcsh-${VERSION}
590 cp ${CONFSRCS} tcsh-${VERSION}/config
591 tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
592 MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
593 tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
594 tcsh-${VERSION}/?*/set?*
595 rm -rf tcsh-${VERSION}
598 @(cd nls; make catalogs)
601 $(MAKE) clean ; $(MAKE) depend ; $(MAKE) tcsh ; $(MAKE) install
604 rm -f ed.defns.h sh.err.h tc.const.h config.h tc.defs.*
605 rm -f tcsh.*.m tcsh.*.cat
607 depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS) tc.defs.c
609 tc.defs.${SUF}: tc.defs.c sh.h
611 tc.defs.c: gethost host.defs
613 @echo "/* Do not edit this file, make creates it */" > $@
614 ./gethost host.defs >> $@
616 ALIB=$(HESLIB) $(AFSLIB) $(SYSLIBS)
617 AINC=ed.defns.h sh.err.h tc.const.h sh.h
619 NormalProgramTarget(tcsh, $(OBJS), $(AINC), $(LOCALLIBS), $(ALIB))
620 NormalProgramTarget(gethost, gethost.${SUF}, $(AINC), $(LOCALLIBS), $(ALIB))
622 InstallProgram(tcsh,$(TCSH_BINDIR))
623 InstallManPage(tcsh,$(TCSH_MANDIR))