aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-16 18:25:31 +0200
committerMattias Andrée <maandree@kth.se>2021-09-16 18:25:31 +0200
commit3ef4603788b3e4cef56bc113903548e71ade06a9 (patch)
tree7ffe7547c29dec58de4f8e08638858190c6b815d /Makefile
parentUpdate config.mk (diff)
downloadloc-3ef4603788b3e4cef56bc113903548e71ade06a9.tar.gz
loc-3ef4603788b3e4cef56bc113903548e71ade06a9.tar.bz2
loc-3ef4603788b3e4cef56bc113903548e71ade06a9.tar.xz
Improve makefile and fix warnings4.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
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