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

Library/Makefile
Makefile

index 07e0663b22a9ebe6db62aac3b898676d82cf9f5f..57226cdc3bffdc7587bc3fa808faccb3031d6ffc 100644 (file)
@@ -1,8 +1,13 @@
 # $Id$
 .PHONY: clean install
 
+ifdef WINDOWS
+./w3.dll: ./Core.o ./Util.o ./DNS.o ./HTTP.o
+       $(CC) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
+else
 ./libw3.so: ./Core.o ./Util.o ./DNS.o ./HTTP.o
        $(CC) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
+endif
 
 ./%.o: ./%.c W3%.h
        $(CC) $(CFLAGS) -c -o $@ $<
index 810cafb4fc6fd2cf122c0c2f7cf2d6f28cd4f4a8..93c5786dcd6211b906d6800ca449d5d23533ac1b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,12 +20,21 @@ ifdef DEBUG
 CFLAGS += -g -D__DEBUG__
 endif
 
+ifdef WINDOWS
+.PHONY: all clean ./Library/w3.dll ./Example/fetch
+
+all: ./w3.pc ./Library/w3.dll ./Example/fetch
+
+./Library/w3.dll:
+       $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" WINDOWS=YES
+else
 .PHONY: all clean ./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)"
+endif
 
 ./Example/fetch:
        $(MAKE) -C ./Example CC=$(CC) fetch
@@ -38,7 +47,7 @@ all: ./w3.pc ./Library/libw3.so ./Example/fetch
        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 "Version: $(shell cat Library/W3Core.h | grep -m 1 LIBW3_VERSION | sed -E "s/.+\"([^\"]+)\"/\1/g")" >> $@
        echo "Cflags: -I\$${includedir}/W3" >> $@
        echo "Libs: -I\$${libdir} -lw3" >> $@