From 46687fa2cef63e99a0ded077d88c3b19b20cc1ca Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 15 Apr 2020 16:19:44 +0200 Subject: Now BSD compliant --- Makefile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6a76604..c024768 100644 --- a/Makefile +++ b/Makefile @@ -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} @@ -241,6 +251,9 @@ fclean: clean @$(MAKE) --no-print-directory -C ${LFT_DIR} fclean 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 -- cgit v1.2.3