42_solong/Makefile
2023-01-16 18:39:55 +01:00

47 lines
928 B
Makefile

SRCS = mandatory/asset.c mandatory/draw.c mandatory/key.c mandatory/main.c mandatory/map.c mandatory/parsing2.c mandatory/parsing.c mandatory/xpm.c
BSRCS = bonus/asset.c bonus/draw.c bonus/key.c bonus/main.c bonus/map.c bonus/parsing2.c bonus/parsing.c bonus/xpm.c
OBJS = ${SRCS:.c=.o}
BOBJS = ${BSRCS:.c=.o}
NAME = so_long
LIBS = libftx/libftx.a minilibx-linux/libmlx.a
CC = clang
FLAG = -Wall -Wextra -Werror -g
%.o: %.c
${CC} ${FLAG} -c $< -o $@
all: ${NAME}
bonus: ${BOBJS}
make -C libftx
make -C minilibx-linux
${CC} ${BOBJS} -o ${NAME} ${LIBS} -lXext -lX11
${NAME}: ${OBJS}
make -C libftx
make -C minilibx-linux
${CC} ${OBJS} -o ${NAME} ${LIBS} -lXext -lX11
clean:
rm -f ${OBJS} ${BOBJS}
rm -f textures/*
make -C libftx clean
make -C minilibx-linux clean
fclean: clean
rm -f ${NAME}
make -C libftx fclean
make -C minilibx-linux clean
re: fclean
make all
.PHONY: all clean fclean re bonus