-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (23 loc) · 921 Bytes
/
Makefile
File metadata and controls
34 lines (23 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# md4s — Streaming markdown parser for C
# Single-file library. Just drop md4s.h + md4s.c into your project.
CC ?= cc
CFLAGS ?= -std=c11 -Wall -Wextra -Wpedantic -O2
AR ?= ar
.PHONY: all clean test spec fuzz
all: libmd4s.a
libmd4s.a: md4s.o
$(AR) rcs $@ $^
md4s.o: md4s.c md4s.h
$(CC) $(CFLAGS) -c -o $@ md4s.c
test: tests/run_tests
@./tests/run_tests
tests/run_tests: tests/test_main.c tests/test_md4s.c md4s.c md4s.h tests/test.h
$(CC) $(CFLAGS) -I. -g3 -O0 -o $@ tests/test_main.c tests/test_md4s.c md4s.c
spec: tests/test_spec
@./tests/test_spec
tests/test_spec: tests/test_spec.c tests/md4s_html.h md4s.c md4s.h
$(CC) $(CFLAGS) -I. -g3 -O0 -o $@ tests/test_spec.c md4s.c
fuzz: tests/fuzz_md4s.c md4s.c md4s.h
clang -fsanitize=fuzzer,address,undefined -g -O1 -I. -o tests/fuzz_md4s tests/fuzz_md4s.c md4s.c
clean:
rm -f md4s.o libmd4s.a tests/run_tests tests/test_spec tests/fuzz_md4s