Skip to content

Commit

Permalink
Makefile updated, should work now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Teissier authored and Jean Teissier committed Aug 15, 2024
1 parent 3f64d0d commit af566a5
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tsuchen <tsuchen@student.42.fr> +#+ +:+ +#+ #
# By: jteissie <jteissie@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/08/15 12:02:08 by tsuchen #+# #+# #
# Updated: 2024/08/15 13:34:11 by jteissie ### ########.fr #
# Updated: 2024/08/15 14:18:08 by jteissie ### ########.fr #
# #
# **************************************************************************** #

NAME = cub3d
NAME = cub3d

SRCS_M = main.c

SRCS_PS = parser.c
SRCS_PS = parser.c

SRCS_MAP = map.c

Expand All @@ -30,7 +30,7 @@ SRCS = $(addprefix $(PATH_M), $(SRCS_M)) \
$(addprefix $(PATH_MAP), $(SRCS_MAP)) \
$(addprefix $(PATH_RC), $(SRCS_RC))

HEADERS = cub3d.h
HEADERS = cub3d.h

OBJS = $(SRCS:.c=.o)

Expand All @@ -44,22 +44,17 @@ H_DEPS = $(addprefix $(HEAD), $(HEADERS))

LIBFT_PATH = libft/
LIBFT_H_PATH = libft/includes/
LIBFT = $(LIBFT_PATH)libft.a
LIBFT = -L $(LIBFT_PATH) -lft

MLX = mlx_linux
MLX_DIR = minilibx-linux
MLXFLAGS = -lmlx_Linux -lXext -lX11 -lm -lz
MLX = minilibx-linux
MLXFLAGS = -L $(MLX) -lmlx -lXext -lX11 -lXext -lm -lz -Ofast

all: minilibx-linux $(NAME)

$(LIBFT):
$(MAKE) -C $(LIBFT_PATH)

$(MLX):
$(MAKE) -C $(MLX_DIR)

$(NAME): $(LIBFT) $(OBJS) $(H_DEPS)
$(CC) $(CFLAGS) $(OBJS) -L$(MLX) -I$(MLX) $(MLXFLAGS) $(LIBFT) -o $(NAME)
$(NAME): $(OBJS) $(H_DEPS)
make -C $(LIBFT_PATH) all
make -C $(MLX) all
$(CC) $(CFLAGS) $(OBJS) $(MLXFLAGS) $(LIBFT) -o $(NAME)

minilibx-linux:
git clone [email protected]:42Paris/minilibx-linux.git $@
Expand All @@ -75,21 +70,19 @@ libft-clean:
$(MAKE) -C $(LIBFT_PATH) clean

mlx-clean:
$(MAKE) -C $(MLX_DIR) clean
$(MAKE) -C $(MLX) clean

root-clean:
rm -f $(OBJS)

fclean: libft-fclean mlx-fclean root-fclean
fclean: libft-fclean root-fclean

libft-fclean:
$(MAKE) -C $(LIBFT_PATH) fclean

mlx-fclean:
$(MAKE) -C $(MLX_DIR) fclean

root-fclean: root-clean
rm -f $(NAME)
rm -rf minilibx-linux

re: fclean all

Expand Down

0 comments on commit af566a5

Please sign in to comment.