Makefile revision 41923
1#	$Id: Makefile,v 1.10 1998/12/16 10:24:52 des Exp $
2
3LIB=		fetch
4CFLAGS+=	-I. -Wall -pedantic
5.if !defined(DEBUG)
6CFLAGS+=	-DNDEBUG
7.endif
8SRCS=		fetch.c common.c ftp.c http.c file.c fetch_err.c \
9		fetch_err.h ftperr.h httperr.h
10MAN3=		fetch.3
11CLEANFILES=	fetch_err.c fetch_err.h ftperr.h httperr.h
12
13SHLIB_MAJOR=    1
14SHLIB_MINOR=	0
15
16beforeinstall:
17	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fetch.h \
18		${DESTDIR}/usr/include
19	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 fetch_err.h \
20		${DESTDIR}/usr/include
21
22ftperr.h: ftp.errors
23	@echo "static struct fetcherr _ftp_errlist[] = {" > ${.TARGET}
24	@cat ${.ALLSRC} \
25	  | grep -v ^# \
26	  | sort \
27	  | while read NUM CAT STRING; do \
28	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
29	  done >> ${.TARGET}
30	@echo "    { -1, FETCH_UNKNOWN, \"Unknown FTP error\" }" >> ${.TARGET}
31	@echo "};" >> ${.TARGET}
32
33httperr.h: http.errors
34	@echo "static struct fetcherr _http_errlist[] = {" > ${.TARGET}
35	@cat ${.ALLSRC} \
36	  | grep -v ^# \
37	  | sort \
38	  | while read NUM CAT STRING; do \
39	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
40	  done >> ${.TARGET}
41	@echo "    { -1, FETCH_UNKNOWN, \"Unknown HTTP error\" }" >> ${.TARGET}
42	@echo "};" >> ${.TARGET}
43
44hdrs: fetch_err.h
45
46.ORDER: fetch_err.c fetch_err.h
47fetch_err.c fetch_err.h: fetch_err.et
48	compile_et ${.ALLSRC}
49
50.include <bsd.lib.mk>
51