xref: /openbsd/bin/csh/Makefile (revision e5dd7070)
1#	$OpenBSD: Makefile,v 1.16 2017/07/10 21:30:37 espie Exp $
2#
3# C Shell with process control; VM/UNIX VAX Makefile
4# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
5
6PROG=	csh
7CFLAGS+=-I${.CURDIR} -I.
8SRCS=	alloc.c char.c const.c csh.c dir.c dol.c error.c exec.c exp.c file.c \
9	func.c glob.c hist.c init.c lex.c misc.c parse.c proc.c \
10	sem.c set.c str.c time.c
11
12CLEANFILES+=error.h const.h
13
14const.h: error.h
15
16error.h: error.c
17	@rm -f $@
18	@echo '/* Do not edit this file, make creates it. */' > $@
19	@echo '#ifndef _h_sh_err' >> $@
20	@echo '#define _h_sh_err' >> $@
21	egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@
22	@echo '#endif /* _h_sh_err */' >> $@
23
24const.h: const.c
25	@rm -f $@
26	@echo '/* Do not edit this file, make creates it. */' > $@
27	${CC} -E ${CFLAGS} ${.CURDIR}/$*.c | egrep 'Char STR' | \
28	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
29	    sort >> $@
30
31BUILDFIRST = const.h error.h
32
33.include <bsd.prog.mk>
34