aboutsummaryrefslogtreecommitdiffstats
path: root/libft
diff options
context:
space:
mode:
Diffstat (limited to 'libft')
-rw-r--r--libft/Makefile26
1 files changed, 21 insertions, 5 deletions
diff --git a/libft/Makefile b/libft/Makefile
index aef5f5d..e22c78a 100644
--- a/libft/Makefile
+++ b/libft/Makefile
@@ -109,33 +109,49 @@ SRCS = $(addprefix ${SRCS_DIR},${SRCS_NAME})
#------------------------------------------------------------------------------#
OBJS = $(patsubst ${SRCS_DIR}%.c,${OBJS_DIR}%.o,${SRCS})
#==============================================================================#
+#--------------------------------- UNIX ---------------------------------------#
+#==============================================================================#
+MKDIR = mkdir -p
+RM = rm -rf
+OS = $(shell uname)
+USER = $(shell w | grep tty7 | awk '{print $$1}')
+#==============================================================================#
#-------------------------------- Compiler ------------------------------------#
#==============================================================================#
DEBUG = -glldb
FSANITIZE = -fsanitize=address
#------------------------------------------------------------------------------#
CC = clang
+#------------------------------------------------------------------------------#
CFLAGS = -std=c89
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Werror
CFLAGS += -pedantic
+#------------------------------------------------------------------------------#
ifdef ASAN
CFLAGS += ${DEBUG}
CFLAGS += ${FSANITIZE}
endif
#------------------------------------------------------------------------------#
+ifdef OPTI
+ ifeq (${USER}, salaaad)
+ CFLAGS += -march=broadwell
+ else ifeq (${USER}, jozan)
+ CFLAGS += -march=ivybridge
+ else
+ CFLAGS += -march=native
+ endif
+ CFLAGS += -O2
+ CFLAGS += -pipe
+endif
+#------------------------------------------------------------------------------#
NAME = libft.a
#==============================================================================#
#-------------------------------- Library -------------------------------------#
#==============================================================================#
AR = ar rcs
#==============================================================================#
-#--------------------------------- UNIX ---------------------------------------#
-#==============================================================================#
-MKDIR = mkdir -p
-RM = rm -rf
-#==============================================================================#
#--------------------------------- Rules --------------------------------------#
#==============================================================================#
${OBJS_DIR}%.o: ${SRCS_DIR}%.c ${INCS_DIR}${INCS}