aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8f867c9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+CFLAGS := -fPIC $(shell guile-config compile) \
+ $(shell pkg-config --cflags gumbo) \
+ -I/usr/local/include/ -Wall
+LFLAGS := $(shell guile-config link) \
+ $(shell pkg-config --libs gumbo) \
+ -L/usr/local/lib -lcjson
+CC := gcc
+
+.PHONY: all clean
+
+all: libguile-json.so libguile-html.so
+
+%: %.oo
+ $(CC) -o $@ $< $(LFLAGS)
+
+%.x: %.c
+ guile-snarf -o $@ $< $(CFLAGS)
+
+libguile-%.so: %.oo
+ $(CC) -shared -o $@ $< $(LFLAGS)
+
+%.oo: %.c %.x
+ $(CC) -c -o $@ $(CFLAGS) $<
+
+clean:
+ -rm *.oo
+ -rm libguile-*.so