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/
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