summaryrefslogtreecommitdiff
path: root/libfetch/Makefile
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-10-05 10:57:45 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-10-05 16:59:14 +0300
commit86436fce2fe2364bbc9e705ddc92d7733fc8ed75 (patch)
tree9193dddcf9217194e1ac2e74ce920ecc1c349853 /libfetch/Makefile
parent9dc6278c7b4ef41810b264ca99b597634511bda1 (diff)
downloadapk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.tar.gz
apk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.tar.bz2
apk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.tar.xz
apk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.zip
build and use bundled libfetch natively
Diffstat (limited to 'libfetch/Makefile')
-rw-r--r--libfetch/Makefile51
1 files changed, 8 insertions, 43 deletions
diff --git a/libfetch/Makefile b/libfetch/Makefile
index cfcef4b..6b183cb 100644
--- a/libfetch/Makefile
+++ b/libfetch/Makefile
@@ -1,45 +1,10 @@
-# $NetBSD: Makefile,v 1.8 2016/10/27 10:05:38 joerg Exp $
+CFLAGS_ALL += -DINET6 -DWITH_SSL -DFTP_COMBINE_CWDS
+libs-y += libfetch.a
+libfetch.a-objs := common.o fetch.o file.o ftp.o http.o
+generate-y += ftperr.h httperr.h
-LIB= fetch
-SRCS= fetch.c common.c ftp.c http.c file.c
-DPSRCS= ftperr.h httperr.h
-INCS= fetch.h
-MAN= fetch.3
-CLEANFILES= ftperr.h httperr.h
-MKLINT= no
-MKPIC= no
-MKPROFILE= no
+quiet_cmd_generr = GENERR $@
+ cmd_generr = $(obj)/errlist.sh $(basename $(<F))_errlist $(shell echo $(basename $(<F)) | tr a-z A-Z) $< > $@
-.include <bsd.own.mk>
-
-CPPFLAGS+= -I.
-CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64
-
-FETCH_WITH_INET6?= no
-FETCH_WITH_OPENSSL?= no
-
-.if !empty(FETCH_WITH_INET6:M[yY][eE][sS])
-CPPFLAGS+= -DINET6
-.endif
-
-.if !empty(FETCH_WITH_OPENSSL:M[yY][eE][sS])
-CPPFLAGS+= -DWITH_SSL
-LDADD= -lssl -lcrypto
-.endif
-
-CPPFLAGS+= -DFTP_COMBINE_CWDS
-
-WARNS?= 4
-
-ftp.o: ftperr.h
-http.o: httperr.h
-
-ftperr.h: ${.CURDIR}/ftp.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh
- sh ${.CURDIR}/errlist.sh ftp_errlist FTP \
- ${.CURDIR}/ftp.errors > ${.TARGET}
-
-httperr.h: ${.CURDIR}/http.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh
- sh ${.CURDIR}/errlist.sh http_errlist HTTP \
- ${.CURDIR}/http.errors > ${.TARGET}
-
-.include <bsd.lib.mk>
+$(obj)/%err.h: $(obj)/%.errors
+ @$(call echo-cmd,generr) $(cmd_generr); $(cmd_generr)