]> Nishi Git Mirror - libw3.git/commitdiff
static link
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Sun, 21 Jan 2024 15:09:56 +0000 (15:09 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Sun, 21 Jan 2024 15:09:56 +0000 (15:09 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@41 d27a3e52-49c5-7645-884c-6793ebffc270

Library/Makefile
Makefile

index 3d395456b2161920674208b05332f2c1813d4fe1..ad1edac61ac03c3fedfa91167908b40175235509 100644 (file)
@@ -7,16 +7,19 @@ ifeq ($(WINDOWS),YES)
 else
 ./libw3.so: ./Core.o ./Util.o ./DNS.o ./HTTP.o
        $(CC) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
+./libw3.a: ./Core.o ./Util.o ./DNS.o ./HTTP.o
+       ar rcs $@ $^
 endif
 
 ./%.o: ./%.c W3%.h
        $(CC) $(CFLAGS) -c -o $@ $<
 
 clean:
-       rm -f *.o *.so *.core *~ *.dll *.lib
+       rm -f *.o *.so *.core *~ *.dll *.lib *.a
 
-install: ./libw3.so
+install: ./libw3.so ./libw3.a
        mkdir -p $(PREFIX)/lib
        cp ./libw3.so $(PREFIX)/lib/
+       cp ./libw3.a $(PREFIX)/lib/
        mkdir -p $(PREFIX)/include/W3
        cp *.h $(PREFIX)/include/W3/
index 25937a9824626248b7b3f3a5bc1219066c8a4b04..6afceb679bcf0737de67c8ed6c7f77cc4451c31a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,14 +50,17 @@ all: ./w3.pc ./Library/W3Version.h $(ALL)
 
 else
 
-.PHONY: all clean ./Library/libw3.so ./Example/fetch
+.PHONY: all clean ./Library/libw3.so ./Library/libw3.a ./Example/fetch
 
-ALL := ./Library/libw3.so ./Example/fetch
+ALL := ./Library/libw3.so ./Library/libw3.a ./Example/fetch
 
 all: ./w3.pc ./Library/W3Version.h $(ALL)
 
 ./Library/libw3.so:
-       $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"
+       $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" ./libw3.so
+
+./Library/libw3.a:
+       $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" ./libw3.a
 
 ./Example/fetch: ./Library/libw3.so
        $(MAKE) -C ./Example CC=$(CC) fetch