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
This commit is contained in:
LeLobster
2020-03-29 21:29:40 +02:00
committed by GitHub
parent 355166da67
commit c6d290b5fb
2 changed files with 20 additions and 5 deletions

View File

@@ -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)

View File

@@ -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)