aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 16 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index e696f20..7d7045d 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ SRCS_NAME += ft_drawsquare.c
SRCS_NAME += ft_parse_map.c
SRCS_NAME += ft_get_res.c
SRCS_NAME += ft_map_error.c
+SRCS_NAME += ft_init_winlx.c
#------------------------------------------------------------------------------#
SRCS = $(addprefix ${SRCS_DIR},${SRCS_NAME})
#------------------------------------------------------------------------------#
@@ -42,7 +43,7 @@ ifdef ASAN
CFLAGS += ${FSANITIZE}
endif
#------------------------------------------------------------------------------#
-DEBUG = -glldb
+DEBUG = -g3
FSANITIZE = -fsanitize=address
#------------------------------------------------------------------------------#
NAME = cub3d
@@ -51,20 +52,30 @@ NAME = cub3d
#==============================================================================#
MKDIR = mkdir -p
RM = rm -rf
+OS = $(shell uname)
#==============================================================================#
#--------------------------------- Rules --------------------------------------#
#==============================================================================#
${OBJS_DIR}%.o: ${SRCS_DIR}%.c ${INCS_DIR}${INCS}
@${MKDIR} ${OBJS_DIR}
- ${CC} -c ${CFLAGS} -I${LFT_DIR}${INCS_DIR} -I${MLX_DIR} -I${INCS_DIR} \
--o $@ $<
+ifeq (${OS}, Darwin)
+ ${CC} -c ${CFLAGS} -I${LFT_DIR}${INCS_DIR} -I${MLX_DIR} -I${INCS_DIR} -o $@ $<
+else
+ ${CC} -c ${CFLAGS} -I${LFT_DIR}${INCS_DIR} -I${INCS_DIR} -o $@ $<
+endif
#------------------------------------------------------------------------------#
${NAME}: ${OBJS}
+ifeq (${OS}, Darwin)
${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_DIR} -lft -lmlx -lm \
-framework OpenGL -framework AppKit
+else
+ ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -lft -lX11 -lXext -lmlx
+endif
#------------------------------------------------------------------------------#
all:
+ifeq (${OS}, Darwin)
@$(MAKE) --no-print-directory -C ${MLX_DIR} all
+endif
ifdef ASAN
@$(MAKE) --no-print-directory -C ${LFT_DIR} all ASAN=1
else
@@ -73,12 +84,13 @@ endif
@$(MAKE) ${NAME}
#------------------------------------------------------------------------------#
clean:
+ifeq (${OS}, Darwin)
@$(MAKE) --no-print-directory -C ${MLX_DIR} clean
+endif
@$(MAKE) --no-print-directory -C ${LFT_DIR} clean
${RM} ${OBJS_DIR}
#------------------------------------------------------------------------------#
fclean: clean
- @$(MAKE) --no-print-directory -C ${MLX_DIR} clean
@$(MAKE) --no-print-directory -C ${LFT_DIR} fclean
${RM} ${NAME}
${RM} ${NAME}.dSYM