comp20003-project03/Makefile

42 lines
785 B
Makefile
Raw Normal View History

2024-06-13 14:25:56 +10:00
BUILDDIR=$(CURDIR)/build
NAME=sokoban
CFLAGS+=-I./include/
CC=gcc -Wall -Wextra -Werror -pedantic -g
OBJ= build/main.o \
build/helper.o \
build/key_check.o \
build/loose_check.o \
build/find_player.o \
build/map_check.o \
build/map_reading.o \
build/movement.o \
build/play.o \
build/win_check.o \
build/zone_check.o \
build/my_putchar.o \
build/my_putstr.o \
build/utils.o \
build/priority_queue.o \
build/hashtable.o \
build/ai.o
$(NAME): $(OBJ) | $(BUILDDIR)
$(CC) -o $(NAME) $^ -lncurses
build/%.o: src/%.c
$(CC) -c $< -o $@
build/%.o: src/ai/%.c
$(CC) -c $< -o $@
build/%.o: lib/%.c
$(CC) -c $< -o $@
$(BUILDDIR):
mkdir -p $(BUILDDIR)
clean:
@rm -rf build
@rm -f $(NAME)