summaryrefslogtreecommitdiffstats
path: root/lib/libftpio/Makefile
blob: ce86c166be666e74e5e2d3e99f5441fc61a0075d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LIB=		ftpio
CFLAGS+=	-I${.CURDIR} -Wall
SRCS=		ftpio.c ftperr.c
MAN3=		ftpio.3
CLEANFILES+=	ftperr.c

SHLIB_MAJOR=    4
SHLIB_MINOR=	0

beforeinstall:
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/ftpio.h \
		${DESTDIR}/usr/include

ftperr.c:	ftp.errors
	@echo '#include <stdio.h>' > ${.TARGET}
	@echo '#include "ftpio.h"' >> ${.TARGET}
	@echo "struct ftperr ftpErrList[] = {" \ >>  ${.TARGET}
	@cat ${.ALLSRC} \
	  | grep -v ^# \
	  | sort \
	  | while read NUM STRING; do \
	    echo "  { $${NUM}, \"$${STRING}\" },"; \
	  done >> ${.TARGET}
	@echo "};" >> ${.TARGET}
	@echo -n "int const ftpErrListLength = " >> ${.TARGET}
	@echo "sizeof(ftpErrList) / sizeof(*ftpErrList);" >> ${.TARGET}

.include <bsd.lib.mk>
OpenPOWER on IntegriCloud