Permalink
Browse files

updating Makefile/nuke for Xcode 4.3.2 directory organization.

  • Loading branch information...
1 parent 1cd270e commit 82268904207df5c08ab1b7dff6d48234325b259b @timburks timburks committed Jun 4, 2012
Showing with 22 additions and 15 deletions.
  1. +5 −4 Makefile
  2. +17 −11 tools/nuke
View
@@ -8,7 +8,8 @@ SYSTEM = $(shell uname)
PREFIX ?= /usr/local
-DEVROOT =
+TOOLCHAIN = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
+SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer
ifeq ($(shell test -e /usr/lib/libffi.dylib && echo yes), yes)
# Use the libffi that ships with OS X.
@@ -20,8 +21,8 @@ else
FFI_INCLUDE = -I./libffi/include
endif
-ifeq ($(shell test -e $(DEVROOT)/SDKs/MacOSX10.7.sdk && echo yes), yes)
- LION_CFLAGS = -isysroot $(DEVROOT)/SDKs/MacOSX10.7.sdk
+ifeq ($(shell test -e $(SDKROOT)/SDKs/MacOSX10.7.sdk && echo yes), yes)
+ LION_CFLAGS = -isysroot $(SDKROOT)/SDKs/MacOSX10.7.sdk
else
LION_CFLAGS =
endif
@@ -50,7 +51,7 @@ ifeq ($(SYSTEM), Darwin)
# as of around 10.7.3, clang becomes part of OS X
CC = /usr/bin/clang
ifneq ($(shell test -e $(CC) && echo yes), yes)
- CC = $(DEVROOT)/usr/bin/clang
+ CC = $(TOOLCHAIN)/usr/bin/clang
endif
CFLAGS += -DMACOSX -DDARWIN $(LION_CFLAGS)
else
View
@@ -283,24 +283,30 @@
(unless momc (NSException raise:@"NukeError" format:@"Can't find momc (data model compiler)."))
momc)
+(set SDKROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer")
+(set TOOLCHAIN "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain")
+
(function select-compiler ()
- (ifDarwin
- ;; clang built-in to 10.7.3
- (set clang "/usr/bin/clang")
- (if (not (NSFileManager fileExistsNamed:clang))
- ;; use xcode-select to get from e.g. /Developer or Xcode.app
- (set DEVROOT (NSString stringWithShellCommand:"xcode-select -print-path"))
- (set clang "#{DEVROOT}/usr/bin/clang")
- (if (not (NSFileManager fileExistsNamed:clang))
- (set clang nil))))
- ;; default to gcc
- (if (clang) clang (else "gcc")))
+ (ifDarwin
+ ;; clang built-in to 10.7.3
+ (set clang "/usr/bin/clang")
+ (if (not (NSFileManager fileExistsNamed:clang))
+ ;; use xcode-select to get from e.g. /Developer or Xcode.app
+ (set DEVROOT (NSString stringWithShellCommand:"xcode-select -print-path"))
+ (set clang "#{DEVROOT}/usr/bin/clang")
+ (if (not (NSFileManager fileExistsNamed:clang))
+ (set clang "#{TOOLCHAIN}/usr/bin/clang")
+ (if (not (NSFileManager fileExistsNamed:clang))
+ (set clang nil)))))
+ ;; default to gcc
+ (if clang clang (else "gcc")))
;; use this to create all the compilation tasks for the files in the @c_files and @m_files collections
(macro compilation-tasks ()
`(progn
(unless @cc (set @cc (select-compiler)))
(unless @cflags (set @cflags "-g"))
+ (set @cflags (+ @cflags " -isysroot #{SDKROOT}/SDKs/MacOSX10.7.sdk"))
(unless @mflags (set @mflags "-fobjc-exceptions"))
(unless @includes (set @includes ""))
(ifDarwin

0 comments on commit 8226890

Please sign in to comment.