X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile.rules;h=7f298a9954225391e0d789c586a254daddfcc9c3;hb=749fd83c04b735de1224d96d481d1d926769d536;hp=db52985179fd13e0948cb9fab375824c38a0ceb2;hpb=7cfbe2576d98e6ca6d65a05514d1477233543c42;p=oota-llvm.git diff --git a/Makefile.rules b/Makefile.rules index db52985179f..7f298a99542 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -578,8 +578,6 @@ endif ifeq ($(TARGET_OS),Darwin) ifneq ($(ARCH),ARM) TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) - else - TargetCommonOpts += -marm endif endif @@ -623,11 +621,12 @@ endif ifneq ($(HOST_OS),Darwin) ifneq ($(DARWIN_MAJVERS),4) ifdef TOOLNAME -ifdef EXAMPLE_TOOL - LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(RDYNAMIC) -else - LD.Flags += $(RPATH) -Wl,$(ToolDir) $(RDYNAMIC) -endif + LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' + ifdef EXAMPLE_TOOL + LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(RDYNAMIC) + else + LD.Flags += $(RPATH) -Wl,$(ToolDir) $(RDYNAMIC) + endif endif endif endif @@ -780,7 +779,7 @@ ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc) # in the file so they get built before dependencies #--------------------------------------------------------- -$(PROJ_bindir) $(PROJ_libdir) $(PROJ_includedir) $(PROJ_etcdir):: +$(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir):: $(Verb) $(MKDIR) $@ # To create other directories, as needed, and timestamp their creation @@ -903,22 +902,22 @@ install-local:: uninstall-local:: $(Echo) UnInstall circumvented with NO_INSTALL else -install-local:: $(PROJ_etcdir) $(CONFIG_FILES) - $(Echo) Installing Configuration Files To $(PROJ_etcdir) +install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES) + $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir) $(Verb)for file in $(CONFIG_FILES); do \ if test -f $(PROJ_OBJ_DIR)/$${file} ; then \ - $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \ + $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \ elif test -f $(PROJ_SRC_DIR)/$${file} ; then \ - $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \ + $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \ else \ $(ECHO) Error: cannot find config file $${file}. ; \ fi \ done uninstall-local:: - $(Echo) Uninstalling Configuration Files From $(PROJ_etcdir) + $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir) $(Verb)for file in $(CONFIG_FILES); do \ - $(RM) -f $(PROJ_etcdir)/$${file} ; \ + $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \ done endif @@ -960,11 +959,16 @@ $(LLVM_CONFIG): $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG) +ifeq ($(ENABLE_SHARED), 1) +LLVMLibsOptions += -lLLVM-$(LLVMVersion) +LLVMLibsPaths += $(LibDir)/libLLVM-$(LLVMVersion)$(SHLIBEXT) +else LLVMLibsOptions += $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS)) LLVMLibsPaths += $(LLVM_CONFIG) \ $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS)) endif endif +endif ############################################################################### # Library Build Rules: Four ways to build a library @@ -1005,7 +1009,7 @@ endif ifdef BYTECODE_DESTINATION ModuleDestDir := $(BYTECODE_DESTINATION) else -ModuleDestDir := $(PROJ_libdir) +ModuleDestDir := $(DESTDIR)$(PROJ_libdir) endif ifdef NO_INSTALL @@ -1084,17 +1088,17 @@ install-local:: uninstall-local:: $(Echo) Uninstall circumvented with NO_INSTALL else -DestSharedLib = $(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) +DestSharedLib = $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) install-local:: $(DestSharedLib) -$(DestSharedLib): $(LibName.SO) $(PROJ_libdir) +$(DestSharedLib): $(LibName.SO) $(DESTDIR)$(PROJ_libdir) $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib) $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib) uninstall-local:: $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib) - -$(Verb) $(RM) -f $(PROJ_libdir)/lib$(LIBRARYNAME).* + -$(Verb) $(RM) -f $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).* endif endif @@ -1138,7 +1142,7 @@ endif ifdef BYTECODE_DESTINATION BytecodeDestDir := $(BYTECODE_DESTINATION) else -BytecodeDestDir := $(PROJ_libdir) +BytecodeDestDir := $(DESTDIR)$(PROJ_libdir) endif DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca @@ -1169,11 +1173,13 @@ endif # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to # building an archive. #--------------------------------------------------------- +ifndef NO_BUILD_ARCHIVE ifndef BUILD_ARCHIVE ifndef LOADABLE_MODULE BUILD_ARCHIVE = 1 endif endif +endif #--------------------------------------------------------- # Archive Library Targets: @@ -1201,13 +1207,13 @@ install-local:: uninstall-local:: $(Echo) Uninstall circumvented with NO_INSTALL else -DestArchiveLib := $(PROJ_libdir)/lib$(LIBRARYNAME).a +DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a install-local:: $(DestArchiveLib) -$(DestArchiveLib): $(LibName.A) $(PROJ_libdir) +$(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir) $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib) - $(Verb) $(MKDIR) $(PROJ_libdir) + $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir) $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib) uninstall-local:: @@ -1307,11 +1313,11 @@ install-local:: uninstall-local:: $(Echo) Uninstall circumvented with NO_INSTALL else -DestTool = $(PROJ_bindir)/$(TOOLEXENAME) +DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME) install-local:: $(DestTool) -$(DestTool): $(ToolBuildPath) $(PROJ_bindir) +$(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir) $(Echo) Installing $(BuildMode) $(DestTool) $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool) @@ -1321,7 +1327,7 @@ uninstall-local:: # TOOLALIAS install. ifdef TOOLALIAS -DestToolAlias = $(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT) +DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT) install-local:: $(DestToolAlias) @@ -1956,25 +1962,25 @@ uninstall-local:: else install-local:: $(Echo) Installing include files - $(Verb) $(MKDIR) $(PROJ_includedir) + $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir) $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \ cd $(PROJ_SRC_ROOT)/include && \ for hdr in `find . -type f '!' '(' -name '*~' \ -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \ grep -v .svn` ; do \ - instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \ + instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \ if test \! -d "$$instdir" ; then \ $(EchoCmd) Making install directory $$instdir ; \ $(MKDIR) $$instdir ;\ fi ; \ - $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \ + $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ done ; \ fi ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \ cd $(PROJ_OBJ_ROOT)/include && \ for hdr in `find . -type f -print | grep -v CVS` ; do \ - $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \ + $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ done ; \ fi endif @@ -1986,10 +1992,10 @@ uninstall-local:: $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \ '!' '(' -name '*~' -o -name '.#*' \ -o -name '*.in' ')' -print ')' | \ - grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \ + grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \ cd $(PROJ_SRC_ROOT)/include && \ $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \ - -print ')' | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \ + -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \ fi endif endif