summaryrefslogtreecommitdiffstats
path: root/tools/build/common.dir/symlink.rules.mk
blob: b5654f20496dca983eadb97ee0b210434ae7027d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: tools/build/common.dir/symlink.rules.mk $
#
# IBM CONFIDENTIAL
#
# EKB Project
#
# COPYRIGHT 2015,2016
# [+] International Business Machines Corp.
#
#
# The source code for this program is not published or otherwise
# divested of its trade secrets, irrespective of what has been
# deposited with the U.S. Copyright Office.
#
# IBM_PROLOG_END_TAG
#CREATE_SYMLINK
#    This macro creates a symlink for the generated common fapi2 files
#        that will be used to compile fapi2_ifCompiler as well
#    Input:
#        $1 = File with fully qualified path
#        $2 = output directory path
#    Output: A symlink to output directory
define CREATE_SYMLINK
$(eval GENERATED=create_symlink_$(notdir $1))
$(eval SOURCES+=$1)
$(eval TARGETS=$(notdir $1))
$(eval $(GENERATED)_COMMAND_PATH=)
$(eval $(GENERATED)_PATH=$2)
$(eval $(GENERATED)_RUN=$(call CREATE_SYMLINK_RUN_COMMAND,$1))
$(call BUILD_GENERATED)
endef

#CREATE_SYMLINK_RUN_COMMAND
#    This macro defines the command used to create the symlink
define CREATE_SYMLINK_RUN_COMMAND
		$(C1) rm -f $($(GENERATED)_PATH)/$(notdir $1) && \
		ln -s $$$$(realpath $$$$<) $($(GENERATED)_PATH)/$(notdir $1)
endef
OpenPOWER on IntegriCloud