File tree 10 files changed +19
-18
lines changed
10 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -4,35 +4,36 @@ RM = rm -rf
4
4
MKDIR = mkdir -p
5
5
USERS = $(USER )
6
6
7
- OS = $(shell uname -s)
7
+ OS := $(shell uname -s)
8
8
ifeq ($(OS ) ,Linux)
9
- LINK = -lreadline
9
+ READLINE_LINK : = -lreadline
10
10
else
11
- COMP = -L/goinfre/$(USERS)/.brew/opt/readline/lib
12
- LINK = -I/goinfre/$(USERS)/.brew/opt/readline/include
11
+ READLINE_DIR := $(shell brew --prefix readline)
12
+ READLINE_COMP := -L$(READLINE_DIR ) /lib
13
+ READLINE_LINK := -I$(READLINE_DIR ) /include
13
14
endif
14
15
15
- SRCS = srcs /ft_close.c srcs /ft_dups.c srcs /ft_execve.c srcs /ft_fork.c srcs /ft_open.c srcs /ft_pipe.c srcs /ft_waits.c builtins/cd.c builtins/echo.c builtins/env.c builtins/export.c builtins/helpers.c builtins/pwd.c builtins/shell_exit.c builtins/unset.c builtins/utils.c execution/environment.c execution/execute.c execution/heredoc.c execution/misc.c execution/paths.c execution/shell.c execution/signals.c parsing/commands.c parsing/commands_list.c parsing/env.c parsing/expand.c parsing/expand_env.c parsing/free.c parsing/heredoc.c parsing/lexer.c parsing/operator.c parsing/parser.c parsing/heredoc_expansion.c parsing/parsing_utils.c parsing/token_list.c parsing/word_spliting.c utils/alpha.c utils/contains.c utils/fatal.c utils/ft_atoi.c utils/ft_calloc.c utils/ft_exit.c utils/ft_free.c utils/ft_itoa.c utils/ft_memcpy.c utils/ft_split.c utils/ft_strcmp.c utils/ft_strdup.c utils/ft_strjoins.c utils/ft_strlen.c utils/ft_substr.c utils/prints.c main.c
16
+ SRCS = helpers /ft_close.c helpers /ft_dups.c helpers /ft_execve.c helpers /ft_fork.c helpers /ft_open.c helpers /ft_pipe.c helpers /ft_waits.c builtins/cd.c builtins/echo.c builtins/env.c builtins/export.c builtins/helpers.c builtins/pwd.c builtins/shell_exit.c builtins/unset.c builtins/utils.c execution/environment.c execution/execute.c execution/heredoc.c execution/misc.c execution/paths.c execution/shell.c execution/signals.c parsing/commands.c parsing/commands_list.c parsing/env.c parsing/expand.c parsing/expand_env.c parsing/free.c parsing/heredoc.c parsing/lexer.c parsing/operator.c parsing/parser.c parsing/heredoc_expansion.c parsing/parsing_utils.c parsing/token_list.c parsing/word_spliting.c utils/alpha.c utils/contains.c utils/fatal.c utils/ft_atoi.c utils/ft_calloc.c utils/ft_exit.c utils/ft_free.c utils/ft_itoa.c utils/ft_memcpy.c utils/ft_split.c utils/ft_strcmp.c utils/ft_strdup.c utils/ft_strjoins.c utils/ft_strlen.c utils/ft_substr.c utils/prints.c main.c
16
17
SRCS_DIRS = $(dir $(SRCS ) )
17
18
18
- BIN_DIR = bin /
19
+ BIN_DIR = build /
19
20
20
21
OBJS = $(SRCS:%.c=$(BIN_DIR ) %.o )
21
22
OBJS_DIRS = $(dir $(OBJS ) )
22
23
23
- INCLUDES = includes/builtin.h includes/execution.h includes/minishell.h includes/parsing.h includes/srcs .h includes/utils.h
24
+ INCLUDES = includes/builtin.h includes/execution.h includes/minishell.h includes/parsing.h includes/helpers .h includes/utils.h
24
25
25
26
NAME = minishell
26
27
27
28
28
29
all : $(NAME )
29
30
30
31
$(NAME ) : $(OBJS )
31
- @$(CC ) $(OBJS ) -o $(NAME ) $(LINK )
32
+ @$(CC ) $(OBJS ) -o $(NAME ) $(READLINE_LINK )
32
33
33
34
$(BIN_DIR ) % .o : % .c $(INCLUDES )
34
35
@$(MKDIR ) $(OBJS_DIRS )
35
- $(CC ) $(COMP ) $(CFLAGS ) -c $< -o $@
36
+ $(CC ) $(READLINE_COMP ) $(CFLAGS ) -c $< -o $@
36
37
37
38
clean :
38
39
@$(RM ) $(BIN_DIR )
Original file line number Diff line number Diff line change 10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
- #include "srcs .h"
13
+ #include "helpers .h"
14
14
15
15
void ft_close (int fd )
16
16
{
Original file line number Diff line number Diff line change 10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
- #include "srcs .h"
13
+ #include "helpers .h"
14
14
15
15
void ft_dup (int fd )
16
16
{
Original file line number Diff line number Diff line change 10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
- #include "srcs .h"
13
+ #include "helpers .h"
14
14
15
15
void ft_execve (char * path , char * * argv )
16
16
{
Original file line number Diff line number Diff line change 10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
- #include "srcs .h"
13
+ #include "helpers .h"
14
14
15
15
int ft_fork (void )
16
16
{
Original file line number Diff line number Diff line change 10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
- #include "srcs .h"
13
+ #include "helpers .h"
14
14
15
15
int ft_open (char * path , int flags , int mode )
16
16
{
Original file line number Diff line number Diff line change 10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
- #include "srcs .h"
13
+ #include "helpers .h"
14
14
15
15
void ft_pipe (int fd [2 ])
16
16
{
Original file line number Diff line number Diff line change 10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
- #include "srcs .h"
13
+ #include "helpers .h"
14
14
15
15
void ft_waitpid (pid_t pid )
16
16
{
Original file line number Diff line number Diff line change 1
1
/* ************************************************************************** */
2
2
/* */
3
3
/* ::: :::::::: */
4
- /* srcs .h :+: :+: :+: */
4
+ /* helpers .h :+: :+: :+: */
5
5
/* +:+ +:+ +:+ */
6
6
/* By: relkabou <[email protected] > +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
Original file line number Diff line number Diff line change 28
28
# include "builtin.h"
29
29
# include "parsing.h"
30
30
# include "execution.h"
31
- # include "srcs .h"
31
+ # include "helpers .h"
32
32
# include "utils.h"
33
33
34
34
# define TRUE 1
You can’t perform that action at this time.
0 commit comments