sdk: updated `src/tools/Makefile` and `src/zx7b/Makefile`

+ added `INSTALL` and `INSTALL_PROGRAM` variables
This commit is contained in:
Ivan Tatarinov 2021-04-26 20:28:06 +03:00
parent 5b4d96a16f
commit 73794aaf2e
2 changed files with 10 additions and 10 deletions

View File

@ -15,13 +15,10 @@
# make distclean
#
# where:
# <BUILD> is one of: mingw32, mingw64.
# <BUILD> - see included `common.mk'.
# <TARGET> is one of values for `BINS' variable prefixed with "build/"
# (see target `all' below).
# <PREFIX> is a prefix directory to install files into.
#
# Notes:
# `BUILD', `prefix' variables may be set in user's environment.
include ../../common.mk
@ -30,6 +27,9 @@ prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
BINS:=\
bin2hex$(EXESUFFIX)\
fcut$(EXESUFFIX)\
@ -56,7 +56,7 @@ install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
# $1 = target
define install_bin_rule =
$$(DESTDIR)$$(bindir)/$1: build/$1 | $$(DESTDIR)$$(bindir)
cp $$< $$@
$$(INSTALL_PROGRAM) $$< $$@
endef
$(foreach t,$(BINS),$(eval $(call install_bin_rule,$(t))))

View File

@ -15,13 +15,10 @@
# make distclean
#
# where:
# <BUILD> is one of: mingw32, mingw64.
# <BUILD> - see included `common.mk'.
# <TARGET> is one of values for `BINS' variable prefixed with "build/"
# (see target `all' below).
# <PREFIX> is a prefix directory to install files into.
#
# Notes:
# `BUILD', `prefix' variables may be set in user's environment.
include ../../common.mk
@ -30,6 +27,9 @@ prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
BINS = zx7b$(EXESUFFIX)
.PHONY: all
@ -46,7 +46,7 @@ build/zx7b$(EXESUFFIX): $(srcdir)/zx7b.c Makefile | build
install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
$(DESTDIR)$(bindir)/zx7b$(EXESUFFIX): build/zx7b$(EXESUFFIX) | $(DESTDIR)$(bindir)
cp $< $@
$(INSTALL_PROGRAM) $< $@
.PHONY: uninstall
uninstall: