mingw: add minimal pkg-config support

This commit is contained in:
fanquake 2021-08-05 15:32:21 +08:00
parent 78823d762e
commit 30630daa22
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
1 changed files with 21 additions and 0 deletions

View File

@ -52,6 +52,14 @@ endif
endif
DISTFILE:=$(shell echo "miniupnpc-bin-win32-`cat VERSION`-$(COMMITREF).zip")
LIBDIR ?= lib
# install directories
ifeq ($(strip $(PREFIX)),)
INSTALLPREFIX ?= /usr
else
INSTALLPREFIX ?= $(PREFIX)
endif
.PHONY: all dist clean
all: $(BINARIES)
@ -125,6 +133,19 @@ rc_version.h: VERSION
mv $@.tmp $@
endif
miniupnpc.pc: VERSION
$(RM) $@
echo "prefix=$(INSTALLPREFIX)" >> $@
echo "exec_prefix=\$${prefix}" >> $@
echo "libdir=\$${exec_prefix}/$(LIBDIR)" >> $@
echo "includedir=\$${prefix}/include" >> $@
echo "" >> $@
echo "Name: miniUPnPc" >> $@
echo "Description: UPnP IGD client lightweight library" >> $@
echo "Version: $(shell cat VERSION)" >> $@
echo "Libs: -L\$${libdir} -lminiupnpc" >> $@
echo "Cflags: -I\$${includedir}" >> $@
winres.o: miniupnpc.rc rc_version.h
$(WINDRES) -D INTERNAL_NAME=\\\"miniupnpc.dll\\0\\\" -i $< -o $@