freebsd-nq/lib/libfetch/Makefile
Dag-Erling Smørgrav ecc9135299 Commit a bunch of patches that have been accumulating:
- Fix the README to reflect the new status of the ftp code.
 - Change tons of 'if (xxx < 0)' to 'if (xxx == -1)'
 - Add two new interface functions
 - Fix the Makefile so it actually works (yay!)

Now the manpage is lagging even further behind... :( Next on the todo
list is to clean up the http code.
1998-08-17 09:30:19 +00:00

47 lines
1.3 KiB
Makefile

LIB= fetch
CFLAGS+= -I${.CURDIR} -Wall -pedantic -DNDEBUG
SRCS= fetch.c ftp.c http.c file.c
MAN3= fetch.3
CLEANFILES+= ftperr.c httperr.c
SHLIB_MAJOR= 1
SHLIB_MINOR= 0
beforeinstall:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fetch.h \
${DESTDIR}/usr/include
ftp.c: ftperr.c
ftperr.c: ftp.errors
@echo "struct ftperr {" \ > ${.TARGET}
@echo " const int num;" \ >> ${.TARGET}
@echo " const char *string;" \ >> ${.TARGET}
@echo "};" \ >> ${.TARGET}
@echo "static struct ftperr _ftp_errlist[] = {" \ >> ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
| while read NUM STRING; do \
echo " { $${NUM}, \"$${STRING}\" },"; \
done >> ${.TARGET}
@echo " { -1, \"Unknown FTP error\" }" >> ${.TARGET}
@echo "};" >> ${.TARGET}
http.c: httperr.c
httperr.c: http.errors
@echo "struct httperr {" \ > ${.TARGET}
@echo " const int num;" \ >> ${.TARGET}
@echo " const char *string;" \ >> ${.TARGET}
@echo "};" \ >> ${.TARGET}
@echo "static struct httperr _http_errlist[] = {" \ >> ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
| while read NUM STRING; do \
echo " { $${NUM}, \"$${STRING}\" },"; \
done >> ${.TARGET}
@echo " { -1, \"Unknown HTTP error\" }" >> ${.TARGET}
@echo "};" >> ${.TARGET}
.include <bsd.lib.mk>