-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (40 loc) · 1.39 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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: tbruinem <[email protected]> +#+ #
# +#+ #
# Created: 2020/09/21 20:31:07 by tbruinem #+# #+# #
# Updated: 2020/10/20 16:03:08 by tbruinem ######## odam.nl #
# #
# **************************************************************************** #
NAME = 42cpp
SRCDIR = src
OBJDIR = obj
INCLDIR = incl
CXX = g++
SRC := main \
utils \
source \
Function \
header
OBJ := $(SRC:%=$(OBJDIR)/%.o)
SRC := $(SRC:%=$(SRCDIR)/%.cpp)
FLAGS = -Wall -Wextra -Werror
ifeq ($(DEBUG),1)
FLAGS += -g -fsanitize=address
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 $@
clean:
rm -rf $(OBJ)
fclean: clean
rm -rf $(NAME)
re: fclean all