From f79e6d2cc6780584d900f3aca9c8ee848b7d01e8 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Mon, 1 Jun 2020 22:59:35 +0200 Subject: [PATCH] add support for DESTDIR for packaging --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e26f446..dc0b9d5 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,10 @@ target ?= sh-elf lib := libprof.a header := libprof.h -prefix := $(shell $(target)-gcc -print-search-dirs | grep install \ +PREFIX ?= $(shell $(target)-gcc -print-search-dirs | grep install \ | sed 's/install: //') -ifeq "$(prefix)" "" +ifeq "$(PREFIX)" "" $(error "Cannot determine compiler install path") endif @@ -42,5 +42,5 @@ distclean: clean # Install install: - cp $(lib) $(prefix) - cp $(header) $(prefix)/include + cp $(lib) $(DESTDIR)$(PREFIX) + cp $(header) $(DESTDIR)$(PREFIX)/include