1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
7 # generate rules to install files in RTE_OUTPUT.
9 # arg1: relative install dir in RTE_OUTPUT
10 # arg2: relative file name in a source dir (VPATH)
13 $(addprefix $(RTE_OUTPUT)/$(1)/,$(notdir $(2))): $(2)
14 @echo " INSTALL-FILE $(addprefix $(1)/,$(notdir $(2)))"
15 @[ -d $(RTE_OUTPUT)/$(1) ] || mkdir -p $(RTE_OUTPUT)/$(1)
16 $(Q)cp -rf $$(<) $(RTE_OUTPUT)/$(1)
19 $(foreach dir,$(INSTALL-DIRS-y),\
20 $(foreach file,$(INSTALL-y-$(dir)),\
21 $(eval $(call install_rule,$(dir),$(file)))))
25 # generate rules to install symbolic links of files in RTE_OUTPUT.
27 # arg1: relative install dir in RTE_OUTPUT
28 # arg2: relative file name in a source dir (VPATH)
31 $(addprefix $(RTE_OUTPUT)/$(1)/,$(notdir $(2))): $(2)
32 @echo " SYMLINK-FILE $(addprefix $(1)/,$(notdir $(2)))"
33 @[ -d $(RTE_OUTPUT)/$(1) ] || mkdir -p $(RTE_OUTPUT)/$(1)
34 $(Q)ln -nsf `$(RTE_SDK)/buildtools/relpath.sh $$(<) $(RTE_OUTPUT)/$(1)` \
38 $(foreach dir,$(SYMLINK-DIRS-y),\
39 $(foreach file,$(SYMLINK-y-$(dir)),\
40 $(eval $(call symlink_rule,$(dir),$(file)))))
43 # fast way, no need to do preinstall and postinstall
44 ifeq ($(PREINSTALL)$(POSTINSTALL),)
46 _postinstall: $(_INSTALL)
51 _preinstall: $(PREINSTALL)
55 $(_INSTALL): _preinstall
57 _INSTALL = _preinstall
63 ifneq ($(POSTINSTALL),)
64 $(POSTINSTALL): _install
66 POSTINSTALL = _install
69 _postinstall: $(POSTINSTALL)