From 4d9c55249045c63f3e353dc9459501b4401c80fc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 12 Aug 2014 05:46:02 +0200 Subject: add install and uninstall rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 19aa4bc..55ef967 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,22 @@ obj/%.o: src/%.c $(CC) $(WARN) -std=$(STD) $(OPTIMISE) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< +.PHONY: install +install: bin/alarm + install -dm755 -- "$(DESTDIR)$(BINDIR)" + install -m755 bin/alarm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + install -m644 COPYING LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + + +.PHONY: uninstall +uninstall: + -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE" + -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + + .PHONY: clean clean: -rm -r bin obj -- cgit v1.2.3-70-g09d2