From: nishi Date: Wed, 17 Jan 2024 00:46:42 +0000 (+0000) Subject: well X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1a3014f948b5a2c7ca93c6b052e356e55e1907ae;p=libw3.git well git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@2 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Example/Makefile b/Example/Makefile new file mode 100644 index 0000000..0b15da1 --- /dev/null +++ b/Example/Makefile @@ -0,0 +1,7 @@ +.PHONY: clean + +./fetch: ./fetch.c + $(CC) -o $@ $< ../Library/libw3.so + +clean: + rm -f fetch *.o *.so *.core diff --git a/Example/fetch.c b/Example/fetch.c new file mode 100644 index 0000000..bf4f8f7 --- /dev/null +++ b/Example/fetch.c @@ -0,0 +1,14 @@ +/* $Id$ + * + * Fetch a file using libw3. + * + */ + +#include + +int main(int argc, char** argv){ + if(argc < 2){ + fprintf(stderr, "Usage: %s URL\n", argv[0]); + return 1; + } +} diff --git a/Library/Core.c b/Library/Core.c new file mode 100644 index 0000000..99b5b5a --- /dev/null +++ b/Library/Core.c @@ -0,0 +1,2 @@ +/* $Id$ */ +#include "W3Core.h" diff --git a/Library/Makefile b/Library/Makefile new file mode 100644 index 0000000..468ebaa --- /dev/null +++ b/Library/Makefile @@ -0,0 +1,11 @@ +# $Id$ +.PHONY: clean + +./libw3.so: ./Core.o + $(CC) $(LDFLAGS) -shared -o $@ $^ + +./%.o: ./%.c W3%.h + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -f *.o *.so *.core diff --git a/Library/W3Core.h b/Library/W3Core.h new file mode 100644 index 0000000..ff003c8 --- /dev/null +++ b/Library/W3Core.h @@ -0,0 +1,5 @@ +/* $Id$ */ +#ifndef __W3CORE_H__ +#define __W3CORE_H__ + +#endif diff --git a/Makefile b/Makefile index aa8871f..37ff8bb 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,19 @@ LIBS := ifdef SSL LIBS += -lssl -lcrypto +SSL=SSL=YES endif -.PHONY: all +.PHONY: all clean -all: ./Library/libw3.so +all: ./Library/libw3.so ./Example/fetch ./Library/libw3.so: - $(MAKE) -C ./Library + $(MAKE) -C ./Library $(SSL) CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" + +./Example/fetch: + $(MAKE) -C ./Example CC=$(CC) fetch + +clean: + $(MAKE) -C ./Library clean + $(MAKE) -C ./Example clean