-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
36 lines (30 loc) · 914 Bytes
/
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
.PHONY: help
help:
@printf 'usage: make <option>\n'
@printf '\n'
@printf 'options:\n'
@printf '\ttest\t\trun test\n'
@printf '\tdemo\t\trun demo\n'
@printf '\tclean\t\tclean compiled files\n'
CC = g++
CXXFLAGS = -Wall -O3 --std=c++17
TEST_DEPS = src/FixedPointNumberTest.cpp include/FixedPointNumber.hpp
TEST_SRCS = src/FixedPointNumberTest.cpp
DEMO_DEPS = src/FixedPointNumberDemo.cpp include/FixedPointNumber.hpp
DEMO_SRCS = src/FixedPointNumberDemo.cpp
INCLUDES = -I./include
.PHONY: test
test: bin/FixedPointNumberTest.out
bin/FixedPointNumberTest.out
bin/FixedPointNumberTest.out: $(TEST_DEPS)
mkdir -p bin
$(CC) -o $@ $(TEST_SRCS) $(INCLUDES) $(CXXFLAGS)
.PHONY: demo
demo: bin/FixedPointNumberDemo.out
bin/FixedPointNumberDemo.out data/
bin/FixedPointNumberDemo.out: $(DEMO_DEPS)
mkdir -p bin
$(CC) -o $@ $(DEMO_SRCS) $(INCLUDES) $(CXXFLAGS)
.PHONY: clean
clean:
rm -f bin/*.out