From 834434fd644746eb3712699fc07af031909665ba Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Mon, 24 Jun 2024 06:37:20 -0700 Subject: [PATCH] Add PREFIX support to makefile, and distro install command --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dc74a4c..2b94974 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ ifeq ($(CFG), debug) ASAN ?= 1 endif +PREFIX ?= /usr/local +BINDIR := $(PREFIX)/bin + LD = $(CC) RM = rm -f MKDIR = mkdir -p @@ -124,8 +127,20 @@ clean: .PHONY: install install: all - $(MKDIR) /usr/local/bin - cp $(PROJ) /usr/local/bin/$(NAME) + $(MKDIR) $(BINDIR) + cp $(PROJ) $(BINDIR)/$(NAME) + + +.PHONY: uninstall + +uninstall: + $(RM) $(BINDIR)/$(NAME) + +.PHONY: install-for-distro + +install-for-distro: all + $(MKDIR) /usr/bin + cp $(PROJ) /usr/bin/$(NAME) define RELEASE_RULES