Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (48 loc) · 1.95 KB
/
Copy pathMakefile
File metadata and controls
64 lines (48 loc) · 1.95 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: oburato <oburato@student.42sp.org.br> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/16 19:01:36 by oburato #+# #+# #
# Updated: 2023/02/19 01:03:43 by oburato ### ########.fr #
# #
# **************************************************************************** #
NAME=minishell
SRCS=main.c \
ft_readline.c \
ft_tokenize.c \
find_cmd.c
OBJS=$(SRCS:%.c=./build/%.o)
./build/%.o: %.c $(HEADER)
mkdir -p ./build
$(CC) -c $(CFLAGS) $< -o $@
CC=cc
CFLAGS=-Werror -Wall -Wextra -fPIC ##-fsanitize=address
# remove late ^^^^
LINKERS = -lrt -lm -lreadline
HEADER=minishell.h
LIBFT = ./libft/libft.a
all: $(NAME)
$(NAME): $(LIBFT) $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LIBFT) $(LINKERS) -o $(NAME)
$(LIBFT):
@make -C ./libft/
clean:
@make clean -C ./libft/
rm -rf $(OBJS)
fclean: clean
@make fclean -C ./libft/
rm -rf $(NAME)
re: fclean all
# Used in pipeline to run the tests
SO_LIBS=/lib/x86_64-linux-gnu/libreadline.so /lib/x86_64-linux-gnu/libhistory.so
shared: $(OBJS) $(HEADER) $(LIBFT)
@$(CC) -shared -o ./test/load.so $(OBJS) $(SO_LIBS) $(LIBFT)
cleant: clean
@rm -rf ./test/load.so
test: cleant shared
run: all
@valgrind -q --leak-check=full --show-leak-kinds=all --track-fds=yes --track-origins=yes --trace-children=yes --trace-children-skip='/bin/,/sbin/' --suppressions=readline.supp ./minishell
.PHONY: all clean fclean re