summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-08-30 17:46:06 +0200
committerVicent Marti <tanoku@gmail.com>2011-08-30 17:46:06 +0200
commit9988a0123c03edccd95cd7b3b45620b3ac6b445c (patch)
tree089dbd6b1ff3b45c5c6e5e47f3727a7bd21d8ee8 /Makefile
parentff2b89be866b5a925b37ac80ca31898ae0ee4187 (diff)
downloadrust-hoedown-9988a0123c03edccd95cd7b3b45620b3ac6b445c.tar.gz
Perfect hashing for HTML block names
Because fuck binary searches, that's why.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 56dc501..de38f2a 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ CFLAGS=-c -g -O3 -fPIC -Wall -Werror -Isrc -Ihtml $(MFLAGS)
LDFLAGS=-g -O3 -Wall -Werror $(MFLAGS)
CC=gcc
-all: libsundown.so sundown smartypants
+all: libsundown.so sundown smartypants html_blocks
.PHONY: all clean
@@ -43,6 +43,13 @@ sundown: examples/sundown.o src/markdown.o src/array.o src/autolink.o src/buffer
smartypants: examples/smartypants.o src/buffer.o html/html_smartypants.o html/html.o src/autolink.o
$(CC) $(LDFLAGS) $^ -o $@
+# perfect hashing
+html_blocks: src/html_blocks.h
+
+src/html_blocks.h: html_block_names.txt
+ gperf -N find_block_tag -H hash_block_tag -C -c -E --ignore-case $^ > $@
+
+
# housekeeping
clean:
rm -f src/*.o html/*.o examples/*.o