Skip to content

Commit

Permalink
feat: Add install target to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewferrier committed Aug 14, 2024
1 parent a040a2f commit ac82dea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ TEMPDIR := $(shell mktemp -t tmp.XXXXXX -d)
FLAKE8 := $(shell which flake8)
PYLINT := $(shell which pylint3 || which pylint)

ifeq ($(PREFIX),)
PREFIX := /usr/local
endif

determineversion:
$(eval GITDESCRIBE_DEBIAN := $(shell git describe --tags --dirty | cut -c 2-))
sed 's/Version: .*/Version: $(GITDESCRIBE_DEBIAN)/' debian/DEBIAN/control_template > debian/DEBIAN/control
Expand All @@ -28,6 +32,13 @@ builddeb_real:
buildarch: determineversion
makepkg --skipinteg

install:
install -d $(DESTDIR)$(PREFIX)/bin
install -d $(DESTDIR)$(PREFIX)/share/doc/normfn
install -m 755 normfn $(DESTDIR)$(PREFIX)/bin
install -m 644 README* $(DESTDIR)$(PREFIX)/share/doc/normfn
install -m 644 LICENSE* $(DESTDIR)$(PREFIX)/share/doc/normfn

install_osx_finder:
cp normfn osx/services/normfn-finder.workflow/Contents/
rm -Rfv ~/Library/Services/normfn-finder.workflow/
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ using any standard `.deb` installation approach, e.g. `dpkg -i normfn*.deb`.

### Other Platforms

Work is being done to make this simpler, but for now, please clone this
repository and move the `normfn` script to anywhere in your `$PATH`.
* Clone this repository locally and change to the directory where you cloned it.

* If you have write-access to the system-wide `/usr/local/bin` directory, just
run `make install`.

* If you don't, install it in your user directory with `PREFIX=~/.local/bin make
install` (this directory needs to be in your `$PATH`).

## Usage

Expand Down

0 comments on commit ac82dea

Please sign in to comment.