diff --git a/Makefile b/Makefile index 60850ed..b5e4285 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,22 @@ -SRCS_GAME = main.c game/game.c game/init.c game/manage.c \ +SRCS_GAME := main.c game/game.c game/init.c game/manage.c \ game/manage_keys.c game/raycasting.c -SRCS_PARSING = -OBJS = ${SRCS_GAME:.c=.o} ${SRCS_PARSING:.c=.o} -CC = clang -LIBS = libftx/libftx.a MLX42/build/libmlx42.a -ldl -lglfw -lm -CFLAGS = -g -Wall -Wextra -Werror -NAME = cub3D +SRCS_MAP := parsing.c parsing_header.c parsing_header2.c parsing_meta.c parsing_body.c +SRCS_MAP := $(addprefix map/, $(SRCS_MAP)) + +SRCS := ${SRCS_MAP} \ + ${SRCS_GAME} + +OBJS := ${SRCS:.c=.o} +CC := clang +LIBS := libftx/libftx.a MLX42/build/libmlx42.a -ldl -lglfw -lm +CFLAGS := -g -Wall -Wextra -Werror +NAME := cub3D all: ${NAME} ${NAME}: ${OBJS} make -C libftx all - ${CC} ${CFLAGS} -o ${NAME} ${OBJS} ${LIBS} + ${CC} -o ${NAME} ${OBJS} ${LIBS} clean: make -C libftx clean