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