Skip to content

Commit

Permalink
Add customizable PREFIX in Makefile
Browse files Browse the repository at this point in the history
The user of this package won't necessarily want to install to /usr/local
(indeed, that directory doesn't even exist on my system). Additionally,
package managers would probably like to install the program
elsewhere[1], and without a way to customize the prefix would have to fall back
to either patching the Makefile, or doing the installation manually, both
of which might break down the line.

By introducing a PREFIX variable with a default value of /usr/local, the
installation prefix can be customized, solving these problems.

[1]: Example: NixOS/nixpkgs#51004
  • Loading branch information
alyssais committed Nov 25, 2018
1 parent c93d184 commit 17cb1d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
@@ -1,3 +1,4 @@
PREFIX ?= /usr/local
ROOT ?= $(shell pwd)

test:
Expand All @@ -8,6 +9,6 @@ lint:
docker run --rm -v ${ROOT}:/mnt koalaman/shellcheck test/documentation-test

install:
install src/semver /usr/local/bin
install src/semver ${PREFIX}/bin

.PHONY: test install lint

0 comments on commit 17cb1d5

Please sign in to comment.