-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (67 loc) · 1.96 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lportay <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/04/25 17:01:50 by lportay #+# #+# #
# Updated: 2019/04/15 11:11:52 by lportay ### ########.fr #
# #
# **************************************************************************** #
.PHONY: clean fclean re rules main
CC=clang
CFLAGS=-Wall -Wextra -Werror -I includes/ -L. -lfts
NAME= libfts.a
SRCDIR=src/
OBJDIR=obj
SRC=\
ft_isalpha.s\
ft_isdigit.s\
ft_isalnum.s\
ft_isascii.s\
ft_isprint.s\
ft_toupper.s\
ft_tolower.s\
ft_strlen.s\
ft_puts.s\
ft_bzero.s\
ft_strcat.s\
ft_memcpy.s\
ft_memset.s\
ft_strdup.s\
ft_cat.s\
OBJ=$(addprefix $(OBJDIR)/, $(SRC:%.s=%.o))
HEADER= includes/libasm.h
GREEN="\033[32m"
RESET="\033[0m"
all: $(NAME)
$(NAME): $(OBJ)
ar rc $@ $?
ranlib $@
@echo $(GREEN)$(NAME)" Successfully created"$(RESET)
$(OBJDIR)/%.o: $(SRCDIR)%.s | $(OBJDIR)
nasm -f macho64 $< -o $@
$(OBJDIR):
mkdir -p $@
rules:
@echo 'lportay' > auteur
@echo "Here are the things to review before turning in your work\n\
1. Leaks\n\
2. Forbidden Functions\n\
3. Drop Useless Libraries\n\
3. Norme\n\
4. Adequate Compilation Flags\n\
5. Squash Commits\n\
6. Test properly and thoroughly your project"
main: $(NAME)
$(CC) $(CFLAGS) main.c -o main
@./main
@rm main
clean:
$(RM) -r $(OBJDIR)
fclean: clean
$(RM) $(NAME)
re:
$(MAKE) fclean
$(MAKE) all