From: nishi Date: Wed, 17 Jan 2024 09:35:55 +0000 (+0000) Subject: a X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=cb7ff56f49ac9ca3b6c50f92b281fb8caec6ef20;p=libw3.git a git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@14 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Library/Makefile b/Library/Makefile index 07e0663..57226cd 100644 --- a/Library/Makefile +++ b/Library/Makefile @@ -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 $@ $< diff --git a/Makefile b/Makefile index 810cafb..93c5786 100644 --- 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" >> $@