Allow make PREFIX=

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët 2020-10-15 13:11:00 +00:00
parent c9bf554a53
commit fad4fe5f62

View file

@ -1,16 +1,17 @@
CC = cc
CFLAGS = -Wall -O2
prefix = /usr/local
PREFIX = $(prefix)
secret:
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) secret.c -o secret
$(X)$(CC) $(EXTRA) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) secret.c -o secret
install: secret
mkdir -p $(DESTDIR)$(prefix)/bin
mv -f secret $(DESTDIR)$(prefix)/bin
mkdir -p $(DESTDIR)$(PREFIX)/bin
mv -f secret $(DESTDIR)$(PREFIX)/bin
uninstall:
rm -f $(DESTDIR)$(prefix)/bin/secret
rm -f $(DESTDIR)$(PREFIX)/bin/secret
clean:
rm -f secret