From fb5a0e7a27722a0c6577a35977748364252f1f49 Mon Sep 17 00:00:00 2001 From: nishi Date: Sun, 21 Jan 2024 15:09:56 +0000 Subject: [PATCH] static link git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@41 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/Makefile | 7 +++++-- Makefile | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Library/Makefile b/Library/Makefile index 3d39545..ad1edac 100644 --- a/Library/Makefile +++ b/Library/Makefile @@ -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/ diff --git a/Makefile b/Makefile index 25937a9..6afceb6 100644 --- 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 -- 2.43.0