xref: /dragonfly/bin/csh/gethost/Makefile (revision 7ff0fc30)
1TCSHDIR= ${.CURDIR}/../../../contrib/tcsh-6
2.PATH: ${TCSHDIR} ${.CURDIR}/../csh
3
4PROG=	gethost
5SRCS=	gethost.c sh.err.h tc.const.h
6
7DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
8CFLAGS+= -I. -I${.CURDIR}/../csh -I${TCSHDIR} ${DFLAGS}
9
10sh.err.h: sh.err.c
11	@rm -f ${.TARGET}
12	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
13	@echo '#ifndef _h_sh_err' >> ${.TARGET}
14	@echo '#define _h_sh_err' >> ${.TARGET}
15	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
16	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
17
18tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
19	@rm -f ${.TARGET}
20	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
21	@echo '#ifndef _h_tc_const' >> ${.TARGET}
22	@echo '#define _h_tc_const' >> ${.TARGET}
23	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
24	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
25	    sort >> ${.TARGET}
26	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
27
28CLEANFILES+=	sh.err.h tc.const.h
29
30build-tools: gethost.nx
31
32# this gethost is used in place, it is not installed anywhere
33install:
34
35.include <bsd.hostprog.mk>
36