<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,38 +34,38 @@ END)
 (set @nib_files   '(&quot;share/nu/resources/English.lproj/MainMenu.nib&quot;))
 
 ;; libraries
-(if (eq (uname) &quot;Darwin&quot;)
-    (then (set @frameworks '(&quot;Cocoa&quot;))
-          (set @libs       '(&quot;edit&quot; &quot;ffi&quot; ))
-          (set @lib_dirs   (NSMutableArray arrayWithObject:&quot;/usr/lib&quot;)))
-    (else (set @frameworks nil)
-          (set @libs       (list &quot;readline&quot; &quot;ffi&quot; &quot;m&quot; ))
-          (set @lib_dirs   (NSMutableArray arrayWithList:(list &quot;../lib&quot;)))))
+(ifDarwin
+         (then (set @frameworks '(&quot;Cocoa&quot;))
+               (set @libs       '(&quot;edit&quot; &quot;ffi&quot; ))
+               (set @lib_dirs   (NSMutableArray arrayWithObject:&quot;/usr/lib&quot;)))
+         (else (set @frameworks nil)
+               (set @libs       (list &quot;readline&quot; &quot;ffi&quot; &quot;m&quot; ))
+               (set @lib_dirs   (NSMutableArray arrayWithList:(list &quot;../lib&quot;)))))
 
 (if (NSFileManager directoryExistsNamed:&quot;#{@prefix}/lib&quot;) (@lib_dirs addObject:&quot;#{@prefix}/lib&quot;))
 
 ;; includes
-(if (eq (uname) &quot;Darwin&quot;)
-    (then (set @includes &quot; -I ./include -I ./include/Nu &quot;))
-    (else (set @includes &quot; -I ./include -I ./include/Nu -I /usr/local/include&quot;)))
+(ifDarwin
+         (then (set @includes &quot; -I ./include -I ./include/Nu &quot;))
+         (else (set @includes &quot; -I ./include -I ./include/Nu -I /usr/local/include&quot;)))
 
 (if (NSFileManager directoryExistsNamed:&quot;#{@prefix}/include&quot;) (@includes appendString:&quot; -I #{@prefix}/include&quot;))
 
-(if (eq (uname) &quot;Darwin&quot;)
-    (then (if (NSFileManager fileExistsNamed:&quot;/usr/lib/libffi.dylib&quot;)
-              (then ;; Use the libffi that ships with OS X.
-                    (@includes appendString:&quot; -I /usr/include&quot;))
-              (else ;; Use the libffi that is distributed with Nu.
-                    (@includes appendString:&quot; -I ./libffi/include&quot;)
-                    (@lib_dirs addObject:&quot;./libffi&quot;))))
-    (else ;; Use the libffi that ships with Linux
-          (@includes appendString:&quot; -I /usr/include&quot;)))
+(ifDarwin
+         (then (if (NSFileManager fileExistsNamed:&quot;/usr/lib/libffi.dylib&quot;)
+                   (then ;; Use the libffi that ships with OS X.
+                         (@includes appendString:&quot; -I /usr/include&quot;))
+                   (else ;; Use the libffi that is distributed with Nu.
+                         (@includes appendString:&quot; -I ./libffi/include&quot;)
+                         (@lib_dirs addObject:&quot;./libffi&quot;))))
+         (else ;; Use the libffi that ships with Linux
+               (@includes appendString:&quot; -I /usr/include&quot;)))
 
 ;; framework description
 (set @framework &quot;Nu&quot;)
 (set @framework_identifier   &quot;nu.programming.framework&quot;)
 (set @framework_icon_file    &quot;nu.icns&quot;)
-(if (eq (uname) &quot;Darwin&quot;) (then (set @framework_initializer  &quot;NuInit&quot;)))
+(ifDarwin (then (set @framework_initializer  &quot;NuInit&quot;)))
 (set @framework_creator_code &quot;????&quot;)
 
 ;; for Linux, we build Nu as a dynamic library
@@ -82,19 +82,19 @@ END)
             (&quot; -isysroot /Developer/SDKs/MacOSX10.4u.sdk&quot;))
            (else &quot;&quot;)))
 
-(if (eq (uname) &quot;Darwin&quot;)
+(ifDarwin
     (then (set @cflags &quot;-Wall -g -DDARWIN -DMACOSX #{@sdk} #{@leopard} -std=gnu99&quot;)
           (set @mflags &quot;-fobjc-exceptions&quot;)) ;; Want to try Apple's new GC? Add this: &quot;-fobjc-gc&quot;
     (else (set @cflags &quot;-Wall -DLINUX -g -std=gnu99 &quot;)
           (set @mflags &quot;-fobjc-exceptions -fconstant-string-class=NSConstantString&quot;)))
 
-(if (eq (uname) &quot;Darwin&quot;)
-    ;; use this to build a universal binary
-    (then (set @arch '(&quot;ppc&quot; &quot;i386&quot;)))
-    ;; or this to just build for your current platform
-    (else (set @arch '(&quot;i386&quot;))))
+(ifDarwin
+    (then (set @arch '(&quot;ppc&quot; &quot;i386&quot;)))) ;; build a universal binary
 
-(if (eq (uname) &quot;Darwin&quot;)
+;; or set this to just build for your chosen platform
+;; (set @arch '(&quot;i386&quot;))
+
+(ifDarwin
     (then (set @ldflags
                ((list
                      (cond  ;; statically link in pcre since most people won't have it..
@@ -117,18 +117,18 @@ END)
 ;; Setup the tasks for compilation and framework-building.
 ;; These are defined in the nuke application source file.
 (compilation-tasks)
-(if (eq (uname) &quot;Darwin&quot;)
+(ifDarwin
     (then (framework-tasks))
     (else (dylib-tasks)))
 
 (task &quot;framework&quot; =&gt; &quot;#{@framework_headers_dir}/Nu.h&quot;)
 
-(if (eq (uname) &quot;Darwin&quot;)
+(ifDarwin
     (file &quot;#{@framework_headers_dir}/Nu.h&quot; =&gt; &quot;objc/Nu.h&quot; @framework_headers_dir is
           (SH &quot;cp include/Nu/Nu.h #{@framework_headers_dir}&quot;)))
 
 (task &quot;clobber&quot; =&gt; &quot;clean&quot; is
-      (if (eq (uname) &quot;Darwin&quot;)
+      (ifDarwin
           (SH &quot;rm -rf nush #{@framework_dir} doc&quot;))
       ((filelist &quot;^examples/[^/]*$&quot;) each:
        (do (example-dir)
@@ -140,7 +140,7 @@ END)
        (do (architecture)
            (set nush_thin_binary &quot;build/#{architecture}/nush&quot;)
            (nush_thin_binaries addObject:nush_thin_binary)
-           (if (eq (uname) &quot;Darwin&quot;)
+           (ifDarwin
                (then
                     (file nush_thin_binary =&gt; &quot;framework&quot; &quot;build/#{architecture}/main.o&quot; is
                           (SH &quot;#{@cc} #{@cflags} #{@mflags} main/main.m -arch #{architecture} -F. -framework Nu #{@ldflags} -o #{(target name)}&quot;)))
@@ -149,7 +149,7 @@ END)
                           (SH &quot;#{@cc} #{@cflags} #{@mflags} main/main.m #{@library_executable_name} #{@ldflags} -o #{(target name)}&quot;))))))
 
 (file &quot;nush&quot; =&gt; &quot;framework&quot; nush_thin_binaries is
-      (if (eq (uname) &quot;Darwin&quot;)
+      (ifDarwin
           (then (SH &quot;lipo -create #{(nush_thin_binaries join)} -output #{(target name)}&quot;))
           (else (SH &quot;cp '#{(nush_thin_binaries objectAtIndex:0)}' '#{(target name)}'&quot;))))
 
@@ -179,7 +179,7 @@ END)
         (do (program)
             (SH &quot;sudo cp tools/#{program} #{@installprefix}/bin&quot;)))
       (SH &quot;sudo cp nush #{@installprefix}/bin&quot;)
-      (if (eq (uname) &quot;Darwin&quot;)
+      (ifDarwin
           ;; install the framework
           (SH &quot;sudo rm -rf #{@destdir}/Library/Frameworks/#{@framework}.framework&quot;)
           (SH &quot;ditto #{@framework}.framework #{@destdir}/Library/Frameworks/#{@framework}.framework&quot;))
@@ -187,12 +187,12 @@ END)
           ;; install the dynamic library
           (SH &quot;sudo cp #{@library_executable_name} #{@installprefix}/lib&quot;)
           ;; copy the headers
-		  (SH &quot;sudo rm -rf /usr/local/include/Nu&quot;)
+          (SH &quot;sudo rm -rf /usr/local/include/Nu&quot;)
           (SH &quot;sudo cp -rp include/Nu /usr/local/include&quot;))
       (SH &quot;sudo mkdir -p #{@installprefix}/share&quot;)
       (SH &quot;sudo rm -rf #{@installprefix}/share/nu&quot;)
       (SH &quot;sudo cp -rp share/nu #{@installprefix}/share/nu&quot;)
-      (if (eq (uname) &quot;Darwin&quot;)
+      (ifDarwin
           (SH &quot;sudo ditto examples #{@installprefix}/share/nu/examples&quot;)))
 
 ;; Build a disk image for distributing the framework.</diff>
      <filename>Nukefile</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,7 @@ Ruby, while adding the syntactic simplicity and flexibility of Lisp.
 LEGAL
 
 Nu is copyrighted open-source software that is released under the Apache
-Public License, version 2.0.  For details on the license, see the LICENSE file.
+License, version 2.0.  For details on the license, see the LICENSE file.
 In its use to name a programming language, &quot;Nu&quot; is a trademark of Neon Design 
 Technology, Inc.
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -477,7 +477,7 @@ END))
 &lt;/div&gt;
 &lt;div style=&quot;float:left&quot;&gt;
 &lt;h1&gt;&lt;a href=&quot;/&quot;&gt;Programming Nu&lt;/a&gt;&lt;/h1&gt;
-&lt;h3&gt;Reduce, Reuse, and Recycle &lt;em&gt;code&lt;/em&gt;.&lt;/h3&gt;
+&lt;h3&gt;Website for the Nu programming language.&lt;/h3&gt;
 &lt;/div&gt;END) (else &quot;&quot;)))
 
 ;;;;;;;;;;;;; Footer Template ;;;;;;;;;;;;;;;;;</diff>
      <filename>nu/doc.nu</filename>
    </modified>
    <modified>
      <diff>@@ -18,10 +18,9 @@
 #   limitations under the License.
 
 ;; basic declarations that allow nuke to run in mininush
-(global NO 0)
-(global YES 1)
 (set exit (NuBridgedFunction functionWithName:&quot;exit&quot; signature:&quot;vi&quot;))
 
+;; system-level helpers
 (function SH (command)
      (puts &quot;nuke: #{command}&quot;)
      (set result (system command))
@@ -29,6 +28,9 @@
          (puts &quot;nuke: terminating on command error (return code #{result})&quot;)
          (exit result)))
 
+(macro ifDarwin (eval (append '(if (eq (uname) &quot;Darwin&quot;)) margs)))
+(macro ifLinux (eval (append '(if (eq (uname) &quot;Linux&quot;)) margs)))
+
 (class NSString
      ;; Change the extension at the end of a file name to a new specified value.
      (imethod (id) stringByReplacingPathExtensionWith:(id) newExtension is
@@ -223,8 +225,10 @@
      (unless @cflags (set @cflags &quot;-g&quot;))
      (unless @mflags (set @mflags &quot;-fobjc-exceptions&quot;))
      (unless @includes (set @includes &quot;&quot;))
-     (unless (and @arch (@arch length))
-             (set @arch (list (NSString stringWithShellCommand:&quot;arch&quot;))))
+     (ifDarwin
+              (then (unless (and @arch (@arch length))
+                            (set @arch (list (NSString stringWithShellCommand:&quot;arch&quot;)))))
+              (else (set @arch (list &quot;x86-linux&quot;))))
      (@arch each: (do (architecture) (system &quot;mkdir -p build/#{architecture}&quot;)))
      
      (unless @ldflags ;; not for compilation, but common across all builds
@@ -240,7 +244,7 @@
                          (set objectName &quot;build/#{architecture}/&quot;)
                          (objectName appendString:((sourceName fileName) stringByReplacingPathExtensionWith:&quot;o&quot;))
                          ((@c_objects objectForKey:architecture) addObject: objectName)
-                         (if (eq (uname) &quot;Darwin&quot;)
+                         (ifDarwin
                              (then (set archflags &quot;-arch #{architecture}&quot;))
                              (else (set archflags &quot;&quot;)))
                          (file objectName =&gt; sourceName is
@@ -256,7 +260,7 @@
                          (set objectName &quot;build/#{architecture}/&quot;)
                          (objectName appendString:((sourceName fileName) stringByReplacingPathExtensionWith:&quot;o&quot;))
                          ((@m_objects objectForKey:architecture) addObject: objectName)
-                         (if (eq (uname) &quot;Darwin&quot;)
+                         (ifDarwin
                              (then (set archflags &quot;-arch #{architecture}&quot;))
                              (else (set archflags &quot;&quot;)))
                          (file objectName =&gt; sourceName is
@@ -328,7 +332,7 @@
                      (do (architecture)
                          (set application_executable &quot;build/#{architecture}/application-#{@application}&quot;)
                          (@application_executables addObject:application_executable)
-                         (if (eq (uname) &quot;Darwin&quot;)
+                         (ifDarwin
                              (then (set archflags &quot;-arch #{architecture}&quot;))
                              (else (set archflags &quot;&quot;)))
                          (file application_executable =&gt; (@c_objects objectForKey:architecture) (@m_objects objectForKey:architecture) is
@@ -336,7 +340,7 @@
                                (SH command))))
               ;; application fat executable
               (file @application_executable_name =&gt; @application_executable_dir @application_executables is
-                    (if (eq (uname) &quot;Darwin&quot;)
+                    (ifDarwin
                         (then (set command &quot;lipo -create #{(@application_executables join)} -output '#{@application_executable_name}'&quot;))
                         (else (set command &quot;cp '#{(@application_executables objectAtIndex:0)}' '#{@application_executable_name}'&quot;)))
                     (SH command)))
@@ -450,20 +454,20 @@
                          (else &quot;&quot;)))
      
      (set @framework_executable_name &quot;#{@framework_contents_dir}/#{@framework}&quot;)
-
+     
      ;; framework architecture-specific executable
      (set @framework_executables (NSMutableArray array))
      (@arch each:
             (do (architecture)
                 (set framework_executable &quot;build/#{architecture}/framework-#{@framework}&quot;)
                 (@framework_executables addObject:framework_executable)
-                (if (eq (uname) &quot;Darwin&quot;)
+                (ifDarwin
                     (then (set archflags &quot;-arch #{architecture}&quot;))
                     (else (set archflags &quot;&quot;)))
-                (if (eq (uname) &quot;Darwin&quot;)
+                (ifDarwin
                     (then (set installnameflag &quot;-install_name #{@framework_executable_name}&quot;))
                     (else (set installnameflag &quot;&quot;)))
-                (if (eq (uname) &quot;Darwin&quot;)
+                (ifDarwin
                     (then (set dylibflag &quot;-dynamiclib&quot;))
                     (else (set dylibflag &quot;-shared&quot;)))
                 (file framework_executable =&gt; (@c_objects objectForKey:architecture) (@m_objects objectForKey:architecture) is
@@ -472,7 +476,7 @@
      
      ;; framework fat executable
      (file @framework_executable_name =&gt; @framework_contents_dir @framework_executables is
-           (if (eq (uname) &quot;Darwin&quot;)
+           (ifDarwin
                (then (set command &quot;lipo -create #{(@framework_executables join)} -output '#{@framework_executable_name}'&quot;))
                (else (set command &quot;cp '#{(@framework_executables objectAtIndex:0)}' '#{@framework_executable_name}'&quot;)))
            (SH command))
@@ -559,7 +563,7 @@
             (do (architecture)
                 (set bundle_executable &quot;build/#{architecture}/bundle-#{@bundle}&quot;)
                 (@bundle_executables addObject:bundle_executable)
-                (if (eq (uname) &quot;Darwin&quot;)
+                (ifDarwin
                     (then (set archflags &quot;-arch #{architecture}&quot;))
                     (else (set archflags &quot;&quot;)))
                 (file bundle_executable =&gt; (@c_objects objectForKey:architecture) (@m_objects objectForKey:architecture) is
@@ -635,7 +639,7 @@
 (macro dylib-tasks
      (unless (and @arch (@arch length))
              (set @arch (list (NSString stringWithShellCommand:&quot;arch&quot;))))
-     (set libext (if (eq (uname) &quot;Darwin&quot;) (then &quot;dylib&quot;) (else &quot;so&quot;)))
+     (set libext (ifDarwin (then &quot;dylib&quot;) (else &quot;so&quot;)))
      
      ;; library architecture-specific executable
      (set @library_executables (NSMutableArray array))
@@ -643,10 +647,10 @@
             (do (architecture)
                 (set library_executable &quot;build/#{architecture}/#{@dylib}.#{libext}&quot;)
                 (@library_executables addObject:library_executable)
-                (if (eq (uname) &quot;Darwin&quot;)
+                (ifDarwin
                     (then (set dylibflag &quot;-dynamiclib&quot;))
                     (else (set dylibflag &quot;-shared&quot;)))
-                (if (eq (uname) &quot;Darwin&quot;)
+                (ifDarwin
                     (then (set archflags &quot;-arch #{architecture}&quot;))
                     (else (set archflags &quot;&quot;)))
                 (file library_executable =&gt; (@c_objects objectForKey:architecture) (@m_objects objectForKey:architecture) is
@@ -656,7 +660,7 @@
      ;; fat dynamic library
      (set @library_executable_name &quot;#{@dylib}.#{libext}&quot;)
      (file @library_executable_name =&gt; @library_executables is
-           (if (eq (uname) &quot;Darwin&quot;)
+           (ifDarwin
                (then (set command &quot;lipo -create #{(@library_executables join)} -output '#{@library_executable_name}'&quot;))
                (else (set command &quot;cp '#{(@library_executables objectAtIndex:0)}' '#{@library_executable_name}'&quot;)))
            (SH command))</diff>
      <filename>tools/nuke</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a300ca791bd7fba9c64dbc7179085ce02cded79f</id>
    </parent>
  </parents>
  <author>
    <name>Tim Burks</name>
    <email>tim@neontology.com</email>
  </author>
  <url>http://github.com/timburks/nu/commit/3aa086ba65e7ee9ba3a0e9687eb408c78732b388</url>
  <id>3aa086ba65e7ee9ba3a0e9687eb408c78732b388</id>
  <committed-date>2008-03-16T09:56:43-07:00</committed-date>
  <authored-date>2008-03-16T09:56:43-07:00</authored-date>
  <message>New ifDarwin macro simplifies Nukefiles, minor text edits.</message>
  <tree>a66fa02c070a2d4275f36b4a82214bf931846bf1</tree>
  <committer>
    <name>Tim Burks</name>
    <email>tim@neontology.com</email>
  </committer>
</commit>
