summaryrefslogtreecommitdiffstats
path: root/bin/csh/Makefile
blob: 8b3c2e4b7a8e8cd548d185a6676d70af43a19d35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# $FreeBSD$
#	@(#)Makefile	8.1 (Berkeley) 5/31/93
#
# C Shell with process control; VM/UNIX VAX Makefile
# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
#
# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.

TCSHDIR= ${.CURDIR}/../../contrib/tcsh
.PATH: ${TCSHDIR}

PROG=	csh
.if defined(RESCUE)
DFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
.else
DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
.endif
CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
WARNS=	0
SRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
SRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
	tw.comp.c tw.color.c
SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
SRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
	tc.who.c tc.h
GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
SRCS+=	${GENHDRS}

MLINKS= csh.1 tcsh.1
# MLINKS for Shell built in commands for which there are no userland
# utilities of the same name are handled with the associated manpage,
# builtin.1 in share/man/man1/.

DPADD=	${LIBTERMCAP} ${LIBCRYPT}
LDADD=	-ltermcap -lcrypt

LINKS=	${BINDIR}/csh ${BINDIR}/tcsh

CLEANFILES= ${GENHDRS} gethost csh.1

FILESDIR= ${SHAREDIR}/examples/tcsh
FILES= complete.tcsh csh-mode.el

CATALOGS=	et:et_EE.ISO8859-15 \
		finnish:fi_FI.ISO8859-1 \
		french:fr_FR.ISO8859-1 \
		german:de_DE.ISO8859-1 \
		greek:el_GR.ISO8859-7 \
		italian:it_IT.ISO8859-1 \
		ja:ja_JP.eucJP \
		russian:ru_RU.KOI8-R \
		spanish:es_ES.ISO8859-1 \
		ukrainian:uk_UA.KOI8-U

NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
		fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
		fr_CH.ISO8859-15 fr_FR.ISO8859-15
NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
		de_CH.ISO8859-15 de_DE.ISO8859-15
NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15

NLSNAME= tcsh

.for catalog in ${CATALOGS}
NLS+=		${catalog:C/.*://}
NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
.endfor

csh.1: tcsh.man
	cat ${.ALLSRC} > ${.TARGET}

build-tools: gethost

gethost: gethost.c sh.err.h tc.const.h sh.h
	@rm -f ${.TARGET}
	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c

tc.defs.c: gethost ${.CURDIR}/host.defs
	@rm -f ${.TARGET}
	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
	./gethost ${.CURDIR}/host.defs >> ${.TARGET}

ed.defns.h: ed.defns.c
	@rm -f ${.TARGET}
	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
	@echo '#define _h_ed_defns' >> ${.TARGET}
	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}

sh.err.h: sh.err.c
	@rm -f ${.TARGET}
	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
	@echo '#ifndef _h_sh_err' >> ${.TARGET}
	@echo '#define _h_sh_err' >> ${.TARGET}
	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
	@echo '#endif /* _h_sh_err */' >> ${.TARGET}

tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
	@rm -f ${.TARGET}
	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
	@echo '#ifndef _h_tc_const' >> ${.TARGET}
	@echo '#define _h_tc_const' >> ${.TARGET}
	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
	    sort >> ${.TARGET}
	@echo '#endif /* _h_tc_const */' >> ${.TARGET}

.include <bsd.prog.mk>
OpenPOWER on IntegriCloud