From c6d290b5fb315ca4daeb436749d8cc800152bb09 Mon Sep 17 00:00:00 2001 From: LeLobster Date: Sun, 29 Mar 2020 21:29:40 +0200 Subject: [PATCH] Fix the Makefile to work with the install instructions in the README (#259) * Fix the Makefile to work with the install instructions in the README * Put back DEST_DIR * Add simple ifdef checks to see if the user has set custom dirs via the commandline * Update README to match Makefile --- Makefile | 23 +++++++++++++++++++---- README.md | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1386819..d2ceff2 100644 --- a/Makefile +++ b/Makefile @@ -10,13 +10,28 @@ INSTALL_DATA = $(INSTALL) -m 644 prefix = /usr/local +# ifdef check allows the user to pass custom dirs +# as per the README + # The directory to install todo.sh in. -bindir = $(prefix)/bin +ifdef INSTALL_DIR + bindir = $(INSTALL_DIR) +else + bindir = $(prefix)/bin +endif # The directory to install the config file in. -sysconfdir = $(prefix)/etc +ifdef CONFIG_DIR + sysconfdir = $(CONFIG_DIR) +else + sysconfdir = $(prefix)/etc +endif -datarootdir = $(prefix)/share +ifdef BASH_COMPLETION + datarootdir = $(BASH_COMPLETION) +else + datarootdir = $(prefix)/share +endif # Dynamically detect/generate version file as necessary # This file will define a variable called VERSION. @@ -85,4 +100,4 @@ test: aggregate-results rm -rf tests/test-results # Force tests to get run every time -.PHONY: test test-pre-clean aggregate-results $(TESTS) +.PHONY: test test-pre-clean aggregate-results $(TESTS) \ No newline at end of file diff --git a/README.md b/README.md index b077149..bda1a28 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ make test - `BASH_COMPLETION`: PATH for autocompletion scripts (default to /etc/bash_completion.d) ```shell -make install CONFIG_DIR=/etc INSTALL_DIR=/usr/bin BASH_COMPLETION_DIR=/usr/share/bash-completion/completions +make install CONFIG_DIR=/etc INSTALL_DIR=/usr/bin BASH_COMPLETION=/usr/share/bash-completion/completions ``` #### Arch Linux (AUR)