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 prefix = /usr/local
# ifdef check allows the user to pass custom dirs
# as per the README
# The directory to install todo.sh in. # The directory to install todo.sh in.
ifdef INSTALL_DIR
bindir = $(INSTALL_DIR)
else
bindir = $(prefix)/bin bindir = $(prefix)/bin
endif
# The directory to install the config file in. # The directory to install the config file in.
ifdef CONFIG_DIR
sysconfdir = $(CONFIG_DIR)
else
sysconfdir = $(prefix)/etc sysconfdir = $(prefix)/etc
endif
ifdef BASH_COMPLETION
datarootdir = $(BASH_COMPLETION)
else
datarootdir = $(prefix)/share datarootdir = $(prefix)/share
endif
# Dynamically detect/generate version file as necessary # Dynamically detect/generate version file as necessary
# This file will define a variable called VERSION. # This file will define a variable called VERSION.

View File

@@ -42,7 +42,7 @@ make test
- `BASH_COMPLETION`: PATH for autocompletion scripts (default to /etc/bash_completion.d) - `BASH_COMPLETION`: PATH for autocompletion scripts (default to /etc/bash_completion.d)
```shell ```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) #### Arch Linux (AUR)