Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed hard-coded /Developer paths, added top-level tests.nu to more…

… easily run tests from Xcode schemes.
  • Loading branch information...
commit 8522ddbc30386733bf714984d423459b8d777bf2 1 parent b622d89
@timburks authored
Showing with 33 additions and 15 deletions.
  1. +8 −3 Makefile
  2. +18 −12 Nukefile
  3. +7 −0 tests.nu
View
11 Makefile
@@ -9,21 +9,26 @@ SYSTEM = $(shell uname)
PREFIX ?= /usr/local
ifeq ($(SYSTEM), Darwin)
+
+ DEVROOT = $(shell xcode-select -print-path)
+
ifeq ($(shell test -e /usr/lib/libffi.dylib && echo yes), yes)
# Use the libffi that ships with OS X.
FFI_LIB = -L/usr/lib -lffi
FFI_INCLUDE = -I/usr/include/ffi
+ # assume that our system is at least on Leopard
LEOPARD_CFLAGS = -DLEOPARD_OBJC2
else
# Use the libffi that is distributed with Nu.
FFI_LIB = -L./libffi -lffi
FFI_INCLUDE = -I./libffi/include
+ # assume that our system is pre-Leopard
LEOPARD_CFLAGS =
endif
- ifeq ($(shell test -e /Developer/SDKs/MacOSX10.7.sdk && echo yes), yes)
+ ifeq ($(shell test -e $(DEVROOT)/SDKs/MacOSX10.7.sdk && echo yes), yes)
# not a typo, we deliberatly stay back on the 10.6 SDK for now.
- LION_CFLAGS = -DLION -isysroot /Developer/SDKs/MacOSX10.6.sdk
+ LION_CFLAGS = -DLION -isysroot $(DEVROOT)/SDKs/MacOSX10.6.sdk
else
LION_CFLAGS =
endif
@@ -63,7 +68,7 @@ MFLAGS = -fobjc-exceptions
CFLAGS += -DHAVE_CONFIG_H
ifeq ($(SYSTEM), Darwin)
- #CC = /Developer/usr/bin/llvm-gcc-4.2
+ CC = $(DEVROOT)/usr/bin/llvm-gcc-4.2
CFLAGS += -DMACOSX -DDARWIN $(LEOPARD_CFLAGS) $(LION_CFLAGS) -Ipcre
else
# CFLAGS += -DLINUX
View
30 Nukefile
@@ -1,5 +1,9 @@
;; Nukefile for Nu framework and nush, the Nu shell
+(set DEVROOT
+ (ifDarwin (then (NSString stringWithShellCommand:"xcode-select -print-path"))
+ (else nil)))
+
(global VERSION '(0 9 1)) #(major minor tweak)
(task "version" is
@@ -84,19 +88,21 @@ END)
;; build configuration
(set @cc "gcc")
+(set @cc "#{DEVROOT}/usr/bin/llvm-gcc-4.2")
+
(set @leopard "")
(set @sdk
- (cond ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.7.sdk")
+ (cond ((NSFileManager directoryExistsNamed:"#{DEVROOT}/SDKs/MacOSX10.7.sdk")
(set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__ -DSNOWLEOPARD -DLION")
- ("-isysroot /Developer/SDKs/MacOSX10.6.sdk")) ;; stay on the 10.6 SDK for now
- ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.6.sdk")
+ ("-isysroot #{DEVROOT}/SDKs/MacOSX10.6.sdk")) ;; stay on the 10.6 SDK for now
+ ((NSFileManager directoryExistsNamed:"#{DEVROOT}/SDKs/MacOSX10.6.sdk")
(set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__ -DSNOWLEOPARD")
- ("-isysroot /Developer/SDKs/MacOSX10.6.sdk"))
- ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.5.sdk")
+ ("-isysroot #{DEVROOT}/SDKs/MacOSX10.6.sdk"))
+ ((NSFileManager directoryExistsNamed:"#{DEVROOT}/SDKs/MacOSX10.5.sdk")
(set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__")
- ("-isysroot /Developer/SDKs/MacOSX10.5.sdk"))
- ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.4u.sdk")
- ("-isysroot /Developer/SDKs/MacOSX10.4u.sdk"))
+ ("-isysroot #{DEVROOT}/SDKs/MacOSX10.5.sdk"))
+ ((NSFileManager directoryExistsNamed:"#{DEVROOT}/SDKs/MacOSX10.4u.sdk")
+ ("-isysroot #{DEVROOT}/SDKs/MacOSX10.4u.sdk"))
(else "")))
(set @cflags "-Wall -g -std=gnu99 -fPIC")
@@ -186,7 +192,7 @@ END)
(SH "ruby -rtest/unit -e0 -- -v --pattern '/test_.*\.rb^/'"))
(task "test" => "framework" "nush" is
- (SH "./nush tools/nutest test/test_*.nu"))
+ (SH "./nush tools/nutest tests.nu"))
(task "doc" is
(SH "nudoc"))
@@ -232,9 +238,9 @@ END)
(SH "hdiutil create -srcdir dmg '#{@framework}.dmg' -volname '#{@framework}'")
(SH "rm -rf dmg"))
-(if (NSFileManager fileExistsNamed:"/Developer/usr/bin/packagemaker")
- (then (set PACKAGEMAKER "/Developer/usr/bin/packagemaker"))
- (else (set PACKAGEMAKER "/Developer/Tools/packagemaker")))
+(if (NSFileManager fileExistsNamed:"#{DEVROOT}/usr/bin/packagemaker")
+ (then (set PACKAGEMAKER "#{DEVROOT}/usr/bin/packagemaker"))
+ (else (set PACKAGEMAKER "#{DEVROOT}/Tools/packagemaker")))
;; Build an installer and wrap it in a disk image.
(task "installer" => "framework" "nush" is
View
7 tests.nu
@@ -0,0 +1,7 @@
+# loads all unit tests in the test directory
+
+(set tests ((NSString stringWithShellCommand:"ls test/test_*.nu") lines))
+
+(tests each:
+ (do (test)
+ (load test)))
Please sign in to comment.
Something went wrong with that request. Please try again.