aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-16 18:28:22 +0200
committerMattias Andrée <maandree@kth.se>2021-09-16 18:28:22 +0200
commit71d6f9e01af2162b0d1b5796189a2b5a6e65b6f8 (patch)
tree7842c7eeda7e95c8763f3783752548b1877b3152 /Makefile
parentm (diff)
downloadmedian-2.0.1.tar.gz
median-2.0.1.tar.bz2
median-2.0.1.tar.xz
Makefile and code improvements2.0.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ce35988..e12763a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,13 +3,14 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+
all: median
-median: median.o
- $(CC) -o $@ median.o $(LDFLAGS)
+.o:
+ $(CC) -o $@ $< $(LDFLAGS)
-median.o: median.c
- $(CC) -c -o $@ median.c $(CFLAGS) $(CPPFLAGS)
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
check: median
test "$$(printf '%s\n' 1 5 2 | ./median)" = 2
@@ -36,7 +37,7 @@ uninstall:
-rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/median.1"
clean:
- -rm -f -- median *.o
+ -rm -f -- median *.o *.su
.SUFFIXES:
.SUFFIXES: .c .o