diff --git a/Makefile b/Makefile index 752336f..050684d 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ # for debug add -g -O0 to line below CFLAGS+=-pthread -O2 -Wall -Wextra -Wpedantic -Wstrict-overflow -fno-strict-aliasing -std=gnu11 -g -O0 -prefix=/usr/local/bin +DESTDIR?= +PREFIX?=/usr/local/bin all: ${CC} main.c fiche.c $(CFLAGS) -o fiche install: fiche - install -m 0755 fiche $(prefix) + install -d $(DESTDIR)$(PREFIX) + install -m 0755 fiche $(DESTDIR)$(PREFIX) clean: rm -f fiche diff --git a/README.md b/README.md index e3922d5..4460ea0 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ To use fiche you have to have netcat installed. You probably already have it - t sudo make install ``` +Note: Adding `PREFIX=/path/to/directory` can override the default /usr/local/bin installation prefix, adittionally `DESTDIR` can also be set, and will be prepended ### Using Ports on FreeBSD To install the port: `cd /usr/ports/net/fiche/ && make install clean`. To add the package: `pkg install fiche`.