xref: /freebsd/lib/libfetch/Makefile (revision 243e928310d073338c5ec089f0dce238a80b9866)
1# $FreeBSD$
2
3.include <src.opts.mk>
4
5PACKAGE=lib${LIB}
6LIB=		fetch
7CFLAGS+=	-I.
8SRCS=		fetch.c common.c ftp.c http.c file.c \
9		ftperr.h httperr.h
10INCS=		fetch.h
11MAN=		fetch.3
12CLEANFILES=	ftperr.h httperr.h
13
14.if ${MK_INET6_SUPPORT} != "no"
15CFLAGS+=	-DINET6
16.endif
17
18.if ${MK_OPENSSL} != "no"
19CFLAGS+=	-DWITH_SSL
20LIBADD+=	ssl crypto
21.else
22LIBADD+=	md
23.endif
24
25CFLAGS+=	-DFTP_COMBINE_CWDS
26
27CSTD?=		c99
28
29SHLIB_MAJOR=    6
30
31ftperr.h: ftp.errors ${.CURDIR}/Makefile
32	@echo "static struct fetcherr ftp_errlist[] = {" > ${.TARGET}
33	@cat ${.CURDIR}/ftp.errors \
34	  | grep -v ^# \
35	  | sort \
36	  | while read NUM CAT STRING; do \
37	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
38	  done >> ${.TARGET}
39	@echo "    { -1, FETCH_UNKNOWN, \"Unknown FTP error\" }" >> ${.TARGET}
40	@echo "};" >> ${.TARGET}
41
42httperr.h: http.errors ${.CURDIR}/Makefile
43	@echo "static struct fetcherr http_errlist[] = {" > ${.TARGET}
44	@cat ${.CURDIR}/http.errors \
45	  | grep -v ^# \
46	  | sort \
47	  | while read NUM CAT STRING; do \
48	    echo "    { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
49	  done >> ${.TARGET}
50	@echo "    { -1, FETCH_UNKNOWN, \"Unknown HTTP error\" }" >> ${.TARGET}
51	@echo "};" >> ${.TARGET}
52
53MLINKS+= fetch.3 fetchFreeURL.3
54MLINKS+= fetch.3 fetchGet.3
55MLINKS+= fetch.3 fetchGetFTP.3
56MLINKS+= fetch.3 fetchGetFile.3
57MLINKS+= fetch.3 fetchGetHTTP.3
58MLINKS+= fetch.3 fetchGetURL.3
59MLINKS+= fetch.3 fetchList.3
60MLINKS+= fetch.3 fetchListFTP.3
61MLINKS+= fetch.3 fetchListFile.3
62MLINKS+= fetch.3 fetchListHTTP.3
63MLINKS+= fetch.3 fetchListURL.3
64MLINKS+= fetch.3 fetchMakeURL.3
65MLINKS+= fetch.3 fetchParseURL.3
66MLINKS+= fetch.3 fetchPut.3
67MLINKS+= fetch.3 fetchPutFTP.3
68MLINKS+= fetch.3 fetchPutFile.3
69MLINKS+= fetch.3 fetchPutHTTP.3
70MLINKS+= fetch.3 fetchPutURL.3
71MLINKS+= fetch.3 fetchStat.3
72MLINKS+= fetch.3 fetchStatFTP.3
73MLINKS+= fetch.3 fetchStatFile.3
74MLINKS+= fetch.3 fetchStatHTTP.3
75MLINKS+= fetch.3 fetchStatURL.3
76MLINKS+= fetch.3 fetchXGet.3
77MLINKS+= fetch.3 fetchXGetFTP.3
78MLINKS+= fetch.3 fetchXGetFile.3
79MLINKS+= fetch.3 fetchXGetHTTP.3
80MLINKS+= fetch.3 fetchXGetURL.3
81
82.include <bsd.lib.mk>
83