-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
53 lines (38 loc) · 1.45 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright © 2014 Kosma Moczek <kosma@cloudyourcar.com>
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law. You can redistribute it and/or modify it under
# the terms of the Do What The Fuck You Want To Public License, Version 2, as
# published by Sam Hocevar. See the COPYING file for more details.
CFLAGS = -g -Wall -Wextra -Werror -std=c99 -I. -Itests
CFLAGS += -D_GNU_SOURCE
CFLAGS += -fPIC # needed due to our shared library shenanigans
LDLIBS = -lcheck -lm -lpthread -lrt
all: scan-build test example
@echo "+++ All good."""
test: unit fuzz
unit: tests/tests
@echo "+++ Running Check test suite..."
tests/tests
fuzz: ringfs.so tests/flashsim.so tests/fuzzer.py
@echo "+++ Running fuzzer..."
tests/fuzzer.py
scan-build: clean
@echo "+++ Running Clang Static Analyzer..."
scan-build $(MAKE) tests
docs:
doxygen
clean:
$(RM) *.o tests/*.o tests/tests html/ *.sim tags example
%.so: %.o
$(LINK.o) -shared $^ $(LOADLIBES) $(LDLIBS) -o $@
ringfs.o: ringfs.c ringfs.h
example: example.o ringfs.o tests/flashsim.o
example.o: example.c ringfs.h tests/flashsim.h
tests/tests: ringfs.o tests/tests.o tests/flashsim.o
tests/tests.o: tests/tests.c ringfs.h
tests/tests: ringfs.o tests/tests.o tests/flashsim.o
tests/tests.o: tests/tests.c ringfs.h
tests/flashsim.o: tests/flashsim.c tests/flashsim.h
ringfs.so: ringfs.o
tests/flashsim.so: tests/flashsim.o
.PHONY: all test unit fuzz scan-build clean docs