From dc3e9e90cef882c326bb4fede69dd8b03fedfb76 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 9 Aug 2014 01:09:06 +0200 Subject: add install and uninstall rules to makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2