]> Nishi Git Mirror - libw3.git/commitdiff
well
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 17 Jan 2024 02:48:48 +0000 (02:48 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 17 Jan 2024 02:48:48 +0000 (02:48 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@6 d27a3e52-49c5-7645-884c-6793ebffc270

Makefile

index fa88a14401d6cd1e995968a521dde6478583eb63..7a76b1f855cb52a5156e78d89f60970fb68e92dd 100644 (file)
--- 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/