2 XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 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 # if (OSMinorVersion < 9)
97 # define ConfigH sol26
99 # define ConfigH sol29
104 # define NoCombineRegs
109 # ifdef HPArchitecture
110 /* For some stupid reason makedepend on HP requires this */
112 # if (OSMajorVersion >= 8)
113 # define ConfigH hpux8
115 # define ConfigH hpux7
119 # ifdef CrayArchitecture
120 # define ConfigH cray
123 # ifdef SGIArchitecture
124 # define ConfigH irix
126 # if (OSMajorVersion < 5)
127 # ifdef you_are_using_yp
131 # define MyStdc -D__STDC__
132 # if SGICompilerMajorVersion < 4
133 CCOPTIONS=-float # We don't want -cckr and -prototypes
137 # if (OSMajorVersion == 6)
138 # if (OSMinorVersion >= 2)
140 # define ConfigH irix62
145 # ifdef IBMArchitecture
147 # if (SystemV == YES)
149 # if OSMajorVersion < 3
150 # if OSMinorVersion < 2
156 # define AOSArchitecture
161 #ifdef AOSArchitecture
162 #define MyStdc -U__STDC__
165 # if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture)
166 # define ConfigH mips
169 # ifdef DguxArchitecture
170 # define ConfigH dgux
173 # ifdef ConvexArchitecture
174 # define ConfigH convex
177 # if defined(SQNTArchitecture) || defined(SequentArchitecture)
178 # define ConfigH sequent
181 # ifdef MacIIArchitecture
182 # define ConfigH mac2
185 # ifdef MinixArchitecture
186 /* Maybe conditional on MACH? */
187 SYSSRCS=mi.termios.c mi.wait.h mi.varargs.h
188 SYSOBJS=mi.termios.${SUF}
189 EXTF=ma.setp.c vms.termcap.c
191 /* Maybe conditional on MACH? */
193 SYSOBJS=ma.setp.${SUF}
194 EXTF=mi.termios.c mi.wait.h mi.varargs.h vms.termcap.c
198 # if IscVersion != 202
200 # define UseLibCposix
202 # define ConfigH isc202
204 # endif /* i386Isc */
206 # ifdef OpenBSDArchitecture
207 # define ConfigH bsd4.4
208 # endif /* OpenBsdArchitecture */
210 # ifdef NetBSDArchitecture
211 # define ConfigH bsd4.4
212 # endif /* NetBsdArchitecture */
214 # ifdef FreeBSDArchitecture
215 # define ConfigH bsd4.4
216 # endif /* FreeBsdArchitecture */
218 # ifdef MidnightBSDArchitecture
219 # define ConfigH bsd4.4
220 # endif /* MidnightBsdArchitecture */
222 # ifdef i386SVR4Architecture
223 # define ConfigH sysv4
225 # define NoCombineRegs
229 #endif /* !ConfigH */
236 #define ConfigH sysv3
238 /* why this as a default? Why not? */
242 #endif /* !ConfigH */
244 /**** libraries ****/
246 #if (SystemV == NO) || defined(HPArchitecture) || \
247 defined(SQNTArchitecture) || defined(SequentArchitecture) || \
248 defined(MacIIArchitecture) || defined(UseLibTermcap)
249 LIBTERMCAP = -ltermcap
254 #if defined(SQNTArchitecture) || defined(SequentArchitecture)
255 LIBSQNT=-lsocket -linet -lnsl -lseq
258 /* This may not be good enough - I don't have access to enough systems
259 to really test it. */
260 #if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture)
266 #if defined(UseLibNet)
272 #if defined(UseLibSocket)
278 #if defined(UseLibBSD)
284 #if (defined(SGIArchitecture) && \
285 (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \
292 #if defined(UseLibSun)
298 #if defined(UseLibCposix)
304 #if defined(UseLibInet)
310 #if defined(UseLibDir)
322 #if defined(UseLibIntl)
328 #if (HasLibCrypt == YES)
334 #if defined(MacIIArchitecture) || defined(UseLibPosix)
340 #if defined(ATTArchitecture) || defined(UseLibDirent)
341 LIBDIRECTENT = -ldirent
346 /* The order here is significant. Although nothing uses all of these,
347 some platforms which use more than one do care about the order. */
349 SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \
350 $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \
351 $(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT) $(LIBCRYPT)
353 /* Past here, nothing should need to be changed to compile on a different
354 platform, unless you have a really weird architecture. */
363 # ifdef NoCombineRegs
364 CC = gcc -finline-functions -fstrength-reduce
366 CC = gcc -fcombine-regs -finline-functions -fstrength-reduce
375 HESLIB = -L/usr/athena/lib -lhesiod
376 /* it seems to me that the -I shouldn't be necessary, but there seems
377 to be a bug in the Imake stuff, so here it is. */
378 HESDEF = -DHESIOD -I/usr/athena/include
389 #define AFS33LIB -laudit
393 /* Auxilliary libs needed for AFS */
394 /* Both HPUX and Solaris need the BSD libraries. We need -lc before
395 * the bsd library to avoid using any more of it than is necessary.
397 #if defined(HPArchitecture)
398 #define AFSAUXLIB -lc -lBSD
399 /* This is probably a kludge, but so is imake. */
401 #if defined(SunArchitecture) && (OSMajorVersion == 5)
402 #define AFSAUXLIB -lsocket -lnsl -lc -lucb
406 #endif /* AFSAUXLIB */
407 AFSLIB = -L$(AFSDIR)/lib -L$(AFSDIR)/lib/afs -lkauth -lprot -lubik\
408 -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\
409 $(AFSDIR)/lib/afs/util.a AFS33LIB AFSAUXLIB
410 AFSDEF = -DAFS -I$(AFSDIR)/include
416 /* This is encore specific, but I don't know what encore's #define is,
417 and it shouldn't hurt to have it here, so here it is */
418 PARALLEL=12 # Make the multi-max run fast.
421 #define TcshTop /usr/local
428 MANSUFFIX = ManSuffix
431 PATH_TCSHELL = TcshPath
432 TCSHPATH = -D_PATH_TCSHELL='"$(PATH_TCSHELL)"'
438 TCSH_BINDIR = DestBin
440 TCSH_BINDIR = $(TCSHTOP)/bin
443 TCSH_MANDIR = DestMan
445 TCSH_MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX)
467 CDEBUGFLAGS = CDebugFlags
479 HTDEF = -DHOSTTYPE='"$(HOSTTYPE)"'
484 DEFINES = $(TCSHPATH) $(HESDEF) $(AFSDEF) $(HTDEF) MyDefines MyCflags MyStdc
485 INCLUDES = -I. MyIncludes
493 SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \
494 sh.char.c sh.exp.c sh.file.c sh.func.c \
495 sh.glob.c sh.hist.c sh.init.c sh.lex.c \
496 sh.misc.c sh.parse.c sh.print.c sh.proc.c \
497 sh.sem.c sh.set.c sh.time.c glob.c \
498 sh.char.h sh.dir.h sh.proc.h sh.h \
499 sh.decls.h glob.h ${SYSSRCS}
500 SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
501 sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
502 sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
503 sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
504 sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS}
506 TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
508 TWOBJS= tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
509 tw.comp.${SUF} tw.color.${SUF}
511 EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
512 ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
513 EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
514 ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
516 TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
517 tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
518 tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
520 TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
521 tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
522 tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
523 tc.vers.${SUF} tc.who.${SUF}
525 MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
526 WishList config_f.h eight-bit.me glob.3 patchlevel.h \
527 pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
528 README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \
529 snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \
530 Makefile.win32 aclocal.m4
531 CONFSRCS=config/[a-z]*
534 SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS)
535 OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS)
537 ALLSRCS= $(MISCF) $(SRCS) $(EXTF)
541 ed.defns.h: config.h ed.defns.c
543 @echo '/* Do not edit this file, make creates it. */' > $@
544 @echo '#ifndef _h_ed_defns' >> $@
545 @echo '#define _h_ed_defns' >> $@
546 egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@
547 @echo '#endif /* _h_ed_defns */' >> $@
549 sh.err.h: config.h sh.err.c
551 @echo '/* Do not edit this file, make creates it. */' > $@
552 @echo '#ifndef _h_sh_err' >> $@
553 @echo '#define _h_sh_err' >> $@
554 egrep 'ERR_' sh.err.c | egrep '^#define' >> $@
555 @echo '#endif /* _h_sh_err */' >> $@
557 tc.const.h: config.h tc.const.c
559 @echo '/* Do not edit this file, make creates it. */' > $@
560 @echo '#ifndef _h_tc_const' >> $@
561 @echo '#define _h_tc_const' >> $@
562 ${CC} -E $(INCLUDES) ${DEFINES} -D_h_tc_const tc.const.c | \
564 sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \
566 @echo '#endif /* _h_tc_const */' >> $@
569 cp config/ConfigH config.h
571 $(OBJS): sh.err.h tc.const.h ed.defns.h
574 rm -f tcsh-${VERSION}.tar.Z
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} | compress > tcsh-${VERSION}.tar.Z
581 rm -rf tcsh-${VERSION}
584 rm -f tcsh-${VERSION}.tar.gz
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 tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
591 rm -rf tcsh-${VERSION}
595 rm -rf tcsh-${VERSION}
596 mkdir tcsh-${VERSION} tcsh-${VERSION}/config
597 cp ${ALLSRCS} tcsh-${VERSION}
598 cp ${CONFSRCS} tcsh-${VERSION}/config
599 tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
600 MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
601 tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
602 tcsh-${VERSION}/?*/set?*
603 rm -rf tcsh-${VERSION}
606 @(cd nls; make catalogs)
609 $(MAKE) clean ; $(MAKE) depend ; $(MAKE) tcsh ; $(MAKE) install
612 rm -f ed.defns.h sh.err.h tc.const.h config.h tc.defs.*
613 rm -f tcsh.*.m tcsh.*.cat
615 depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS) tc.defs.c
617 tc.defs.${SUF}: tc.defs.c sh.h
619 tc.defs.c: gethost host.defs
621 @echo "/* Do not edit this file, make creates it */" > $@
622 ./gethost host.defs >> $@
624 ALIB=$(HESLIB) $(AFSLIB) $(SYSLIBS)
625 AINC=ed.defns.h sh.err.h tc.const.h sh.h
627 NormalProgramTarget(tcsh, $(OBJS), $(AINC), $(LOCALLIBS), $(ALIB))
628 NormalProgramTarget(gethost, gethost.${SUF}, $(AINC), $(LOCALLIBS), $(ALIB))
630 InstallProgram(tcsh,$(TCSH_BINDIR))
631 InstallManPage(tcsh,$(TCSH_MANDIR))