From c215e751527ba78fe5934fc10fd4baea104988de Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 25 Nov 2020 12:40:08 +0100 Subject: less retarded Makefile --- Makefile | 14 ++++++++------ 1 file 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 -- cgit v1.2.3