-roguelike:
- cc -Wall -g -o windows.o -c windows.c
- cc -Wall -g -o roguelike.o -c roguelike.c
- cc -Wall -g -o roguelike windows.o roguelike.o -lncurses -lm
+CC=cc
+CFLAGS=-Wall -g
+TARGET=roguelike
+SRCDIR=src
+BUILDDIR=build
+SOURCES=$(shell find $(SRCDIR)/ -type f -name \*.c)
+OBJECTS=$(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.c=.o))