back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 796dbbb..aefc9fa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
-CC=gcc
-CFLAGS=-Wall -g -c
+SRCMODULES = field.c ghosts.c pac.c queue.c pacman.c
+OBJMODULES = $(SRCMODULES:.c=.o)
+CC = gcc
+CFLAGS = -Wall -g -c
LIBS = -lncurses -lm
@@ -8,7 +10,10 @@ all: pacman
%.o: %.с %.h
$(CC) $(CFLAGS) $< -o $@
-OBJMODULES=field.o ghosts.o pac.o queue.o pacman.o
-
pacman: $(OBJMODULES)
$(CC) $(LIBS) $^ -o $@
+
+-include deps.mk
+
+deps.mk: $(SRCMODULES)
+ $(CC) -MM $^ > $@