##
# unzip Makefile fragment
##

.PHONY: unzip_clean

.SUFFIXES: .c

unzip_src = contrib/unzip/src
unzip_obj = contrib/unzip/src/.build

unzip_cflags := -Wmissing-format-attribute -Wpointer-arith
unzip_cflags += -Wcast-align -Wwrite-strings
unzip_cflags += ${ZLIB_CFLAGS} -I${unzip_src} -DNOUNCRYPT

unzip_objs = ${unzip_obj}/unzip.o ${unzip_obj}/ioapi.o

${unzip_obj}/%.o: ${unzip_src}/%.c
	$(if ${V},,@echo "  CC      " $<)
	${CC} -MD ${CFLAGS} ${unzip_cflags} -I${PREFIX}/include -c $< -o $@

-include $(unzip_objs:.o=.d)

${unzip_objs}: $(filter-out $(wildcard ${unzip_obj}), ${unzip_obj})

unzip_clean:
	$(if ${V},,@echo "  RM      " ${unzip_obj})
	${RM} -r ${unzip_obj}
