install: Select which kind of files go in package subdirectory

By default, headers, share, doc, license, config and var go into a per-package
subdirectory, i.e. install in `/usr/include/my-package` or
`/usr/local/share/my-ackage`.

Binaries and libraries go at the top of the corresponding directory by default.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2021-02-23 11:11:53 +01:00
parent 91591b99f8
commit bdf6542c8b
1 changed files with 10 additions and 1 deletions

View File

@ -122,6 +122,14 @@ PACKAGE_DIR?=$(PACKAGE_NAME:%=%/)
PACKAGE_LIBS=$(MIQ_PRODLIB)
PACKAGE_DLLS=$(MIQ_PRODDLL)
# Install headers, docs and var items in package subdirectory by default
PACKAGE_DIR.header?=$(PACKAGE_DIR)
PACKAGE_DIR.share?=$(PACKAGE_DIR)
PACKAGE_DIR.doc?=$(PACKAGE_DIR)
PACKAGE_DIR.license?=$(PACKAGE_DIR)
PACKAGE_DIR.config?=$(PACKAGE_DIR)
PACKAGE_DIR.var?=$(PACKAGE_DIR)
# Location of configuration files, etc (tweaked at install time)
CONFIG_SOURCES?=$(MIQ)config/
@ -158,12 +166,13 @@ PREFIX.pkgconfig=$(PREFIX.share)pkgconfig/
# but to install headers and data items under a directory named after project
define package-install
PACKAGE_INSTALL.$1?=$$(DESTDIR)$$(PREFIX.$1)
PACKAGE_INSTALL.$1?=$$(DESTDIR)$$(PREFIX.$1)$$(PACKAGE_DIR.$1)
endef
$(eval $(foreach i,$(INSTALLABLE),$(call package-install,$i)))
#------------------------------------------------------------------------------
# Compilation flags
#------------------------------------------------------------------------------