summaryrefslogtreecommitdiff
path: root/libfetch/Makefile
diff options
context:
space:
mode:
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)