aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile15
1 files changed, 6 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index bd7aa8b..2c1d5f9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,21 @@
.POSIX:
ALL_WARNING = -Wall -Wextra -pedantic
-ALL_LDFLAGS = $(LDFLAGS)
-PREFIX = /usr/local
-LDLIBS = -lm
+PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man
-all: clean kirc
-install: all
+all: kirc.c kirc.h
+ $(CC) $(CFLAGS) $(LDFLAGS) kirc.c -o kirc
+
+install: kirc
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp -f kirc $(DESTDIR)$(BINDIR)
cp -f kirc.1 $(DESTDIR)$(MANDIR)/man1
chmod 755 $(DESTDIR)$(BINDIR)/kirc
chmod 644 $(DESTDIR)$(MANDIR)/man1/kirc.1
-kirc: kirc.o
- $(CC) $(ALL_LDFLAGS) -o kirc kirc.o $(LDLIBS)
-kirc.o: kirc.c kirc.h
clean:
- rm -f kirc *.o
+ rm -f kirc
uninstall:
rm -f $(DESTDIR)$(BINDIR)/kirc
rm -f $(DESTDIR)$(MANDIR)/man1/kirc.1