]> git.lizzy.rs Git - rust.git/blob - src/rt/sundown/Makefile
Ignore tests broken by failing on ICE
[rust.git] / src / rt / sundown / Makefile
1 # Makefile
2
3 # Copyright (c) 2009, Natacha Porté
4 #
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.
8 #
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.
16
17 DEPDIR=depends
18
19 # "Machine-dependent" options
20 #MFLAGS=-fPIC
21
22 CFLAGS=-c -g -O3 -fPIC -Wall -Werror -Wsign-compare -Isrc -Ihtml
23 LDFLAGS=-g -O3 -Wall -Werror 
24 CC=gcc
25
26
27 SUNDOWN_SRC=\
28         src/markdown.o \
29         src/stack.o \
30         src/buffer.o \
31         src/autolink.o \
32         html/html.o \
33         html/html_smartypants.o \
34         html/houdini_html_e.o \
35         html/houdini_href_e.o
36
37 all:            libsundown.so sundown smartypants html_blocks
38
39 .PHONY:         all clean
40
41 # libraries
42
43 libsundown.so:  libsundown.so.1
44         ln -f -s $^ $@
45
46 libsundown.so.1: $(SUNDOWN_SRC)
47         $(CC) $(LDFLAGS) -shared -Wl $^ -o $@
48
49 # executables
50
51 sundown:        examples/sundown.o $(SUNDOWN_SRC)
52         $(CC) $(LDFLAGS) $^ -o $@
53
54 smartypants: examples/smartypants.o $(SUNDOWN_SRC)
55         $(CC) $(LDFLAGS) $^ -o $@
56
57 # perfect hashing
58 html_blocks: src/html_blocks.h
59
60 src/html_blocks.h: html_block_names.txt
61         gperf -N find_block_tag -H hash_block_tag -C -c -E --ignore-case $^ > $@
62
63
64 # housekeeping
65 clean:
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
69         rm -rf $(DEPDIR)
70
71
72 # dependencies
73
74 include $(wildcard $(DEPDIR)/*.d)
75
76
77 # generic object compilations
78
79 %.o:    src/%.c examples/%.c html/%.c
80         @mkdir -p $(DEPDIR)
81         @$(CC) -MM $< > $(DEPDIR)/$*.d
82         $(CC) $(CFLAGS) -o $@ $<
83