-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (46 loc) · 1.57 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
54
55
56
57
58
59
NPROCS ?= $(shell nproc)
BUILDDIR = build
DEBFLAGS = -DCMAKE_BUILD_TYPE=DEBUG -DTULIPS_TESTS=ON
RELFLAGS = -DCMAKE_BUILD_TYPE=RELEASE -DTULIPS_HAS_HW_CHECKSUM=ON -DTULIPS_DISABLE_CHECKSUM_CHECK=ON -DTULIPS_IGNORE_INCOMPATIBLE_HW=OFF
EXTFLAGS ?=
.PHONY: build
default: build
build:
@[ -e $(BUILDDIR) ] && ninja -C $(BUILDDIR) -j $(NPROCS)
test: build
@[ -e $(BUILDDIR) ] && CTEST_PARALLEL_LEVEL=$(NPROCS) ninja -C $(BUILDDIR) test
format:
@[ -e $(BUILDDIR) ] && ninja -C $(BUILDDIR) -j $(NPROCS) format
format-check:
@[ -e $(BUILDDIR) ] && ninja -C $(BUILDDIR) -j $(NPROCS) format-check
tidy:
@[ -e $(BUILDDIR) ] && ninja -C $(BUILDDIR) -j $(NPROCS) tidy
debug-all:
@mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
rm -rf *; \
cmake -GNinja $(DEBFLAGS) $(EXTFLAGS) ..; \
cd ..
debug-lib:
@mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
rm -rf *; \
cmake -GNinja $(DEBFLAGS) -DTULIPS_TOOLS=OFF $(EXTFLAGS) ..; \
cd ..
release-all:
@mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
rm -rf *; \
cmake -G Ninja $(RELFLAGS) $(EXTFLAGS) ..; \
cd ..
release-lib:
@mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
rm -rf *; \
cmake -G Ninja $(RELFLAGS) -DTULIPS_TOOLS=OFF $(EXTFLAGS) ..; \
cd ..
install:
@[ -e $(BUILDDIR) ] && ninja -C $(BUILDDIR) install
clean:
@rm -rf $(BUILDDIR)
@rm -f *.keys *.log *.pcap