-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (31 loc) · 662 Bytes
/
makefile
File metadata and controls
40 lines (31 loc) · 662 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
SHELL := /bin/bash
ifdef CXX
else
CXX = clang++
endif
ifdef CXX_VERSION
else
CXX_VERSION = c++14
endif
CXX_OPTIONS = -Wall -Wextra --std=${CXX_VERSION}
BUILD_DIR = build
.PHONY:all
all:example test
example:example.cpp py_string.hpp
mkdir -p $(BUILD_DIR)
$(CXX) $(CXX_OPTIONS) $< -o $(BUILD_DIR)/$@
./$(BUILD_DIR)/$@
clean:
rm -rf $(BUILD_DIR)
test:test/test.cpp py_string.hpp
mkdir -p $(BUILD_DIR)
$(CXX) $(CXX_OPTIONS) $< -o $(BUILD_DIR)/$@
./$(BUILD_DIR)/$@
prof_called:
g++ -g -pg $(CXX_OPTIONS) test/test.cpp
./a.out
gprof a.out -A > prof_called.log
prof_time:
g++ -pg $(CXX_OPTIONS) test/test.cpp
./a.out
gprof a.out > prof_time.log