forked from programming-nu/nusax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNukefile
60 lines (47 loc) · 2.07 KB
/
Nukefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(set platform "native")
(case platform
("iPhone"
(set PLATFORM "-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk")
(set @arch '("armv6"))
(set @cc "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0"))
("simulator"
(set PLATFORM "-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk")
(set @arch '("i386")))
("native"
(set @cc "/usr/bin/gcc")
(set PLATFORM "")
(set @arch '("i386" "ppc")))
(else nil))
(set @cflags "-I /usr/include/libxml2 -g -ObjC -Iinclude -std=gnu99 #{PLATFORM} -mmacosx-version-min=10.5")
(set @h_files (filelist "^objc/.*.h$"))
(set @m_files (filelist "^objc/.*.m$"))
(set @nu_files (filelist "^nu/.*nu$"))
(set @frameworks '("Cocoa" "Nu"))
(set @libs '("xml2"))
(set @ldflags
((list
((@frameworks map: (do (framework) " -framework #{framework}")) join)
((@libs map: (do (lib) " -l#{lib}")) join)
((@lib_dirs map: (do (libdir) " -L#{libdir}")) join))
join))
(set @framework "NuSAX")
(set @framework_identifier "nu.programming.nusax")
(set @framework_creator_code "????")
(set @framework_install_path "@executbale_path/../Frameworks")
(compilation-tasks)
(framework-tasks)
(task "framework" => "#{@framework_headers_dir}/NuSAX.h")
(ifDarwin
(file "#{@framework_headers_dir}/NuSAX.h" => "objc/NuSAX.h" @framework_headers_dir is
(SH "cp objc/NuSAX.h #{@framework_headers_dir}")))
(task "test" => "framework" is
(SH "nutest test/test_*.nu"))
(task "default" => "framework")
(task "clobber" => "clean" is
(SH "rm -rf build")
(SH "rm -rf #{@framework_dir}")
(SH "rm -f example1"))
(task "install" => "framework" is
(SH "ditto #{@framework_dir} /Library/Frameworks/#{@framework_dir}"))
(task "example" is
(SH "#{@cc} examples/example1.m -o example1 -lxml2 -I/usr/include/libxml2 -framework Cocoa -framework NuSAX"))