xref: /minix/bin/csh/Makefile (revision ebfedea0)
1#	$NetBSD: Makefile,v 1.39 2013/07/16 17:47:43 christos Exp $
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 DFLAGS and -pg in COPTS, and recompile.
8
9.include <bsd.own.mk>
10WARNS=6
11
12PROG=	csh
13DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
14# - Editor history not always aligned with shell history,
15#   should implement internally
16# - Does not handle escaped prompts.
17# - Does not do completion
18.ifndef SMALLPROG
19DFLAGS+=-DEDIT
20.endif
21CPPFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
22SRCS=	alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
23	func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
24	sem.c set.c str.c time.c
25.PATH:	${NETBSDSRCDIR}/usr.bin/printf
26
27MLINKS=	csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
28	csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
29	csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
30	csh.1 stop.1 csh.1 source.1
31
32DPSRCS+=	errnum.h const.h
33CLEANFILES+=	errnum.h const.h
34
35errnum.h: err.c
36	${_MKTARGET_CREATE}
37	rm -f ${.TARGET}
38	(\
39	echo '/* Do not edit this file, make creates it. */' ;\
40	echo '#ifndef _h_sh_errnum' ;\
41	echo '#define _h_sh_errnum' ;\
42	egrep 'ERR_' ${.ALLSRC} | egrep '^#define' ;\
43	echo '#endif /* _h_sh_errnum */' ;\
44	) > ${.TARGET}
45
46const.c: errnum.h
47const.h: const.c
48	${_MKTARGET_CREATE}
49	rm -f ${.TARGET}
50	echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
51	${CC} -E ${CPPFLAGS} ${.ALLSRC} | egrep 'Char STR' | \
52	    ${TOOL_SED} -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
53	    sort >> ${.TARGET}
54
55.if make(install)
56SUBDIR+=USD.doc
57.endif
58
59# XXX Only GCC 4.1 problem
60.if defined(HAVE_GCC) && ${HAVE_GCC} == 4 && ${MACHINE_ARCH} == "vax"
61COPTS.parse.c+=	-O0
62.endif
63COPTS.err.c = -Wno-format-nonliteral
64COPTS.printf.c = -Wno-format-nonliteral
65COPTS.proc.c = -Wno-format-nonliteral
66
67.if !empty(DFLAGS:M*EDIT)
68LDADD+=-ledit -lterminfo -lutil
69DPADD+=${LIBEDIT} ${LIBUTIL}
70.else
71LDADD+=-lutil
72DPADD+=${LIBUTIL}
73.endif
74
75.include <bsd.prog.mk>
76.include <bsd.subdir.mk>
77