From f8dececb34b3bbcd5ec5c073db941529a6bdeb06 Mon Sep 17 00:00:00 2001 From: nishi Date: Wed, 17 Jan 2024 02:48:48 +0000 Subject: [PATCH] well git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@6 d27a3e52-49c5-7645-884c-6793ebffc270 --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa88a14..7a76b1f 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ endif .PHONY: all clean ./Library/libw3.so ./Example/fetch -all: ./Library/libw3.so ./Example/fetch +all: ./w3.pc ./Library/libw3.so ./Example/fetch ./Library/libw3.so: $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" @@ -26,10 +26,25 @@ all: ./Library/libw3.so ./Example/fetch ./Example/fetch: $(MAKE) -C ./Example CC=$(CC) fetch +./w3.pc: + echo "prefix=$(PREFIX)" > $@ + echo "exec_prefix=\$${prefix}" >> $@ + echo "includedir=\$${prefix}/include" >> $@ + echo "libdir=\$${exec_prefix}/lib" >> $@ + echo >> $@ + echo "Name: w3" >> $@ + echo "Description: The WWW Library" >> $@ + echo "Version: $(shell cat Library/W3Core.h | grep LIBW3_VERSION | sed -E "s/.+\"([^\"]+)\"/\1/g")" >> $@ + echo "Cflags: -I\$${includedir}/W3" >> $@ + echo "Libs: -I\$${libdir} -lw3" >> $@ + clean: + rm ./w3.pc $(MAKE) -C ./Library clean $(MAKE) -C ./Example clean -install: +install: ./w3.pc $(MAKE) -C ./Library install PREFIX=$(PREFIX) $(MAKE) -C ./Example install PREFIX=$(PREFIX) + mkdir -p $(PREFIX)/lib/pkgconfig + cp ./w3.pc $(PREFIX)/lib/pkgconfig/ -- 2.43.0