Skip to content

Commit

Permalink
Merge pull request #130 from ltratt/portable_makefile
Browse files Browse the repository at this point in the history
Use a Makefile that does a more portable installation.
  • Loading branch information
vext01 authored Jan 8, 2024
2 parents 51cc2fd + 349b1e6 commit feaa503
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
PREFIX ?= /usr/local
MAN_PREFIX ?= ${PREFIX}/man
BINDIR ?= ${PREFIX}/bin
LIBDIR ?= ${PREFIX}/lib
SHAREDIR ?= ${PREFIX}/share
EXAMPLESDIR ?= ${SHAREDIR}/examples

MANDIR.${PREFIX} = ${PREFIX}/share/man
MANDIR./usr/local = /usr/local/man
MANDIR. = /usr/share/man
MANDIR ?= ${MANDIR.${PREFIX}}

.PHONY: all install distrib

all:
cargo build --release

install:
cargo build --release
install -d ${PREFIX}/bin
install -c -m 555 target/release/snare ${PREFIX}/bin/snare
install -d ${MAN_PREFIX}/man/man1
install -d ${MAN_PREFIX}/man/man5
install -c -m 444 snare.1 ${MAN_PREFIX}/man/man1/snare.1
install -c -m 444 snare.conf.5 ${MAN_PREFIX}/man/man5/snare.conf.5
install -d ${PREFIX}/share/examples/snare
install -c -m 444 snare.conf.example ${PREFIX}/share/examples/snare
install -d ${DESTDIR}${BINDIR}
install -c -m 555 target/release/snare ${DESTDIR}${BINDIR}/snare
install -d ${DESTDIR}${MANDIR}/man1
install -d ${DESTDIR}${MANDIR}/man5
install -c -m 444 snare.1 ${DESTDIR}${MANDIR}/man1/snare.1
install -c -m 444 snare.conf.5 ${DESTDIR}${MANDIR}/man5/snare.conf.5
install -d ${DESTDIR}${EXAMPLESDIR}/pizauth
install -c -m 444 snare.conf.example ${DESTDIR}${EXAMPLESDIR}/snare

distrib:
test "X`git status --porcelain`" = "X"
Expand Down

0 comments on commit feaa503

Please sign in to comment.