add support for DESTDIR for packaging

This commit is contained in:
Lephenixnoir 2020-06-01 22:59:35 +02:00
parent ef49aa8da4
commit f79e6d2cc6
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 4 additions and 4 deletions

View File

@ -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