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