11.1Sagc# $FreeBSD: src/lib/libfetch/Makefile,v 1.49 2007/05/24 20:28:14 des Exp $
21.1Sagc
31.1Sagc.include <bsd.own.mk>
41.1Sagc
51.1SagcOPSYS!= uname -s
61.1Sagc
71.1Sagc.if ${OPSYS} == "NetBSD"
81.1SagcMK_INET6_SUPPORT=yes
91.1SagcMK_OPENSSL=yes
101.1SagcCPPFLAGS+=-I${.OBJDIR}
111.1Sagc.endif
121.1Sagc
131.1SagcLIB=		fetch
141.1SagcCFLAGS+=	-I.
151.1SagcSRCS=		fetch.c common.c ftp.c http.c file.c \
161.1Sagc		ftperr.h httperr.h
171.1SagcINCS=		fetch.h
181.1SagcMAN=		fetch.3
191.1SagcCLEANFILES=	ftperr.h httperr.h
201.1Sagc
211.1Sagc.if ${MK_INET6_SUPPORT} != "no"
221.1SagcCFLAGS+=	-DINET6
231.1Sagc.endif
241.1Sagc
251.1Sagc.if ${MK_OPENSSL} != "no"
261.1SagcCFLAGS+=	-DWITH_SSL
271.1SagcDPADD=		${LIBSSL} ${LIBCRYPTO}
281.1SagcLDADD=		-lssl -lcrypto
291.1Sagc.endif
301.1Sagc
311.1SagcCFLAGS+=	-DFTP_COMBINE_CWDS
321.1Sagc
331.1SagcCSTD?=		c99
341.1SagcWARNS?=		4
351.1Sagc
361.1SagcSHLIB_MAJOR=    5
371.1Sagc
381.1Sagcftperr.h: ftp.errors
391.1Sagc	@echo "static struct fetcherr _ftp_errlist[] = {" > ${.TARGET}
401.1Sagc	@cat ${.ALLSRC} \
411.1Sagc	  | grep -v ^# \
421.1Sagc	  | sort \
431.1Sagc	  | while read NUM CAT STRING; do \
441.1Sagc	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
451.1Sagc	  done >> ${.TARGET}
461.1Sagc	@echo "    { -1, FETCH_UNKNOWN, \"Unknown FTP error\" }" >> ${.TARGET}
471.1Sagc	@echo "};" >> ${.TARGET}
481.1Sagc
491.1Sagchttperr.h: http.errors
501.1Sagc	@echo "static struct fetcherr _http_errlist[] = {" > ${.TARGET}
511.1Sagc	@cat ${.ALLSRC} \
521.1Sagc	  | grep -v ^# \
531.1Sagc	  | sort \
541.1Sagc	  | while read NUM CAT STRING; do \
551.1Sagc	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
561.1Sagc	  done >> ${.TARGET}
571.1Sagc	@echo "    { -1, FETCH_UNKNOWN, \"Unknown HTTP error\" }" >> ${.TARGET}
581.1Sagc	@echo "};" >> ${.TARGET}
591.1Sagc
601.1SagcMLINKS+= fetch.3 fetchFreeURL.3
611.1SagcMLINKS+= fetch.3 fetchGet.3
621.1SagcMLINKS+= fetch.3 fetchGetFTP.3
631.1SagcMLINKS+= fetch.3 fetchGetFile.3
641.1SagcMLINKS+= fetch.3 fetchGetHTTP.3
651.1SagcMLINKS+= fetch.3 fetchGetURL.3
661.1SagcMLINKS+= fetch.3 fetchList.3
671.1SagcMLINKS+= fetch.3 fetchListFTP.3
681.1SagcMLINKS+= fetch.3 fetchListFile.3
691.1SagcMLINKS+= fetch.3 fetchListHTTP.3
701.1SagcMLINKS+= fetch.3 fetchListURL.3
711.1SagcMLINKS+= fetch.3 fetchMakeURL.3
721.1SagcMLINKS+= fetch.3 fetchParseURL.3
731.1SagcMLINKS+= fetch.3 fetchPut.3
741.1SagcMLINKS+= fetch.3 fetchPutFTP.3
751.1SagcMLINKS+= fetch.3 fetchPutFile.3
761.1SagcMLINKS+= fetch.3 fetchPutHTTP.3
771.1SagcMLINKS+= fetch.3 fetchPutURL.3
781.1SagcMLINKS+= fetch.3 fetchStat.3
791.1SagcMLINKS+= fetch.3 fetchStatFTP.3
801.1SagcMLINKS+= fetch.3 fetchStatFile.3
811.1SagcMLINKS+= fetch.3 fetchStatHTTP.3
821.1SagcMLINKS+= fetch.3 fetchStatURL.3
831.1SagcMLINKS+= fetch.3 fetchXGet.3
841.1SagcMLINKS+= fetch.3 fetchXGetFTP.3
851.1SagcMLINKS+= fetch.3 fetchXGetFile.3
861.1SagcMLINKS+= fetch.3 fetchXGetHTTP.3
871.1SagcMLINKS+= fetch.3 fetchXGetURL.3
881.1Sagc
891.1Sagc.include <bsd.lib.mk>
90