delegate the disassembly of t2ADR to the more generic t2ADDri12/t2SUBri12 instruction...
[oota-llvm.git] / Makefile.rules
index cb439d3676f6e71ff751de7fb3194eb2f36d1078..5fc77a5e51014418f64d3f3b002db064ba40791a 100644 (file)
@@ -655,8 +655,8 @@ ifeq ($(BUILD_COMPONENT), 1)
   Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
                   $(CompileCommonOpts) $(CXX.Flags) -E
   Link          = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
-                 $(LDFLAGS) \
-                  $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) $(Strip)
+                 $(LD.Flags) $(LDFLAGS) \
+                  $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
 else
   Compile.C     = $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
                   $(TargetCommonOpts) $(CompileCommonOpts) -c
@@ -664,8 +664,8 @@ else
                   $(TargetCommonOpts) $(CompileCommonOpts) -c
   Preprocess.CXX= $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
                   $(CompileCommonOpts) $(CXX.Flags) -E
-  Link          = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LDFLAGS) \
-                  $(TargetCommonOpts)  $(CompileCommonOpts) $(LD.Flags) $(Strip)
+  Link          = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
+                  $(LDFLAGS) $(TargetCommonOpts)  $(CompileCommonOpts) $(Strip)
 endif
 
 BCCompile.C   = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
@@ -719,6 +719,24 @@ BaseNameSources := $(sort $(basename $(Sources)))
 ObjectsO  := $(BaseNameSources:%=$(ObjDir)/%.o)
 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
 
+#----------------------------------------------------------
+# For Mingw MSYS bash and Python/w32:
+#
+# $(ECHOPATH) prints DOSish pathstring.
+#   ex) $(ECHOPATH) /include/sys/types.h
+#   --> C:/mingw/include/sys/types.h
+# built-in "echo" does not transform path to DOSish path.
+#
+# FIXME: It would not be needed when MSYS's python
+# were provided.
+#----------------------------------------------------------
+
+ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
+  ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
+else
+  ECHOPATH := $(Verb)$(ECHO)
+endif
+
 ###############################################################################
 # DIRECTORIES: Handle recursive descent of directory structure
 ###############################################################################
@@ -840,7 +858,9 @@ $(RecursiveTargets)::
 else
 $(RecursiveTargets)::
        $(Verb) for dir in $(OPTIONAL_DIRS); do \
-         ($(MAKE) -C$$dir $@ ) || exit 1; \
+         if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
+           ($(MAKE) -C$$dir $@ ) || exit 1; \
+         fi \
        done
 endif
 endif
@@ -971,7 +991,9 @@ $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
        $(Verb) echo "{" > $@
        $(Verb) grep -q "\<" $< && echo "  global:" >> $@ || :
        $(Verb) sed -e 's/$$/;/' -e 's/^/    /' < $< >> $@
+ifneq ($(HOST_OS),OpenBSD)
        $(Verb) echo "  local: *;" >> $@
+endif
        $(Verb) echo "};" >> $@
 clean-local::
        -$(Verb) $(RM) -f $(NativeExportsFile)
@@ -1083,12 +1105,14 @@ ifdef LIBRARYNAME
 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
 LIBRARYNAME := $(strip $(LIBRARYNAME))
 ifdef LOADABLE_MODULE
-LibName.A  := $(LibDir)/$(LIBRARYNAME).a
-LibName.SO := $(SharedLibDir)/$(LIBRARYNAME)$(SHLIBEXT)
+BaseLibName.A  := $(LIBRARYNAME).a
+BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
 else
-LibName.A  := $(LibDir)/lib$(LIBRARYNAME).a
-LibName.SO := $(SharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
+BaseLibName.A  := lib$(LIBRARYNAME).a
+BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
 endif
+LibName.A  := $(LibDir)/$(BaseLibName.A)
+LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
 LibName.O  := $(LibDir)/$(LIBRARYNAME).o
 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
 
@@ -1142,7 +1166,7 @@ DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
 else
 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
 endif
-DestSharedLib := $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
+DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
 
 install-local:: $(DestSharedLib)
 
@@ -2133,8 +2157,13 @@ install-local::
        $(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 | \
+         for hdr in `find . -type f \
+             '(' -name LICENSE.TXT \
+              -o -name '*.def' \
+              -o -name '*.h' \
+              -o -name '*.inc' \
+              -o -name '*.td' \
+             ')' -print | grep -v CVS | \
              grep -v .svn` ; do \
            instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
            if test \! -d "$$instdir" ; then \
@@ -2147,7 +2176,19 @@ install-local::
 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 \
+         for hdr in `find . -type f \
+             '(' -name LICENSE.TXT \
+              -o -name '*.def' \
+              -o -name '*.h' \
+              -o -name '*.inc' \
+              -o -name '*.td' \
+             ')' -print | grep -v CVS | \
+             grep -v .svn` ; do \
+           instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
+           if test \! -d "$$instdir" ; then \
+             $(EchoCmd) Making install directory $$instdir ; \
+             $(MKDIR) $$instdir ;\
+           fi ; \
            $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
          done ; \
        fi