1 # $FreeBSD: src/bin/csh/Makefile,v 1.11.2.8 2002/02/19 00:36:40 mp Exp $
2 # @(#)Makefile 8.1 (Berkeley) 5/31/93
4 # C Shell with process control; VM/UNIX VAX Makefile
5 # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
7 # To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
11 TCSHDIR= ${.CURDIR}/../../../contrib/tcsh-6
16 DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
17 CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
19 SRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
20 sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
21 sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
22 sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
23 SRCS+= sh.decls.h glob.c glob.h dotlock.c
24 SRCS+= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
26 SRCS+= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
27 ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
28 SRCS+= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
29 tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
30 tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
33 GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
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/.
41 DPADD= ${LIBNCURSES} ${LIBCRYPT} ${LIBCRYPTO}
42 LDADD= -lprivate_ncurses -lcrypt -lprivate_crypto
43 LDFLAGS+= ${PRIVATELIB_LDFLAGS}
45 # The gcc80 -O2 tends to wrap malloc() + bzero() back to local calloc() by
46 # emitting calloc: imul %rsi,%rdi; mov $0x1,%esi; jmpq 0xfoo <calloc>
48 calloc_FLAGS= -fno-builtin-malloc
49 calloc_FLAGS_FILES= tc.alloc.c
52 .if defined(BOOTSTRAPPING)
54 LDFLAGS+= -Wl,--allow-multiple-definition
58 # XXX pending tcsh update
59 .if !defined(WARNS_AUDIT)
64 LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
66 CLEANFILES= ${GENHDRS} csh.1
68 .if !defined(NO_SHARE)
69 FILESDIR= ${SHAREDIR}/examples/tcsh
70 FILES= complete.tcsh csh-mode.el
72 CATALOGS= et:et_EE.ISO8859-15 \
73 finnish:fi_FI.ISO8859-1 \
74 french:fr_FR.ISO8859-1 \
75 german:de_DE.ISO8859-1 \
76 greek:el_GR.ISO8859-7 \
77 italian:it_IT.ISO8859-1 \
79 russian:ru_RU.KOI8-R \
80 spanish:es_ES.ISO8859-1 \
81 ukrainian:uk_UA.KOI8-U
83 NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
84 NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
85 fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
86 fr_CH.ISO8859-15 fr_FR.ISO8859-15
87 NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
88 de_CH.ISO8859-15 de_DE.ISO8859-15
89 NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
90 NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
94 .for catalog in ${CATALOGS}
95 NLS+= ${catalog:C/.*://}
96 NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
97 NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
102 ${LN} -sf ${.ALLSRC} ${.TARGET}
104 tc.defs.c: ${.CURDIR}/host.defs gethost.c
106 @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
107 ${.OBJDIR}/../gethost/gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
109 ed.defns.h: ed.defns.c
111 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
112 @echo '#ifndef _h_ed_defns' >> ${.TARGET}
113 @echo '#define _h_ed_defns' >> ${.TARGET}
114 grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
115 @echo '#endif /* _h_ed_defns */' >> ${.TARGET}
119 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
120 @echo '#ifndef _h_sh_err' >> ${.TARGET}
121 @echo '#define _h_sh_err' >> ${.TARGET}
122 grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
123 @echo '#endif /* _h_sh_err */' >> ${.TARGET}
125 tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
127 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
128 @echo '#ifndef _h_tc_const' >> ${.TARGET}
129 @echo '#define _h_tc_const' >> ${.TARGET}
130 ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
131 sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
133 @echo '#endif /* _h_tc_const */' >> ${.TARGET}
135 .include <bsd.prog.mk>
137 # Make all objects depend on our generated headers to fix Makefile