aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c8ef546..cded8f3 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,15 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+
all: loc
loc.o: loc.c arg.h
-loc: loc.o
- $(CC) -o $@ loc.o $(LDFLAGS)
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+.o:
+ $(CC) -o $@ $< $(LDFLAGS)
check: loc
test "$$(./loc < tests/0)" = 0
@@ -67,7 +71,7 @@ uninstall:
-rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/loc.1"
clean:
- -rm -f -- loc.o loc
+ -rm -f -- *.o *.su loc
.SUFFIXES:
.SUFFIXES: .o .c