Create and install pkg-config file

tight-png
Andri Yngvason 2019-09-07 17:25:27 +00:00
parent 5aea8a61ed
commit de3a86e343
2 changed files with 20 additions and 1 deletions

View File

@ -8,6 +8,8 @@ SOURCES := \
include common.mk
VERSION=0.0.0
DSO_NAME=libneatvnc
DSO_MAJOR=0
DSO_MINOR=0
@ -30,6 +32,9 @@ $(DSO): $(OBJECTS)
$(BUILD_DIR)/%.o: src/%.c | $(BUILD_DIR) ; $(CC_OBJ)
$(BUILD_DIR)/miniz.o: contrib/miniz/miniz.c | $(BUILD_DIR) ; $(CC_OBJ)
$(BUILD_DIR)/neatvnc.pc:
PREFIX=$(PREFIX) VERSION=$(VERSION) ./gen-pkgconfig.sh >$@
BENCH_DIR = $(BUILD_DIR)/bench
$(BENCH_DIR)/%.o: bench/%.c | $(BENCH_DIR)
@ -42,8 +47,9 @@ $(BENCH_DIR)/zrle-bench: $(OBJECTS) $(BUILD_DIR)/pngfb.o \
$(LINK_EXE) $(shell pkg-config --libs libpng)
.PHONY: install
install: $(DSO)
install: $(DSO) $(BUILD_DIR)/neatvnc.pc
install $(INSTALL_STRIP) -Dt $(DESTDIR)$(PREFIX)/lib $(BUILD_DIR)/*.so*
install -Dt $(DESTDIR)$(PREFIX)/lib/pkgconfig $(BUILD_DIR)/neatvnc.pc
install -Dt $(DESTDIR)$(PREFIX)/include inc/neatvnc.h
.PHONY: bench

13
gen-pkgconfig.sh 100755
View File

@ -0,0 +1,13 @@
#!/usr/bin/bash
cat <<EOF
prefix=$PREFIX
libdir=\${prefix}/lib
includedir=\${prefix}/include
Name: neatvnc
Description: A neat VNC server library
Version: $VERSION
Libs: -L\${libdir} -lneatvnc
Cflags: -I\${includedir}
EOF