From f7b57d527f416cb9c06e52d4cb46897cf524220b Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 28 Feb 2012 08:59:38 -0600 Subject: [PATCH] improve make install. closes #9. --- Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index cec0dd5..088753e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ PREFIX ?= /usr +BINDIR ?= $(PREFIX)/bin MANDIR ?= $(PREFIX)/share/man/man1 PACKAGES = x11 xcomposite xfixes xdamage xrender @@ -14,15 +15,17 @@ compton: $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) install: compton - @cp compton $(PREFIX)/bin - @[ -d "$(MANDIR)" ] \ - && cp man/compton.1 "$(MANDIR)" - @cp bin/settrans $(PREFIX)/bin + @[ -e "$(PREFIX)" ] || mkdir -p "$(PREFIX)" + @[ -e "$(BINDIR)" ] || mkdir -p "$(BINDIR)" + @[ -e "$(MANDIR)" ] || mkdir -p "$(MANDIR)" + @cp compton "$(BINDIR)" + @cp bin/settrans "$(BINDIR)" + @cp man/compton.1 "$(MANDIR)" uninstall: - @rm -f $(PREFIX)/bin/compton - @rm -f $(MANDIR)/compton.1 - @rm -f $(PREFIX)/bin/settrans + @rm -f "$(BINDIR)/compton" + @rm -f "$(BINDIR)/settrans" + @rm -f "$(MANDIR)/compton.1" clean: @rm -f $(OBJS) compton