diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -13,6 +13,7 @@ OBJS_DIR = obj/ LFT_DIR = libft/ MLX_DIR = minilibx/ MLX_GNU_DIR = minilibx-linux/ +MLX_BSD_DIR = minilibx-bsd/ #==================================================================================================# #---------------------------------------------- Files ---------------------------------------------# #==================================================================================================# @@ -203,15 +204,19 @@ ${OBJS_DIR}%.o: ${SRCS_DIR}%.c ${INCS_DIR} @${MKDIR} ${OBJS_DIR} ifeq (${OS}, Darwin) ${CC} -c ${CFLAGS} ${CDEFS} -I${LFT_DIR}${INCS_DIR} -I${MLX_DIR} -I${INCS_DIR} -o $@ $< -else +else ifeq (${OS}, Linux) ${CC} -c ${CFLAGS} ${CDEFS} -I${LFT_DIR}${INCS_DIR} -I${MLX_GNU_DIR} -I${INCS_DIR} -o $@ $< +else + ${CC} -c ${CFLAGS} ${CDEFS} -I${LFT_DIR}${INCS_DIR} -I${MLX_BSD_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 +else ifeq (${OS}, Linux) @${MAKE} --no-print-directory -C ${MLX_GNU_DIR} all +else + @${MAKE} --no-print-directory -C ${MLX_BSD_DIR} all endif ifdef ASAN @$(MAKE) --no-print-directory -C ${LFT_DIR} all ASAN=1 @@ -221,9 +226,12 @@ endif ifeq (${OS}, Darwin) ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_DIR} -lft -lmlx -lm -lpthread \ -framework OpenGL -framework AppKit +else ifeq (${OS}, Linux) + ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_GNU_DIR} \ +-lft -lX11 -lXext -lmlx -lm -lbsd -lpthread else - ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_GNU_DIR} -lft -lX11 -lXext -lmlx -lm -lbsd \ --lpthread + ${CC} ${CFLAGS} -o $@ ${OBJS} -L${LFT_DIR} -L${MLX_BSD_DIR} -L/usr/local/lib \ +-lft -lX11 -lXext -lmlx -lm -lpthread endif #--------------------------------------------------------------------------------------------------# all: ${NAME} @@ -231,8 +239,10 @@ all: ${NAME} clean: ifeq (${OS}, Darwin) @$(MAKE) --no-print-directory -C ${MLX_DIR} clean -else +else ifeq (${OS}, Linux) @${MAKE} --no-print-directory -C ${MLX_GNU_DIR} clean +else + @${MAKE} --no-print-directory -C ${MLX_BSD_DIR} clean endif @$(MAKE) --no-print-directory -C ${LFT_DIR} clean ${RM} ${OBJS_DIR} @@ -242,6 +252,9 @@ fclean: clean ifeq (${OS}, Linux) ${RM} ${MLX_GNU_DIR}libmlx_x86_64.a endif +ifeq (${OS}, FreeBSD) + ${RM} ${MLX_BSD_DIR}libmlx_FreeBSD.a +endif ${RM} ${NAME} ${RM} ${NAME}.dSYM #--------------------------------------------------------------------------------------------------# |