-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (47 loc) · 1.63 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
45
46
47
48
49
50
51
52
53
54
55
56
57
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: tbruinem <[email protected]> +#+ #
# +#+ #
# Created: 2020/09/21 20:31:07 by tbruinem #+# #+# #
# Updated: 2020/09/26 23:35:27 by tbruinem ######## odam.nl #
# #
# **************************************************************************** #
NAME = forehead
SRCDIR = src
OBJDIR = obj
INCLDIR = incl
CXX = g++
SRC := main \
Function
OS = $(shell uname)
OBJ := $(SRC:%=$(OBJDIR)/%.o)
SRC := $(SRC:%=$(SRCDIR)/%.cpp)
FLAGS = -Wall -Wextra -Werror -std=c++11
ifeq ($(DEBUG),1)
FLAGS += -g -fsanitize=address
endif
ifeq ($(RELEASE), 1)
ifeq ($(OS), Linux)
FLAGS += -finline-functions -Ofast -m64 -funroll-loops -ftree-vectorize
else
FLAGS += -finline-functions -Ofast -m64 -funroll-loops -fvectorize
endif
endif
all: $(NAME)
obj/%.o: src/%.cpp
@echo $(SRC)
@echo $(OBJ)
@mkdir -p $(@D)
$(CXX) -c $(FLAGS) -I $(INCLDIR) $< -o $@
$(NAME): $(OBJ)
$(CXX) $(FLAGS) -I $(INCLDIR) $(OBJ) -o $@
release: $(OBJ)
make re RELEASE=1
clean:
rm -rf $(OBJ)
fclean: clean
rm -rf $(NAME)
re: fclean all