aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-10-28 11:18:49 +0100
committerMattias Andrée <maandree@operamail.com>2014-10-28 11:18:49 +0100
commitd6b5a64859ae2a7d0fd6171273f503c26d35ba38 (patch)
treeaff887b65becf41f80305742d3d1039b38d5ffb6 /Makefile
parentadd makefile (diff)
downloadscrotty-d6b5a64859ae2a7d0fd6171273f503c26d35ba38.tar.gz
scrotty-d6b5a64859ae2a7d0fd6171273f503c26d35ba38.tar.bz2
scrotty-d6b5a64859ae2a7d0fd6171273f503c26d35ba38.tar.xz
makefile: add install and unstall rules
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index be3eef1..44d9c23 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,10 @@ DOCDIR ?= $(DATADIR)/doc
INFODIR ?= $(DATADIR)/info
# The license base path including prefix
LICENSEDIR ?= $(DATADIR)/licenses
+
+# The /dev directory that should be compiled into the program
DEVDIR = /dev
+# The /sys directory that should be compiled into the program
SYSDIR = /sys
# The name of the command as it should be installed
@@ -48,6 +51,7 @@ STD = -std=gnu99
DEFS = -D'DEVDIR="$(DEVDIR)"' -D'SYSDIR="$(SYSDIR)"'
+
.PHONY: all
all: cmd
@@ -63,6 +67,42 @@ bin/scrotty: obj/scrotty.o
$(CC) $(STD) $(OPTIMISE) $(WARN) $(LDFLAGS) -o $@ $^
+.PHONY: install
+install: install-base
+
+.PHONY: install-all
+install-all: install-base
+
+.PHONY: install-base
+install-base: install-cmd install-copyright
+
+.PHONY: install-cmd
+install-cmd: bin/scrotty
+ install -dm755 -- "$(DESTDIR)$(BINDIR)"
+ install -m755 $< -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+
+.PHONY: install-copyright
+install-copyright: install-copying install-license
+
+.PHONY: install-copying
+install-copying:
+ install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PACKAGE)"
+ install -m644 COPYING -- "$(DESTDIR)$(LICENSEDIR)/$(PACKAGE)/COPYING"
+
+.PHONY: install-license
+install-license:
+ install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PACKAGE)"
+ install -m644 LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PACKAGE)/LICENSE"
+
+
+.PHONY: uninstall
+uninstall:
+ -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PACKAGE)/COPYING"
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PACKAGE)/LICENSE"
+ -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PACKAGE)"
+
+
.PHONY: clean
clean:
-rm -r bin obj scrotty.{info,pdf,ps,dvi} *.su src/*.su