-roguelike:
- cc -Wall -g -o windows.o -c windows.c
- cc -Wall -g -o draw_wins.o -c draw_wins.c
- cc -Wall -g -o keybindings.o -c keybindings.c
- cc -Wall -g -o roguelike.o -c roguelike.c
- cc -Wall -g -o roguelike windows.o draw_wins.o keybindings.o roguelike.o -lncurses
+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))