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)