From: Christian Heller Date: Wed, 19 Jun 2013 02:50:24 +0000 (+0200) Subject: Made Makefile more maintainable. X-Git-Tag: tce~1215 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks?a=commitdiff_plain;h=bf4af82bde0a08823b001e731629391904f93281;p=plomrogue Made Makefile more maintainable. --- diff --git a/Makefile b/Makefile index 176bd68..2107e08 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ -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 readwrite.o -c readwrite.c - cc -Wall -g -o roguelike.o -c roguelike.c - cc -Wall -g -o roguelike windows.o draw_wins.o keybindings.o readwrite.o roguelike.o -lncurses +CC=cc +CFLAGS=-Wall -g +TARGET=roguelike +OBJECTS=windows.o draw_wins.o keybindings.o readwrite.o roguelike.o + +roguelike: $(OBJECTS) + $(CC) $(CFLAGS) -o roguelike $(OBJECTS) -lncurses + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ clean: - rm *.o; rm roguelike + rm $(OBJECTS); rm roguelike