Fixed the logic to determine the TRIPLE_VERSION correctly when it isn't specified.
authorGreg Clayton <gclayton@apple.com>
Tue, 2 Jun 2015 21:42:31 +0000 (21:42 +0000)
committerGreg Clayton <gclayton@apple.com>
Tue, 2 Jun 2015 21:42:31 +0000 (21:42 +0000)
llvm-svn: 238871

lldb/test/make/Makefile.rules

index c512e15..f612703 100644 (file)
@@ -43,22 +43,24 @@ ifneq "$(TRIPLE)" ""
        triple_os_and_version =$(shell echo $(word 3, $(triple_space)) | sed -e 's/\(.*\)\([0-9]\.[0-9]\).*/\1 \2/')
        TRIPLE_OS =$(word 1, $(triple_os_and_version))
        TRIPLE_VERSION =$(word 2, $(triple_os_and_version))
-       ifeq "$(TRIPLE_VERSION)" ""
-               TRIPLE_VERSION =$(shell echo $(sdk_basename) | sed -e 's/.*\([0-9]\.[0-9]\).*/\1/')
-       endif
        ifeq "$(TRIPLE_VENDOR)" "apple"
                ifeq "$(TRIPLE_OS)" "ios"
                    ifeq "$(SDKROOT)" ""
                                # Set SDKROOT if it wasn't set
                                ifneq (,$(findstring arm,$(ARCH)))
                                        SDKROOT = $(shell xcrun --sdk iphoneos --show-sdk-path)
+                                       ifeq "$(TRIPLE_VERSION)" ""
+                                               TRIPLE_VERSION =$(shell echo $(notdir $(SDKROOT)) | sed -e 's/.*\([0-9]\.[0-9]\).*/\1/')
+                                       endif
                                        TRIPLE_CFLAGS :=-mios-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)"
                                else
                                        SDKROOT = $(shell xcrun --sdk iphonesimulator --show-sdk-path)
+                                       ifeq "$(TRIPLE_VERSION)" ""
+                                               TRIPLE_VERSION =$(shell echo $(notdir $(SDKROOT)) | sed -e 's/.*\([0-9]\.[0-9]\).*/\1/')
+                                       endif
                                        TRIPLE_CFLAGS :=-mios-simulator-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)"
                                endif
                        endif
-                       sdk_basename = $(notdir $(SDKROOT))
                endif
        endif
 endif