From 3ef4603788b3e4cef56bc113903548e71ade06a9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 16 Sep 2021 18:25:31 +0200 Subject: Improve makefile and fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2