573 $(eval $1_dotdots := $(call DirToDotDot, $(patsubst $($(strip $1)_prefix)/%, %, $2))) \ |
573 $(eval $1_dotdots := $(call DirToDotDot, $(patsubst $($(strip $1)_prefix)/%, %, $2))) \ |
574 $(eval $1_suffix := $(patsubst $($(strip $1)_prefix)/%, %, $1)) \ |
574 $(eval $1_suffix := $(patsubst $($(strip $1)_prefix)/%, %, $1)) \ |
575 $($(strip $1)_dotdots)/$($(strip $1)_suffix) |
575 $($(strip $1)_dotdots)/$($(strip $1)_suffix) |
576 |
576 |
577 ################################################################################ |
577 ################################################################################ |
578 # link-file-* works similarly to install file but creates a symlink instead on |
578 # link-file-* works similarly to install-file but creates a symlink instead. |
579 # platforms that support it. There are two versions, either creating a relative |
579 # There are two versions, either creating a relative or an absolute link. Be |
580 # or an absolute link. |
580 # careful when using this on Windows since the symlink created is only valid in |
581 ifeq ($(OPENJDK_BUILD_OS), windows) |
581 # the unix emulation environment. |
582 link-file-absolute = $(install-file) |
582 define link-file-relative |
583 link-file-relative = $(install-file) |
|
584 else |
|
585 define link-file-relative |
|
586 $(call MakeDir, $(@D)) |
583 $(call MakeDir, $(@D)) |
587 $(RM) $@ |
584 $(RM) $@ |
588 $(LN) -s $(call RelativePath, $<, $(@D)) $@ |
585 $(LN) -s $(call RelativePath, $<, $(@D)) $@ |
589 endef |
586 endef |
590 |
587 |
591 define link-file-absolute |
588 define link-file-absolute |
592 $(call MakeDir, $(@D)) |
589 $(call MakeDir, $(@D)) |
593 $(RM) $@ |
590 $(RM) $@ |
594 $(LN) -s $< $@ |
591 $(LN) -s $< $@ |
595 endef |
592 endef |
596 endif |
|
597 |
593 |
598 ################################################################################ |
594 ################################################################################ |
599 # Filter out duplicate sub strings while preserving order. Keeps the first occurance. |
595 # Filter out duplicate sub strings while preserving order. Keeps the first occurance. |
600 uniq = \ |
596 uniq = \ |
601 $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) |
597 $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) |