7268de7a17
- replaced bogus dependencies of distribution sources on generated sources by the same ones that bsd.lib.mk would generate if it knew all the sources. We shoot ourself in the foot by not naming the generated (included) sources *.h, so we can just put the generated sources in SRCS. - replaced -I${.CURDIR} by `-I.'. Here `.' is an alias for ${.OBJDIR}. -I${.CURDIR} didn't do anything, since ${.CURDIR} is the default in all cases here (it would be necessary for ""-style includes made from sources in ${.OBJDIR}. Don't use `+=' for setting CLEANFILES for the first time. Added $Id$.
54 lines
1.4 KiB
Makefile
54 lines
1.4 KiB
Makefile
# $Id$
|
|
|
|
LIB= fetch
|
|
CFLAGS+= -I. -Wall -pedantic -DNDEBUG
|
|
SRCS= fetch.c ftp.c http.c file.c
|
|
DPSRCS= ftperr.c httperr.c
|
|
MAN3= fetch.3
|
|
CLEANFILES= ${DPSRCS}
|
|
|
|
SHLIB_MAJOR= 1
|
|
SHLIB_MINOR= 0
|
|
|
|
beforedepend: ${DPSRCS}
|
|
|
|
beforeinstall:
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fetch.h \
|
|
${DESTDIR}/usr/include
|
|
|
|
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}
|
|
|
|
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>
|
|
|
|
.if !exists(${DEPENDFILE})
|
|
${OBJS} ${POBJS} ${SOBJS}: ${DPSRCS}
|
|
.endif
|