]> Nishi Git Mirror - libw3.git/commitdiff
well
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 17 Jan 2024 00:46:42 +0000 (00:46 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 17 Jan 2024 00:46:42 +0000 (00:46 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@2 d27a3e52-49c5-7645-884c-6793ebffc270

Example/Makefile [new file with mode: 0644]
Example/fetch.c [new file with mode: 0644]
Library/Core.c [new file with mode: 0644]
Library/Makefile [new file with mode: 0644]
Library/W3Core.h [new file with mode: 0644]
Makefile

diff --git a/Example/Makefile b/Example/Makefile
new file mode 100644 (file)
index 0000000..0b15da1
--- /dev/null
@@ -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 (file)
index 0000000..bf4f8f7
--- /dev/null
@@ -0,0 +1,14 @@
+/* $Id$
+ *
+ * Fetch a file using libw3.
+ *
+ */
+
+#include <stdio.h>
+
+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 (file)
index 0000000..99b5b5a
--- /dev/null
@@ -0,0 +1,2 @@
+/* $Id$ */
+#include "W3Core.h"
diff --git a/Library/Makefile b/Library/Makefile
new file mode 100644 (file)
index 0000000..468ebaa
--- /dev/null
@@ -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 (file)
index 0000000..ff003c8
--- /dev/null
@@ -0,0 +1,5 @@
+/* $Id$ */
+#ifndef __W3CORE_H__
+#define __W3CORE_H__
+
+#endif
index aa8871f5c32c2a3224a56cf51805118c5198b87d..37ff8bbbe3b22facad263c8c772332290acec15e 100644 (file)
--- 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