-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (36 loc) · 856 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
37
38
39
40
41
42
43
44
45
46
47
#
# Makefile for fusiontree
#
# Created by Mateus Bezrutchka on 2/3/18 based on Makefiles for projects from
# MIT class 6.172
#
#
# Usage:
# "make" will make the main program by default
# "make clean" remove all files created by previous compilations
# "make format" formats all source code according to Google's format for C++
#
HEADERS = $(wildcard *.hpp)
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)
PROGRAM = main.exe
COMP = clang++
COMPFLAGS = -Wall -g -mavx2 -pg
LDFLAGS = -lm
ifeq ($(DEBUG),1)
COMPFLAGS += -O0
else
COMPFLAGS += -O3
endif
ifeq ($(NAIVE),1)
COMPFLAGS += -DNAIVE=1
endif
all: $(PROGRAM)
format:
clang-format -style='Google' -i *.cpp *.hpp
clean:
$(RM) $(PROGRAM) *.o *.out
%.o: %.cpp $(HEADERS)
$(COMP) $(COMPFLAGS) -o $@ -c $<
$(PROGRAM): $(OBJECTS)
$(COMP) $(LDFLAGS) -o $@ $(OBJECTS)