1# $FreeBSD$ 2# @(#)Makefile 8.1 (Berkeley) 5/31/93 3# 4# C Shell with process control; VM/UNIX VAX Makefile 5# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria 6# 7# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile. 8 9TCSHDIR= ${.CURDIR}/../../contrib/tcsh 10.PATH: ${TCSHDIR} 11 12PROG= csh 13.if defined(RESCUE) 14DFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"' 15.else 16DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"' 17.endif 18CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS} 19WARNS?= 0 20SRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \ 21 sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \ 22 sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \ 23 sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h 24SRCS+= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h 25SRCS+= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ 26 tw.comp.c tw.color.c 27SRCS+= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \ 28 ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h 29SRCS+= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \ 30 tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \ 31 tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \ 32 tc.who.c tc.h 33GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c 34SRCS+= ${GENHDRS} 35 36MLINKS= csh.1 tcsh.1 37# MLINKS for Shell built in commands for which there are no userland 38# utilities of the same name are handled with the associated manpage, 39# builtin.1 in share/man/man1/. 40 41DPADD= ${LIBTERMCAP} ${LIBCRYPT} 42LDADD= -ltermcap -lcrypt 43 44LINKS= ${BINDIR}/csh ${BINDIR}/tcsh 45 46CLEANFILES= ${GENHDRS} gethost csh.1 47 48.if !defined(NO_EXAMPLES) 49FILESDIR= ${SHAREDIR}/examples/tcsh 50FILES= complete.tcsh csh-mode.el 51.endif 52 53CATALOGS= et:et_EE.ISO8859-15 \ 54 finnish:fi_FI.ISO8859-1 \ 55 french:fr_FR.ISO8859-1 \ 56 german:de_DE.ISO8859-1 \ 57 greek:el_GR.ISO8859-7 \ 58 italian:it_IT.ISO8859-1 \ 59 ja:ja_JP.eucJP \ 60 russian:ru_RU.KOI8-R \ 61 spanish:es_ES.ISO8859-1 \ 62 ukrainian:uk_UA.KOI8-U 63 64NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15 65NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \ 66 fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \ 67 fr_CH.ISO8859-15 fr_FR.ISO8859-15 68NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \ 69 de_CH.ISO8859-15 de_DE.ISO8859-15 70NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15 71NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15 72 73.if defined(NO_NLS_CATALOGS) || defined(RESCUE) 74CFLAGS+= -DNO_NLS_CATALOGS 75.else 76CFLAGS+= -DHAVE_ICONV 77SRCS+= iconv_stub.c 78# Folloing links can be installed from ports/shells/tcsh_nls: 79# NLSLINKS_de_DE.ISO8859-1 += de_AT.UTF-8 de_CH.UTF-8 de_DE.UTF-8 80# NLSLINKS_el_GR.ISO8859-7 = el_GR.UTF-8 81# NLSLINKS_es_ES.ISO8859-1 += es_ES.UTF-8 82# NLSLINKS_et_EE.ISO8859-15 = et_EE.UTF-8 83# NLSLINKS_fi_FI.ISO8859-1 += fi_FI.UTF-8 84# NLSLINKS_fr_FR.ISO8859-1 += fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8 fr_FR.UTF-8 85# NLSLINKS_it_IT.ISO8859-1 += it_CH.UTF-8 it_IT.UTF-8 86# NLSLINKS_ja_JP.eucJP = ja_JP.SJIS ja_JP.UTF-8 87# NLSLINKS_ru_RU.KOI8-R = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.UTF-8 88# NLSLINKS_uk_UA.KOI8-U = uk_UA.ISO8859-5 uk_UA.UTF-8 89.endif 90 91NLSNAME= tcsh 92 93.for catalog in ${CATALOGS} 94NLS+= ${catalog:C/.*://} 95NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//} 96NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo charset set[0-9]* 97.endfor 98 99csh.1: tcsh.man 100 cat ${.ALLSRC} > ${.TARGET} 101 102build-tools: gethost 103 104gethost: gethost.c sh.err.h tc.const.h sh.h 105 @rm -f ${.TARGET} 106 ${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c 107 108tc.defs.c: gethost ${.CURDIR}/host.defs 109 @rm -f ${.TARGET} 110 @echo "/* Do not edit this file, make creates it */" > ${.TARGET} 111 ./gethost ${.CURDIR}/host.defs >> ${.TARGET} 112 113ed.defns.h: ed.defns.c 114 @rm -f ${.TARGET} 115 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET} 116 @echo '#ifndef _h_ed_defns' >> ${.TARGET} 117 @echo '#define _h_ed_defns' >> ${.TARGET} 118 grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET} 119 @echo '#endif /* _h_ed_defns */' >> ${.TARGET} 120 121sh.err.h: sh.err.c 122 @rm -f ${.TARGET} 123 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET} 124 @echo '#ifndef _h_sh_err' >> ${.TARGET} 125 @echo '#define _h_sh_err' >> ${.TARGET} 126 grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET} 127 @echo '#endif /* _h_sh_err */' >> ${.TARGET} 128 129tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h 130 @rm -f ${.TARGET} 131 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET} 132 @echo '#ifndef _h_tc_const' >> ${.TARGET} 133 @echo '#define _h_tc_const' >> ${.TARGET} 134 ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \ 135 sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ 136 sort >> ${.TARGET} 137 @echo '#endif /* _h_tc_const */' >> ${.TARGET} 138 139.include <bsd.prog.mk> 140