diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-10-28 11:18:49 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-10-28 11:18:49 +0100 |
commit | d6b5a64859ae2a7d0fd6171273f503c26d35ba38 (patch) | |
tree | aff887b65becf41f80305742d3d1039b38d5ffb6 | |
parent | add makefile (diff) | |
download | scrotty-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 '')
-rw-r--r-- | Makefile | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -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 |