public
Description: The Nu programming language.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nu.git
Added "archive" task to generate Nu-X.Y.Z.tgz files for source releases.
timburks (author)
Sun Mar 23 22:55:23 -0700 2008
commit  1a7344f6541de7787ea32886692298381d8a5dfc
tree    8806709122177e97d3e267560ea27a4456693dc9
parent  523b24061ad897cf317189e130714ee6102765e1
...
83
84
85
86
87
88
89
 
 
 
 
90
91
92
 
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
118
119
120
121
122
 
 
123
124
125
126
127
128
 
 
129
130
131
132
 
133
134
135
...
141
142
143
144
145
146
147
148
149
 
 
 
 
 
 
150
151
152
153
154
 
 
155
156
157
...
180
181
182
183
184
185
 
 
 
186
187
188
...
193
194
195
196
 
197
198
199
...
229
230
231
 
 
 
 
 
 
 
232
233
234
...
83
84
85
 
 
 
 
86
87
88
89
90
91
 
92
93
94
95
96
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
 
 
121
122
123
124
125
126
 
 
127
128
129
130
131
 
132
133
134
135
...
141
142
143
 
 
 
 
 
 
144
145
146
147
148
149
150
151
152
 
 
153
154
155
156
157
...
180
181
182
 
 
 
183
184
185
186
187
188
...
193
194
195
 
196
197
198
199
...
229
230
231
232
233
234
235
236
237
238
239
240
241
0
@@ -83,53 +83,53 @@ END)
0
            (else "")))
0
 
0
 (ifDarwin
0
- (then (set @cflags "-Wall -g -DDARWIN -DMACOSX #{@sdk} #{@leopard} -std=gnu99")
0
- (set @mflags "-fobjc-exceptions")) ;; Want to try Apple's new GC? Add this: "-fobjc-gc"
0
- (else (set @cflags "-Wall -DLINUX -g -std=gnu99 ")
0
- (set @mflags "-fobjc-exceptions -fconstant-string-class=NSConstantString")))
0
+ (then (set @cflags "-Wall -g -DDARWIN -DMACOSX #{@sdk} #{@leopard} -std=gnu99")
0
+ (set @mflags "-fobjc-exceptions")) ;; Want to try Apple's new GC? Add this: "-fobjc-gc"
0
+ (else (set @cflags "-Wall -DLINUX -g -std=gnu99 ")
0
+ (set @mflags "-fobjc-exceptions -fconstant-string-class=NSConstantString")))
0
 
0
 (ifDarwin
0
- (then (set @arch '("ppc" "i386")))) ;; build a universal binary
0
+ (then (set @arch '("ppc" "i386")))) ;; build a universal binary
0
 
0
 ;; or set this to just build for your chosen platform
0
 ;; (set @arch '("i386"))
0
 
0
 (ifDarwin
0
- (then (set @ldflags
0
- ((list
0
- (cond ;; statically link in pcre since most people won't have it..
0
- ((NSFileManager fileExistsNamed:"#{@prefix}/lib/libpcre.a") ("#{@prefix}/lib/libpcre.a"))
0
- (else (NSException raise:"NukeBuildError" format:"Can't find static pcre library (libpcre.a).")))
0
- ((@frameworks map: (do (framework) " -framework #{framework}")) join)
0
- ((@libs map: (do (lib) " -l#{lib}")) join)
0
- ((@lib_dirs map: (do (libdir) " -L#{libdir}")) join))
0
- join)))
0
- (else (set @ldflags
0
- ((list
0
- "-lNuFound -L/usr/local/lib -lobjc -Wl,--rpath -Wl,/usr/local/lib"
0
- (cond ;; statically link in pcre since most people won't have it..
0
- ((NSFileManager fileExistsNamed:"/usr/lib/libpcre.a") "/usr/lib/libpcre.a")
0
- ((NSFileManager fileExistsNamed:"#{@prefix}/lib/libpcre.a") ("#{@prefix}/lib/libpcre.a"))
0
- (else (NSException raise:"NukeBuildError" format:"Can't find static pcre library (libpcre.a).")))
0
- ((@frameworks map: (do (framework) " -framework #{framework}")) join)
0
- ((@libs map: (do (lib) " -l#{lib}")) join))
0
- join))))
0
+ (then (set @ldflags
0
+ ((list
0
+ (cond ;; statically link in pcre since most people won't have it..
0
+ ((NSFileManager fileExistsNamed:"#{@prefix}/lib/libpcre.a") ("#{@prefix}/lib/libpcre.a"))
0
+ (else (NSException raise:"NukeBuildError" format:"Can't find static pcre library (libpcre.a).")))
0
+ ((@frameworks map: (do (framework) " -framework #{framework}")) join)
0
+ ((@libs map: (do (lib) " -l#{lib}")) join)
0
+ ((@lib_dirs map: (do (libdir) " -L#{libdir}")) join))
0
+ join)))
0
+ (else (set @ldflags
0
+ ((list
0
+ "-lNuFound -L/usr/local/lib -lobjc -Wl,--rpath -Wl,/usr/local/lib"
0
+ (cond ;; statically link in pcre since most people won't have it..
0
+ ((NSFileManager fileExistsNamed:"/usr/lib/libpcre.a") "/usr/lib/libpcre.a")
0
+ ((NSFileManager fileExistsNamed:"#{@prefix}/lib/libpcre.a") ("#{@prefix}/lib/libpcre.a"))
0
+ (else (NSException raise:"NukeBuildError" format:"Can't find static pcre library (libpcre.a).")))
0
+ ((@frameworks map: (do (framework) " -framework #{framework}")) join)
0
+ ((@libs map: (do (lib) " -l#{lib}")) join))
0
+ join))))
0
 ;; Setup the tasks for compilation and framework-building.
0
 ;; These are defined in the nuke application source file.
0
 (compilation-tasks)
0
 (ifDarwin
0
- (then (framework-tasks))
0
- (else (dylib-tasks)))
0
+ (then (framework-tasks))
0
+ (else (dylib-tasks)))
0
 
0
 (task "framework" => "#{@framework_headers_dir}/Nu.h")
0
 
0
 (ifDarwin
0
- (file "#{@framework_headers_dir}/Nu.h" => "objc/Nu.h" @framework_headers_dir is
0
- (SH "cp include/Nu/Nu.h #{@framework_headers_dir}")))
0
+ (file "#{@framework_headers_dir}/Nu.h" => "objc/Nu.h" @framework_headers_dir is
0
+ (SH "cp include/Nu/Nu.h #{@framework_headers_dir}")))
0
 
0
 (task "clobber" => "clean" is
0
       (ifDarwin
0
- (SH "rm -rf nush #{@framework_dir} doc"))
0
+ (SH "rm -rf nush #{@framework_dir} doc"))
0
       ((filelist "^examples/[^/]*$") each:
0
        (do (example-dir)
0
            (puts example-dir)
0
@@ -141,17 +141,17 @@ END)
0
            (set nush_thin_binary "build/#{architecture}/nush")
0
            (nush_thin_binaries addObject:nush_thin_binary)
0
            (ifDarwin
0
- (then
0
- (file nush_thin_binary => "framework" "build/#{architecture}/main.o" is
0
- (SH "#{@cc} #{@cflags} #{@mflags} main/main.m -arch #{architecture} -F. -framework Nu #{@ldflags} -o #{(target name)}")))
0
- (else
0
- (file nush_thin_binary => "dylib" (@c_objects objectForKey:architecture) (@m_objects objectForKey:architecture) is
0
- (SH "#{@cc} #{@cflags} #{@mflags} main/main.m #{@library_executable_name} #{@ldflags} -o #{(target name)}"))))))
0
+ (then
0
+ (file nush_thin_binary => "framework" "build/#{architecture}/main.o" is
0
+ (SH "#{@cc} #{@cflags} #{@mflags} main/main.m -arch #{architecture} -F. -framework Nu #{@ldflags} -o #{(target name)}")))
0
+ (else
0
+ (file nush_thin_binary => "dylib" (@c_objects objectForKey:architecture) (@m_objects objectForKey:architecture) is
0
+ (SH "#{@cc} #{@cflags} #{@mflags} main/main.m #{@library_executable_name} #{@ldflags} -o #{(target name)}"))))))
0
 
0
 (file "nush" => "framework" nush_thin_binaries is
0
       (ifDarwin
0
- (then (SH "lipo -create #{(nush_thin_binaries join)} -output #{(target name)}"))
0
- (else (SH "cp '#{(nush_thin_binaries objectAtIndex:0)}' '#{(target name)}'"))))
0
+ (then (SH "lipo -create #{(nush_thin_binaries join)} -output #{(target name)}"))
0
+ (else (SH "cp '#{(nush_thin_binaries objectAtIndex:0)}' '#{(target name)}'"))))
0
 
0
 ;; These tests were the first sanity tests for Nu. They require RubyObjC.
0
 (task "test.rb" => "framework" is
0
@@ -180,9 +180,9 @@ END)
0
             (SH "sudo cp tools/#{program} #{@installprefix}/bin")))
0
       (SH "sudo cp nush #{@installprefix}/bin")
0
       (ifDarwin
0
- ;; install the framework
0
- (SH "sudo rm -rf #{@destdir}/Library/Frameworks/#{@framework}.framework")
0
- (SH "ditto #{@framework}.framework #{@destdir}/Library/Frameworks/#{@framework}.framework"))
0
+ ;; install the framework
0
+ (SH "sudo rm -rf #{@destdir}/Library/Frameworks/#{@framework}.framework")
0
+ (SH "ditto #{@framework}.framework #{@destdir}/Library/Frameworks/#{@framework}.framework"))
0
       (if (eq (uname) "Linux")
0
           ;; install the dynamic library
0
           (SH "sudo cp #{@library_executable_name} #{@installprefix}/lib")
0
@@ -193,7 +193,7 @@ END)
0
       (SH "sudo rm -rf #{@installprefix}/share/nu")
0
       (SH "sudo cp -rp share/nu #{@installprefix}/share/nu")
0
       (ifDarwin
0
- (SH "sudo ditto examples #{@installprefix}/share/nu/examples")))
0
+ (SH "sudo ditto examples #{@installprefix}/share/nu/examples")))
0
 
0
 ;; Build a disk image for distributing the framework.
0
 (task "framework_image" => "framework" is
0
@@ -229,6 +229,13 @@ END)
0
 ;; alias for installer task
0
 (task "dmg" => "installer")
0
 
0
+;; Create a tgz file of the Nu sources.
0
+(task "archive" is
0
+ (SH <<-END
0
+git-archive --format=tar --prefix=Nu-#{(VERSION first)}.#{(VERSION second)}.#{(VERSION third)}/ HEAD |\
0
+gzip -c > Nu-#{(VERSION first)}.#{(VERSION second)}.#{(VERSION third)}.tgz
0
+END))
0
+
0
 ;; "Bake" nu source files into compilable Objective-C files.
0
 (task "bake" is
0
       (set nu_files (((NSString stringWithShellCommand:"ls nu/*.nu") chomp) componentsSeparatedByString:"\n"))

Comments

    No one has commented yet.