aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 3f0706e9563596c5f2d9c2ce109f18b9a39ac75d (plain) (blame)
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
TEST += bitfield
TEST += option

# -- INTERNALS -----------------------------------------------------------------

BINS = $(TEST:%=build/%)
DEPS = $(TEST:%=build/%.d)

# -- FLAGS ---------------------------------------------------------------------

DEPS_GEN = -MMD
CXXFLAGS = -g -Wall -Wextra -Werror -I. -std=c++14 $(DEPS_GEN)

# -- RULES ---------------------------------------------------------------------

all: build $(BINS)

bear:
	bear intercept -- $(MAKE) all
	bear citnames

build/%: build/%.o
	$(CXX) -o $@ $<

build/%.o: test/%.cc
	$(CXX) -c -o $@ $< $(CXXFLAGS)

build:
	mkdir -p build

clean:
	$(RM) -r build
	$(RM) compile_commands.json events.json

# Since DEPS files contain rules, include at the end.
-include $(DEPS)