-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (39 loc) · 1.2 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
CFLAGS+=-std=c99 -pedantic -Wall -Wextra
LDFLAGS+=
LDLIBS+=-lm
BIN=x3
ifeq ($(BUILD),debug)
CFLAGS+=-Og -g
LDFLAGS+=-rdynamic
endif
ifeq ($(BUILD),release)
CFLAGS+=-march=native -O3 -DNDEBUG
endif
ifeq ($(BUILD),profile-generate)
CFLAGS+=-march=native -O3 -DNDEBUG -fprofile-generate
LDFLAGS+=-fprofile-generate
endif
ifeq ($(BUILD),profile-use)
CFLAGS+=-march=native -O3 -DNDEBUG -fprofile-use
endif
ifeq ($(BUILD),profile)
CFLAGS+=-Og -g -pg
LDFLAGS+=-rdynamic -pg
endif
.PHONY: all
all: $(BIN)
x3: x3.o backend.o file.o dict.o tag_pair.o utils.o bio.o context.o ac.o
.PHONY: clean
clean:
-$(RM) -- *.o $(BIN)
.PHONY: distclean
distclean: clean
-$(RM) -- *.gcda gmon.out cachegrind.out.* callgrind.out.*
.PHONY: check
check: $(addsuffix .test,$(wildcard data/*))
%.test: all
echo $$(dirname $@)/$$(basename -s .test $@):
./x3 -zf $$(dirname $@)/$$(basename -s .test $@) $$(dirname $@)/$$(basename -s .test $@).x3
./x3 -df $$(dirname $@)/$$(basename -s .test $@).x3 $$(dirname $@)/$$(basename -s .test $@).x3.out
diff $$(dirname $@)/$$(basename -s .test $@) $$(dirname $@)/$$(basename -s .test $@).x3.out
rm $$(dirname $@)/$$(basename -s .test $@).x3 $$(dirname $@)/$$(basename -s .test $@).x3.out