diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 17:25:27 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 17:25:27 +0100 |
commit | 842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24 (patch) | |
tree | fa3894a02efd5cd730b6f395ae01ff82bdaf65e7 /Makefile | |
parent | Edited sounds, bug fix (diff) | |
parent | Back to the GNU C Compiler, tweaked move speed (diff) | |
download | 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.gz 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.bz2 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.xz 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.tar.zst 42-cub3d-842613f64e4e4cb5b1e138cb0e9e4ccbba0a3a24.zip |
Merge branch 'master' into back-to-pthread
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -12,6 +12,7 @@ SRCS_DIR = src/ OBJS_DIR = obj/ LFT_DIR = libft/ MLX_DIR = minilibx/ +MLX_GNU_DIR = minilibx_linux/ #==================================================================================================# #---------------------------------------------- Files ---------------------------------------------# #==================================================================================================# @@ -123,7 +124,11 @@ endif DEBUG = -glldb FSANITIZE = -fsanitize=address #--------------------------------------------------------------------------------------------------# -CC = clang +ifeq (${OS}, Darwin) + CC = clang +else + CC = gcc +endif #--------------------------------------------------------------------------------------------------# CFLAGS = -std=c89 CFLAGS += -Wall @@ -153,12 +158,14 @@ ${OBJS_DIR}%.o: ${SRCS_DIR}%.c ${INCS_DIR} ifeq (${OS}, Darwin) ${CC} -c ${CFLAGS} ${CDEFS} -I${LFT_DIR}${INCS_DIR} -I${MLX_DIR} -I${INCS_DIR} -o $@ $< else - ${CC} -c ${CFLAGS} ${CDEFS} -I${LFT_DIR}${INCS_DIR} -I${INCS_DIR} -o $@ $< + ${CC} -c ${CFLAGS} ${CDEFS} -I${LFT_DIR}${INCS_DIR} -I${MLX_GNU_DIR} -I${INCS_DIR} -o $@ $< endif #--------------------------------------------------------------------------------------------------# ${NAME}: ${OBJS} ${LFT_SRCS} ${LFT_DIR}${INCS_DIR}libft.h ifeq (${OS}, Darwin) @$(MAKE) --no-print-directory -C ${MLX_DIR} all +else + @${MAKE} --no-print-directory -C ${MLX_GNU_DIR} all endif ifdef ASAN @$(MAKE) --no-print-directory -C ${LFT_DIR} all ASAN=1 @@ -169,7 +176,8 @@ ifeq (${OS}, Darwin) ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_DIR} -lft -lmlx -lm -lpthread \ -framework OpenGL -framework AppKit else - ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -lft -lX11 -lXext -lmlx -lm -lbsd -lpthread + ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_GNU_DIR} -lft -lX11 -lXext -lmlx -lm -lbsd \ +-lpthread endif #--------------------------------------------------------------------------------------------------# all: ${NAME} @@ -177,12 +185,17 @@ all: ${NAME} clean: ifeq (${OS}, Darwin) @$(MAKE) --no-print-directory -C ${MLX_DIR} clean +else + @${MAKE} --no-print-directory -C ${MLX_GNU_DIR} clean endif @$(MAKE) --no-print-directory -C ${LFT_DIR} clean ${RM} ${OBJS_DIR} #--------------------------------------------------------------------------------------------------# fclean: clean @$(MAKE) --no-print-directory -C ${LFT_DIR} fclean +ifeq (${OS}, Linux) + ${RM} ${MLX_GNU_DIR}libmlx_x86_64.a +endif ${RM} ${NAME} ${RM} ${NAME}.dSYM #--------------------------------------------------------------------------------------------------# |