back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-04-07 03:07:42 +0300
committerscratko <m@scratko.xyz>2024-04-07 03:07:42 +0300
commit2c2448cc94b8f17ac699814a75110411d57f3bea (patch)
tree4107fa66264cda94dd01c3bb00da29945c8d6131 /Makefile
parentbdee2852c13f6b02ec5207ded584839a3118233e (diff)
downloadpacman-2c2448cc94b8f17ac699814a75110411d57f3bea.tar.gz
pacman-2c2448cc94b8f17ac699814a75110411d57f3bea.tar.bz2
pacman-2c2448cc94b8f17ac699814a75110411d57f3bea.zip
BFS, queue files
Fixed remaining direction check for pacman (old version was commented out). Breadth First Search for red ghost. Changed switch style.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 7 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 8754c3c..15ebcde 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,14 @@
CC=gcc
CFLAGS=-Wall -g -c
-all: pacman
-
-pacman: ghosts.o field.o pac.o pacman.o
- $(CC) ghosts.o field.o pac.o pacman.o -lncurses -o pacman
+LIBS = -lncurses
-field.o: field.c
- $(CC) $(CFLAGS) field.c
+all: pacman
-ghosts.o: ghosts.c
- $(CC) $(CFLAGS) ghosts.c
+%.o: %.с %.h
+ $(CC) $(CFLAGS) $< -o $@
-pacman.o: pacman.c
- $(CC) $(CFLAGS) pacman.c
+OBJMODULES=field.o ghosts.o pac.o queue.o pacman.o
-pac.o: pac.c
- $(CC) $(CFLAGS) pac.c
+pacman: $(OBJMODULES)
+ $(CC) $(LIBS) $^ -o $@