csh(1): Separate hostprog.
[dragonfly.git] / bin / csh / gethost / Makefile
1 TCSHDIR= ${.CURDIR}/../../../contrib/tcsh-6
2 .PATH: ${TCSHDIR} ${.CURDIR}/../csh
3
4 PROG=   gethost
5 SRCS=   gethost.c sh.err.h tc.const.h
6
7 DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
8 CFLAGS+= -I. -I${.CURDIR}/../csh -I${TCSHDIR} ${DFLAGS}
9
10 sh.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
18 tc.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
28 CLEANFILES+=    sh.err.h tc.const.h
29
30 # this gethost is used in place, it is not installed anywhere
31 install:
32
33 .include <bsd.hostprog.mk>