add support for DESTDIR for packaging

This commit is contained in:
Lephenixnoir 2020-06-01 23:29:48 +02:00
parent 99caef2c81
commit f03580ab43
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 6 additions and 6 deletions

View File

@ -15,9 +15,9 @@ obj-cg := $(src:src/%=build-cg/%.o)
# Compiler paths
define compilerpath
ifneq "$(lib-$1)" ""
prefix-$1 := $$(shell $(target-$1)-gcc -print-search-dirs | grep install | \
PREFIX-$1 := $$(shell $(target-$1)-gcc -print-search-dirs | grep install | \
sed 's/install: //')
ifeq "$$(prefix-$1)" ""
ifeq "$$(PREFIX-$1)" ""
$$(error "Cannot determine $1 compiler install path")
endif
endif
@ -60,12 +60,12 @@ distclean: clean
install:
if [[ ! -z $(lib-fx) ]]; then \
cp $(lib-fx) $(prefix-fx); \
cp $(header) $(prefix-fx)/include; \
cp $(lib-fx) $(DESTDIR)$(PREFIX-fx); \
cp $(header) $(DESTDIR)$(PREFIX-fx)/include; \
fi
if [[ ! -z $(lib-cg) ]]; then \
cp $(lib-cg) $(prefix-cg); \
cp $(header) $(prefix-cg)/include; \
cp $(lib-cg) $(DESTDIR)$(PREFIX-cg); \
cp $(header) $(DESTDIR)$(PREFIX-cg)/include; \
fi
.PRECIOUS: %/