Silence compiler warning about case values not being in the enumerated type
[oota-llvm.git] / Makefile.rules
index 57198844f56d06d787cbed0c950c3f43e7d90131..5fc77a5e51014418f64d3f3b002db064ba40791a 100644 (file)
@@ -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
 ###############################################################################
@@ -2139,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 \
@@ -2153,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