-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 1.07 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
CXXFLAGS = -O3 -Wall -std=c++11 -lstdc++fs
CXX = g++
all: objects lib clean_objects compile
rm ./res/results.csv
debug: CXXFLAGS += -DMEMALLOC_CORE_DEBUG -g
debug: all
minimum: CXXFLAGS += -DTESTING_MINIMUM -g
minimum: objects lib clean_objects compile
rm ./res/minimum_results.csv
mallinfo: CXXFLAGS += -DTESTING_MALLINFO -DTESTING_MINIMUM -g
mallinfo: objects lib clean_objects compile
rm ./res/minimum_mallinfo_results.csv
run:
./testing.out
objects:
$(CXX) -c src/memalloc.cpp -o memalloc.o $(CXXFLAGS)
$(CXX) -c src/core/memalloc_core.cpp -o memalloc_core.o $(CXXFLAGS)
$(CXX) -c src/info/memalloc_info.cpp -o memalloc_info.o $(CXXFLAGS)
lib:
-mkdir bin
ar rvs bin/libmemalloc.a memalloc_core.o memalloc.o memalloc_info.o
ar rvs bin/libmemalloc_info.a memalloc_core.o memalloc_info.o
compile:
$(CXX) src/testing.cpp -o bin/testing.out $(CXXFLAGS) -std=c++17 -Lbin/ -lmemalloc -Lbin/ -lmemalloc_info
clean: clean_objects
rm ./bin/testing.out
rm ./bin/libmemalloc.a
rm ./bin/libmemalloc_info.a
clean_objects:
-rm memalloc.o
-rm memalloc_core.o
-rm memalloc_info.o