-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (57 loc) · 2.42 KB
/
Makefile
File metadata and controls
71 lines (57 loc) · 2.42 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ztisnes <ztisnes@student.42.us.org> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/08/12 19:53:21 by ztisnes #+# #+# #
# Updated: 2019/02/11 12:37:38 by ztisnes ### ########.fr #
# #
# **************************************************************************** #
################################################################################
# COLORS #
################################################################################
RES = \033[0m
RED = \033[1;31m
GREEN = \033[1;32m
YELLOW = \033[1;33m
LCYAN = \033[1;36m
CYAN = \033[1;34m
PURPLE = \033[0;35m
################################################################################
# INITIAL FORMAT OR COMPILATION #
################################################################################
NAME := libfts.a
CC = nasm
ASFLAGS = -f macho64
SRCDIR = src
OBJDIR = obj
EXE = test_asm
SRC = $(wildcard $(SRCDIR)/*.s)
OBJ = $(patsubst $(SRCDIR)/%.s, $(OBJDIR)/%.o, $(SRC))
################################################################################
# RULES #
################################################################################
all: $(NAME)
test:
gcc main.c $(NAME) -o $(EXE)
nasmins:
brew install nasm
brew unlink nasm && brew link nasm
echo "Restart your terminal :)"
$(OBJ): $(OBJDIR)/%.o: $(SRCDIR)/%.s
@mkdir -p $(OBJDIR)
$(CC) $(ASFLAGS) -o $@ $<
$(NAME): $(OBJ)
@ar rc $@ $^
clean:
/bin/rm -f $(OBJSRC)
/bin/rm -rf $(OBJDIR)
fclean: clean
/bin/rm -f $(NAME)
rm -rf ./$(EXE)
@ echo "👺🖕$(RED) ALL Binaries gone!$(RES) 👺🖕"
re: fclean all
@ echo "$(GREEN)♻️ Program remade completed ♻️$(RES)"
.PHONY: all clean fclean