ref: 322a0b05d8dcc850d194eb7e69b11194a000ba74
parent: c0a9cf79a32d93079b471ad61b767b538d1213c1
author: Vegard Nossum <[email protected]>
date: Thu Jun 11 03:09:27 EDT 2009
link: improve Makefile Make object filenames explicit and add "clean" target. Signed-off-by: Vegard Nossum <[email protected]>
--- a/src/link/Makefile
+++ b/src/link/Makefile
@@ -1,8 +1,21 @@
+obj := \
+ assign.o \
+ library.o \
+ main.o \
+ mapfile.o \
+ object.o \
+ output.o \
+ patch.o \
+ symbol.o
+
all: xlink
-.c.o:
- gcc -Wall -I. -I.. -Iinclude -g -c -o $@ $<
+clean:
+ rm -rf xlink $(obj)
-xlink: $(patsubst %.c,%.o,$(wildcard *.c))
+xlink: $(obj)
gcc -Wall -o $@ $^
+
+.c.o:
+ gcc -Wall -I. -I.. -Iinclude -g -c -o $@ $<