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