diff options
Diffstat (limited to '')
-rw-r--r-- | Makefile | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -3,13 +3,14 @@ default: all #--------------------------------- SHELL --------------------------------------# #==============================================================================# SHELL := /bin/sh +OS = $(shell uname) #==============================================================================# #------------------------------ DIRECTORIES -----------------------------------# #==============================================================================# SRCS_DIR = src/ OBJS_DIR = obj/ LFT_DIR = libft/ -LFT_INCS_DIR = ${LFT_DIR}inc/ +LFT_INCS_DIR = ${LFT_DIR}include/ LFT_SRCS_DIR = ${LFT_DIR}src/ #==============================================================================# #--------------------------------- FILES --------------------------------------# @@ -19,6 +20,7 @@ SRCS_NAME += b_echo SRCS_NAME += b_env SRCS_NAME += b_exit SRCS_NAME += b_export +SRCS_NAME += b_export_next SRCS_NAME += b_pwd SRCS_NAME += b_type SRCS_NAME += b_unset @@ -28,7 +30,9 @@ SRCS_NAME += e_externs_next SRCS_NAME += e_externs_pipes SRCS_NAME += e_lcom SRCS_NAME += e_pipes +SRCS_NAME += f_alloc SRCS_NAME += f_chdir +SRCS_NAME += f_com SRCS_NAME += f_errno SRCS_NAME += f_fail SRCS_NAME += f_redir @@ -36,6 +40,7 @@ SRCS_NAME += m_argv SRCS_NAME += m_comm SRCS_NAME += m_funptr SRCS_NAME += m_loop +SRCS_NAME += m_minishell SRCS_NAME += m_prompt SRCS_NAME += m_redirs SRCS_NAME += s_destroy @@ -48,18 +53,16 @@ SRCS_NAME += p_lcom SRCS_NAME += p_lcom_next SRCS_NAME += u_utils SRCS_NAME += u_vars +SRCS_NAME += u_vars_next #------------------------------------------------------------------------------# -SRCS = $(addprefix ${SRCS_DIR}, $(addprefix ft_, \ - $(addsuffix .c, ${SRCS_NAME}))) -SRCS += ${SRCS_DIR}minishell.c +SRCS = $(addprefix ${SRCS_DIR}, $(addsuffix .c, ${SRCS_NAME})) #------------------------------------------------------------------------------# INCS_NAME = b_builtins INCS_NAME += d_enum INCS_NAME += d_define INCS_NAME += s_struct #------------------------------------------------------------------------------# -INCS = $(addprefix ${SRCS_DIR}, $(addprefix ft_, \ - $(addsuffix .h, ${INCS_NAME}))) +INCS = $(addprefix ${SRCS_DIR}, $(addsuffix .h, ${INCS_NAME})) INCS += $(patsubst %.c,%.h,${SRCS}) #------------------------------------------------------------------------------# OBJS = $(patsubst ${SRCS_DIR}%.c,${OBJS_DIR}%.o,${SRCS}) @@ -70,7 +73,15 @@ LFT_SRCS = $(shell find ${LFT_SRCS_DIR} -name "*.c") #==============================================================================# #-------------------------------- COMPILER ------------------------------------# #==============================================================================# +ifeq (${OS}, FreeBSD) +CC = /usr/bin/cc +endif +ifeq (${OS}, Linux) +CC = /usr/bin/clang-9 +endif +ifeq (${OS}, Darwin) CC = clang +endif CFLAGS = -std=c89 CFLAGS += -Wall CFLAGS += -Wextra |