aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-11-27 09:04:21 +0100
committerMattias Andrée <maandree@operamail.com>2015-11-27 09:04:21 +0100
commit5eee0be090a525aeed56c3019c7cfa7862990fbf (patch)
treedb58cbc646e0d9de14dabbd6a8a16d01845c8429 /Makefile
parentm makefile (diff)
downloadalarm-5eee0be090a525aeed56c3019c7cfa7862990fbf.tar.gz
alarm-5eee0be090a525aeed56c3019c7cfa7862990fbf.tar.bz2
alarm-5eee0be090a525aeed56c3019c7cfa7862990fbf.tar.xz
add manpage
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 44 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1a79dbd..c952847 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,14 @@ DATA = /share
BINDIR = $(PREFIX)$(BIN)
# The resource path including prefix.
DATADIR = $(PREFIX)$(DATA)
+# The general documentation path including prefix.
+DOCDIR = $(DATADIR)/doc
+# The info manual path including prefix.
+INFODIR = $(DATADIR)/info
+# The man page path including prefix.
+MANDIR = $(DATADIR)/man
+# The man page section 1 path including prefix.
+MAN1DIR = $(MANDIR)/man1
# The license base path including prefix.
LICENSEDIR = $(DATADIR)/licenses
@@ -43,8 +51,18 @@ WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self \
STD = c99
+
+.PHONY: default
+default: command
+
.PHONY: all
-all: bin/alarm
+all: command
+
+.PHONY: base
+base: command
+
+.PHONY: command
+command: bin/alarm
bin/alarm: obj/alarm.o
@mkdir -p bin
@@ -55,13 +73,34 @@ obj/%.o: src/%.c
$(CC) $(WARN) -std=$(STD) $(OPTIMISE) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
.PHONY: install
-install: bin/alarm
+install: install-base install-man
+
+.PHONY: install-all
+install-all: install-base install-doc
+
+.PHONY: install-base
+install-base: install-command install-license
+
+.PHONY: install-command
+install-command: bin/alarm
install -dm755 -- "$(DESTDIR)$(BINDIR)"
- install -m755 bin/alarm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ install -m755 $^ -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+
+.PHONY: install-license
+install-license:
install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
install -m644 COPYING LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+.PHONY: install-doc
+install-doc: install-man
+
+install-man: doc/man/alarm.1
+ install -dm755 -- "$(DESTDIR)$(MAN1DIR)"
+ install -m644 $< -- "$(DESTDIR)$(MAN1DIR)/$(COMMAND).1"
+
+
.PHONY: uninstall
uninstall:
@@ -69,6 +108,8 @@ uninstall:
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
-rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ -rm -- "$(DESTDIR)$(MAN1)/$(COMMAND).1"
+
.PHONY: clean