-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (54 loc) · 1.13 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
#Name
NAME = libasm.a
#Compiler
CC = nasm
CFLAGS = -f macho64
#Make
MAKE = make -s -C
MAKE_CLEAN = make clean -s -C
MAKE_FCLEAN = make fclean -s -C
#Unzip
UNZIP = unzip -X -o -q
#Norm
NORM = norminette
#Shell
MKDIR = mkdir -p
CP = cp
RM = rm -rf
#Files
FILES = ft_strlen.s \
ft_strcpy.s \
ft_strcmp.s \
ft_write.s \
ft_read.s \
ft_strdup.s \
FILES_BONUS = ft_atoi_base_bonus.s \
ft_list_push_front_bonus.s \
ft_list_size_bonus.s \
ft_list_sort_bonus.s \
ft_list_remove_if_bonus.s
:
#Srcs
SRCS = $(foreach FILE, $(FILES), $(shell find . -name $(FILE)))
SRCS_BONUS = $(foreach FILE, $(FILES_BONUS), $(shell find . -name $(FILE)))
#Objs
OBJS = $(SRCS:.s=.o)
OBJS_BONUS = $(SRCS_BONUS:.s=.o)
%.o: %.s
@$(MKDIR) $(@D)
@$(CC) $(CFLAGS) $<
$(NAME): $(OBJS)
@ar rcs $(NAME) $(OBJS)
@echo "Done!"
all: $(NAME)
bonus: $(NAME) $(OBJS_BONUS)
@ar rcs $(NAME) $(OBJS) $(OBJS_BONUS)
norminette:
@$(NORM) $(shell find -name *.s)
@$(NORM) $(shell find -name *.h)
clean:
@$(RM) $(OBJS) $(OBJS_BONUS)
fclean: clean
@$(RM) $(NAME)
re: fclean all
.PHONY: all bonus norminette clean fclean re