summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoe <rbousset@42lyon.fr>2020-11-25 12:40:08 +0100
committerjoe <rbousset@42lyon.fr>2020-11-25 12:40:08 +0100
commitc215e751527ba78fe5934fc10fd4baea104988de (patch)
treecabebe37e17469498be24768ef1fdb172c5ab144
parentgitignore update (diff)
download42-minishell-c215e751527ba78fe5934fc10fd4baea104988de.tar.gz
42-minishell-c215e751527ba78fe5934fc10fd4baea104988de.tar.bz2
42-minishell-c215e751527ba78fe5934fc10fd4baea104988de.tar.xz
42-minishell-c215e751527ba78fe5934fc10fd4baea104988de.tar.zst
42-minishell-c215e751527ba78fe5934fc10fd4baea104988de.zip
less retarded Makefile
-rw-r--r--Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 8bcb1d9..8b50f41 100644
--- a/Makefile
+++ b/Makefile
@@ -117,13 +117,13 @@ LFT_SRCS = $(shell find ${LFT_SRCS_DIR} -name "*.c")
#-------------------------------- COMPILER ------------------------------------#
#==============================================================================#
ifeq (${OS}, FreeBSD)
-CC = /usr/bin/cc
+CC = cc
endif
ifeq (${OS}, Linux)
CC = clang
endif
ifeq (${OS}, Darwin)
-CC = clang
+CC = cc
endif
CFLAGS = -std=c89
CFLAGS += -Wall
@@ -146,15 +146,17 @@ MKDIR = mkdir -p
#==============================================================================#
LFTRULE = all
#------------------------------------------------------------------------------#
-${OBJS_DIR}%.o: ${SRCS_DIR}%.c ${INCS}
- @${MKDIR} ${OBJS_DIR}
+${OBJS_DIR}%.o: ${SRCS_DIR}%.c ${INCS}
${CC} -c ${CFLAGS} ${CDEFS} -I${LFT_INCS_DIR} -o $@ $<
#------------------------------------------------------------------------------#
-$(NAME): ${OBJS} ${LFT_SRCS} ${LFT_INCS_DIR}libft.h
+${OBJS_DIR}:
+ ${MKDIR} ${OBJS_DIR}
+#------------------------------------------------------------------------------#
+$(NAME): ${OBJS} ${LFT_SRCS} ${LFT_INCS_DIR}libft.h
@$(MAKE) --no-print-directory -C ${LFT_DIR} ${LFTRULE}
${CC} ${CFLAGS} ${CDEFS} -o ${NAME} ${OBJS} ${LDFLAGS}
#------------------------------------------------------------------------------#
-all: ${NAME}
+all: ${OBJS_DIR} ${NAME}
#------------------------------------------------------------------------------#
debug: CFLAGS += -glldb
debug: LFTRULE = debug