home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Makefile now works on all .c files to generate its list of needed object files.
[plomrogue]
/
Makefile
diff --git
a/Makefile
b/Makefile
index 1b83a3f1622938d2c309b543835f08ab6968339f..bedecc0347db339e26f8f7a35a48db37bf3a1fc9 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,7
+1,15
@@
-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
+SOURCES=$(shell find . -type f -name \*.c)
+OBJECTS=$(SOURCES:.c=.o)
+roguelike: $(OBJECTS)
+ $(CC) $(CFLAGS) -o roguelike $(OBJECTS) -lncurses
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+.PHONY: clean
clean:
clean:
- rm
*.o
; rm roguelike
+ rm
$(OBJECTS)
; rm roguelike