-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 1.58 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lkaser <lkaser@student.42.us.org> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/03/13 10:03:24 by lkaser #+# #+# #
# Updated: 2018/03/13 10:03:26 by lkaser ### ########.fr #
# #
# **************************************************************************** #
NAME = avm
LIST = main IOperand Operand Expression lex parse
SRC_DIR = src
OBJ_DIR = obj
SRC = $(addsuffix .cpp, $(addprefix src/, $(LIST)))
OBJ = $(addsuffix .o, $(addprefix $(OBJ_DIR)/, $(LIST)))
CPPFLAGS = -std=c++11 -O3 -march=native -Wall -Wextra -Werror
LDFLAGS =
all: $(OBJ_DIR) $(NAME)
$(OBJ_DIR):
@mkdir -p $(OBJ_DIR)
$(NAME): $(OBJ)
@echo "\033[32;1mLinking.. \033[0m"
@clang++ $(LDFLAGS) -o $@ $^
@echo "\033[32;1m"$(NAME)" created\033[0m"
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
clang++ $(CPPFLAGS) -c -o $@ $<
clean:
@echo "\033[31;1mCleaning..\033[0m"
@rm -f $(OBJ)
fclean:
@echo "\033[31;1mFull Cleaning..\033[0m"
@rm -rf $(OBJ_DIR)
@rm -f $(NAME)
re: fclean all
.PHONY: clean fclean all re directories