summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '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