--- /dev/null
+.PHONY: clean
+
+./fetch: ./fetch.c
+ $(CC) -o $@ $< ../Library/libw3.so
+
+clean:
+ rm -f fetch *.o *.so *.core
--- /dev/null
+/* $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;
+ }
+}
--- /dev/null
+/* $Id$ */
+#include "W3Core.h"
--- /dev/null
+# $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
--- /dev/null
+/* $Id$ */
+#ifndef __W3CORE_H__
+#define __W3CORE_H__
+
+#endif
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