X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=Makefile.rules;h=b2b02c25d44b66aabd98c819be68a1ba1df2c438;hp=289adc2be4292f7344cf503f8677928cd462c8df;hb=715672c643443225d21008b177b558504b6284e8;hpb=164a308b563c8bdc280c0762d79a8e797c3497e7 diff --git a/Makefile.rules b/Makefile.rules index 289adc2be42..b2b02c25d44 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -571,7 +571,11 @@ endif #-------------------------------------------------------------------- ifeq ($(HOST_OS),Darwin) + ifdef MACOSX_DEPLOYMENT_TARGET + DARWIN_VERSION := $(MACOSX_DEPLOYMENT_TARGET) + else DARWIN_VERSION := `sw_vers -productVersion` + endif # Strip a number like 10.4.7 to 10.4 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/') # Get "4" out of 10.4 for later pieces in the makefile. @@ -631,19 +635,23 @@ endif # Adjust linker flags for building an executable ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) -ifneq ($(HOST_OS), Darwin) -ifdef TOOLNAME - LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' - ifdef EXAMPLE_TOOL - LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag) - else - LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag) + ifneq ($(HOST_OS), Darwin) + ifdef TOOLNAME + LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' + ifdef EXAMPLE_TOOL + LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag) + else + LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag) + endif endif -endif else -ifneq ($(DARWIN_MAJVERS),4) - LD.Flags += $(RPATH) -Wl,@executable_path/../lib -endif + ifneq ($(DARWIN_MAJVERS),4) + LD.Flags += $(RPATH) -Wl,@executable_path/../lib + endif + ifeq ($(RC_BUILDIT),YES) + TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/llvm-lto.XXXXXX) + LD.Flags += -Wl,-object_path_lto -Wl,$(TempFile) + endif endif endif @@ -1524,7 +1532,7 @@ ifneq ($(strip $(ToolAliasBuildPath)),) $(ToolAliasBuildPath): $(ToolBuildPath) $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg) $(Verb) $(RM) -f $(ToolAliasBuildPath) - $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath) + $(Verb) $(AliasTool) $(notdir $(ToolBuildPath)) $(ToolAliasBuildPath) $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \ $(StripWarnMsg) endif @@ -1541,7 +1549,7 @@ ToolBinDir = $(DESTDIR)$(PROJ_internal_prefix)/bin else ToolBinDir = $(DESTDIR)$(PROJ_bindir) endif -DestTool = $(ToolBinDir)/$(TOOLEXENAME) +DestTool = $(ToolBinDir)/$(program_prefix)$(TOOLEXENAME) install-local:: $(DestTool) @@ -1556,14 +1564,14 @@ uninstall-local:: # TOOLALIAS install. ifdef TOOLALIAS -DestToolAlias = $(ToolBinDir)/$(TOOLALIAS)$(EXEEXT) +DestToolAlias = $(ToolBinDir)/$(program_prefix)$(TOOLALIAS)$(EXEEXT) install-local:: $(DestToolAlias) $(DestToolAlias): $(DestTool) $(Echo) Installing $(BuildMode) $(DestToolAlias) $(Verb) $(RM) -f $(DestToolAlias) - $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias) + $(Verb) $(AliasTool) $(notdir $(DestTool)) $(DestToolAlias) uninstall-local:: $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)