3 # Copyright (c) 2009, Natacha Porté
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 # "Machine-dependent" options
22 CFLAGS=-c -g -O3 -fPIC -Wall -Werror -Wsign-compare -Isrc -Ihtml
23 LDFLAGS=-g -O3 -Wall -Werror
33 html/html_smartypants.o \
34 html/houdini_html_e.o \
37 all: libsundown.so sundown smartypants html_blocks
43 libsundown.so: libsundown.so.1
46 libsundown.so.1: $(SUNDOWN_SRC)
47 $(CC) $(LDFLAGS) -shared -Wl $^ -o $@
51 sundown: examples/sundown.o $(SUNDOWN_SRC)
52 $(CC) $(LDFLAGS) $^ -o $@
54 smartypants: examples/smartypants.o $(SUNDOWN_SRC)
55 $(CC) $(LDFLAGS) $^ -o $@
58 html_blocks: src/html_blocks.h
60 src/html_blocks.h: html_block_names.txt
61 gperf -N find_block_tag -H hash_block_tag -C -c -E --ignore-case $^ > $@
66 rm -f src/*.o html/*.o examples/*.o
67 rm -f libsundown.so libsundown.so.1 sundown smartypants
68 rm -f sundown.exe smartypants.exe
74 include $(wildcard $(DEPDIR)/*.d)
77 # generic object compilations
79 %.o: src/%.c examples/%.c html/%.c
81 @$(CC) -MM $< > $(DEPDIR)/$*.d
82 $(CC) $(CFLAGS) -o $@ $<