-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (28 loc) · 818 Bytes
/
Makefile
File metadata and controls
42 lines (28 loc) · 818 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
35
36
37
38
39
40
41
42
CC ?= gcc
CFLAGS ?= -O2 -Wall -Wextra -pedantic
LDFLAGS ?=
PKG_CFLAGS := $(shell pkg-config --cflags blkio)
PKG_LDFLAGS := $(shell pkg-config --libs blkio)
SRCS := blkbench.c test_hist.c test_funcs.c
.PHONY: all clean test test-output test-unit test-cli test-smoke lint format
all: blkbench
blkbench: blkbench.c
$(CC) $(CFLAGS) $(PKG_CFLAGS) -o $@ $< $(LDFLAGS) $(PKG_LDFLAGS) -lpthread -lm
test_hist: test_hist.c
$(CC) $(CFLAGS) -o $@ $< -lm
test_funcs: test_funcs.c
$(CC) $(CFLAGS) -o $@ $< -lm
test-unit: test_hist test_funcs
./test_hist
./test_funcs
test-cli: blkbench
bash test_cli.sh
test-smoke: blkbench
bash test_output.sh
test: test-unit test-cli test-smoke
lint:
clang-format --dry-run -Werror $(SRCS)
format:
clang-format -i $(SRCS)
clean:
rm -f blkbench test_hist test_funcs