1998-11-05 19:48:17 +00:00
|
|
|
# $Id: Makefile,v 1.5 1998/08/17 20:39:09 bde Exp $
|
1998-08-17 20:39:09 +00:00
|
|
|
|
1998-07-09 16:52:44 +00:00
|
|
|
LIB= fetch
|
1998-11-05 19:48:17 +00:00
|
|
|
CFLAGS+= -I. -Wall -pedantic
|
|
|
|
.if !defined(DEBUG)
|
|
|
|
CFLAGS+= -DNDEBUG
|
|
|
|
.endif
|
|
|
|
SRCS= fetch.c common.c ftp.c http.c file.c
|
1998-08-17 20:39:09 +00:00
|
|
|
DPSRCS= ftperr.c httperr.c
|
1998-07-09 16:52:44 +00:00
|
|
|
MAN3= fetch.3
|
1998-08-17 20:39:09 +00:00
|
|
|
CLEANFILES= ${DPSRCS}
|
1998-07-09 16:52:44 +00:00
|
|
|
|
|
|
|
SHLIB_MAJOR= 1
|
|
|
|
SHLIB_MINOR= 0
|
|
|
|
|
1998-08-17 20:39:09 +00:00
|
|
|
beforedepend: ${DPSRCS}
|
|
|
|
|
1998-07-09 16:52:44 +00:00
|
|
|
beforeinstall:
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fetch.h \
|
|
|
|
${DESTDIR}/usr/include
|
|
|
|
|
1998-08-17 09:30:19 +00:00
|
|
|
ftperr.c: ftp.errors
|
1998-11-05 19:48:17 +00:00
|
|
|
@echo "static struct fetcherr _ftp_errlist[] = {" \ >> ${.TARGET}
|
1998-07-09 16:52:44 +00:00
|
|
|
@cat ${.ALLSRC} \
|
|
|
|
| grep -v ^# \
|
|
|
|
| sort \
|
|
|
|
| while read NUM STRING; do \
|
1998-07-11 18:56:01 +00:00
|
|
|
echo " { $${NUM}, \"$${STRING}\" },"; \
|
1998-07-09 16:52:44 +00:00
|
|
|
done >> ${.TARGET}
|
1998-07-11 18:56:01 +00:00
|
|
|
@echo " { -1, \"Unknown FTP error\" }" >> ${.TARGET}
|
1998-07-09 16:52:44 +00:00
|
|
|
@echo "};" >> ${.TARGET}
|
1998-11-05 19:48:17 +00:00
|
|
|
@echo "#define _ftp_errstring(n) _fetch_errstring(_ftp_errlist, n)" >> ${.TARGET}
|
|
|
|
@echo "#define _ftp_seterr(n) _fetch_seterr(_ftp_errlist, n)" >> ${.TARGET}
|
|
|
|
|
1998-07-09 16:52:44 +00:00
|
|
|
|
1998-08-17 09:30:19 +00:00
|
|
|
httperr.c: http.errors
|
1998-11-05 19:48:17 +00:00
|
|
|
@echo "static struct fetcherr _http_errlist[] = {" \ >> ${.TARGET}
|
1998-07-09 16:52:44 +00:00
|
|
|
@cat ${.ALLSRC} \
|
|
|
|
| grep -v ^# \
|
|
|
|
| sort \
|
|
|
|
| while read NUM STRING; do \
|
1998-07-11 18:56:01 +00:00
|
|
|
echo " { $${NUM}, \"$${STRING}\" },"; \
|
1998-07-09 16:52:44 +00:00
|
|
|
done >> ${.TARGET}
|
1998-07-11 18:56:01 +00:00
|
|
|
@echo " { -1, \"Unknown HTTP error\" }" >> ${.TARGET}
|
1998-07-09 16:52:44 +00:00
|
|
|
@echo "};" >> ${.TARGET}
|
1998-11-05 19:48:17 +00:00
|
|
|
@echo "#define _http_errstring(n) _fetch_errstring(_http_errlist, n)" >> ${.TARGET}
|
|
|
|
@echo "#define _http_seterr(n) _fetch_seterr(_http_errlist, n)" >> ${.TARGET}
|
1998-07-09 16:52:44 +00:00
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|
1998-08-17 20:39:09 +00:00
|
|
|
|
|
|
|
.if !exists(${DEPENDFILE})
|
|
|
|
${OBJS} ${POBJS} ${SOBJS}: ${DPSRCS}
|
|
|
|
.endif
|