aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-09 01:09:06 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-09 01:09:06 +0200
commitdc3e9e90cef882c326bb4fede69dd8b03fedfb76 (patch)
treec0240ad878385660c49892cc15524e4c973a22d5
parentadd deps (diff)
downloadcrt-calibrator-dc3e9e90cef882c326bb4fede69dd8b03fedfb76.tar.gz
crt-calibrator-dc3e9e90cef882c326bb4fede69dd8b03fedfb76.tar.bz2
crt-calibrator-dc3e9e90cef882c326bb4fede69dd8b03fedfb76.tar.xz
add install and uninstall rules to makefile
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index dc0e08d..ac47448 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,14 @@
+PREFIX = /usr
+BIN = /bin
+DATA = /share
+BINDIR = $(PREFIX)$(BIN)
+DATADIR = $(PREFIX)$(DATA)
+LICENSES = $(DATADIR)/licenses
+
+COMMAND = crt-calibrator
+PKGNAME = crt-calibrator
+
+
LIBS = libdrm
FLAGS = -std=gnu99 -Og -g -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 \
@@ -33,6 +44,22 @@ obj/%.o: src/%.c src/*.h
$(CC) $(C_FLAGS) -c -o $@ $<
+.PHONY: install
+install: bin/crt-calibrator
+ install -dm755 -- "$(DESTDIR)$(BINDIR)"
+ install -m755 bin/crt-calibrator -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ install -dm755 -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
+ install -m644 COPYING LICNSE -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
+
+
+.PHONY: uninstall
+uninstall:
+ -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ -rm -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)/COPYING"
+ -rm -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)/LICENSE"
+ -rmdir -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
+
+
.PHONY: clean
clean:
-rm -r bin obj