-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 703 Bytes
/
Makefile
File metadata and controls
40 lines (30 loc) · 703 Bytes
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
NAME = libft.a
SRC = srcs/palloc.c srcs/p_init.c srcs/pfree.c
OBJ = obj/palloc.o obj/p_init.o obj/pfree.o
SRCO = palloc.o p_init.o pfree.o
INC = includes/
$(NAME):
@gcc -c $(SRC) -I $(INC)
@mkdir obj && mv $(SRCO) obj/.
@ar rc $@ $(OBJ)
@ranlib $@
@echo "---> $@ created!"
all: $(NAME)
test :
@rm -rf test
@gcc -o test tests/test1.c -L . -lft
@./test && echo " <--- test1 result"
@rm -rf test
@gcc -o test tests/test2.c -L . -lft
@./test && echo " <--- test2 result"
@rm -rf test
@gcc -o test tests/test3.c -L . -lft
@./test && echo " <--- test3 result"
@rm -rf test
clean:
@rm -rf obj
fclean: clean
@rm -rf $(NAME)
@echo "---> $(NAME) deleted!"
@rm -rf test
re: fclean all