summaryrefslogtreecommitdiff
path: root/examples/example.mk
diff options
context:
space:
mode:
Diffstat (limited to 'examples/example.mk')
-rw-r--r--examples/example.mk24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/example.mk b/examples/example.mk
new file mode 100644
index 0000000..8e1da17
--- /dev/null
+++ b/examples/example.mk
@@ -0,0 +1,24 @@
+# From the top level:
+#
+# make -C examples -f example.mk clean
+# make -C examples -f example.mk
+# ./examples/dom-structure-dump examples/files/test.html
+
+CC := gcc
+LD := gcc
+
+CFLAGS := `pkg-config --cflags libdom` `pkg-config --cflags libwapcaplet` -Wall -O0 -g
+LDFLAGS := `pkg-config --libs libdom` `pkg-config --libs libwapcaplet`
+
+SRC := dom-structure-dump.c
+
+dom-structure-dump: $(SRC:.c=.o)
+ @$(LD) -o $@ $^ $(LDFLAGS)
+
+.PHONY: clean
+clean:
+ $(RM) dom-structure-dump $(SRC:.c=.o)
+
+%.o: %.c
+ @$(CC) -c $(CFLAGS) -o $@ $<
+