forked from MoSync/MoSync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkfile.rb
executable file
·105 lines (86 loc) · 2.73 KB
/
workfile.rb
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/ruby
# File.expand_path is used here to ensure the files are really only loaded once.
require File.expand_path('rules/targets.rb')
require File.expand_path('rules/host.rb')
require File.expand_path('rules/task.rb')
require File.expand_path('rules/mosync_util.rb')
PRE_DIRS = ["intlibs/idl-common", "intlibs/filelist"]
if(HOST == :win32) then
INTLIB_PLATFORM = "windows"
PLATFORM_TOOLS = ["tools/makesis-2.0.0", "tools/makesis-4", "tools/mifconv", "tools/rcomp", "tools/package", "tools/uidcrc"]
elsif(HOST == :darwin)
INTLIB_PLATFORM = "linux"
PLATFORM_TOOLS = ["tools/makesis-2.0.0_unix", "tools/makesis-4_unix", "tools/mifconv", "tools/rcomp", "tools/package", "tools/uidcrc"]
else
INTLIB_PLATFORM = HOST
# todo: add lcab
PLATFORM_TOOLS = []
end
MORE_DIRS = ["intlibs/helpers/platforms/#{INTLIB_PLATFORM}",
"intlibs/bluetooth",
"intlibs/demangle",
"intlibs/gsm_amr",
"intlibs/net",
"intlibs/stabs",
"runtimes/cpp/platforms/sdl",
"runtimes/cpp/platforms/sdl/mosynclib",
"runtimes/cpp/platforms/sdl/MoRE"
]
BASE_DIRS = MORE_DIRS + PLATFORM_TOOLS
PIPE_DIRS = ["tools/protobuild", "tools/pipe-tool", "libs"]
EXAM_DIRS = PIPE_DIRS + ["tests/unitTest", "examples"]
TOOL_DIRS = ["tools/debugger", "tools/FontGenerator", "tools/PanicDoc", "tools/Bundle",
"tests/unitTestServer", "tools/iphone-builder", "tools/icon-injector", "tools/e32hack"]
MAIN_DIRS = BASE_DIRS + TOOL_DIRS + PIPE_DIRS
ALL_DIRS = MAIN_DIRS + EXAM_DIRS
NEWLIB_DIRS = ["libs"]
skins = Work.new
skins.instance_eval do
def setup
builddir = "#{mosyncdir}/skins"
@prerequisites = [DirTask.new(self, builddir)]
skin_sources = Dir['skins/*']
@prerequisites |= skin_sources.collect do |src|
CopyFileTask.new(self, FileTask.new(self, "#{builddir}/#{File.basename(src)}"),
FileTask.new(self, src))
end
end
end
target :base => skins do
Work.invoke_subdirs(PRE_DIRS)
#Work.invoke_subdir("tools/WrapperGenerator", "compile")
Work.invoke_subdir("tools/idl2", "compile")
end
target :default => :base do
Work.invoke_subdirs(MAIN_DIRS)
end
target :all => :default do
Work.invoke_subdirs(EXAM_DIRS)
end
target :noidl => skins do
Work.invoke_subdirs(PRE_DIRS)
Work.invoke_subdir("tools/idl2")
Work.invoke_subdirs(MAIN_DIRS)
end
target :more => :base do
Work.invoke_subdirs(MORE_DIRS)
end
target :examples => :base do
Work.invoke_subdirs(EXAM_DIRS)
end
target :newlib => :base do
Work.invoke_subdirs(NEWLIB_DIRS)
end
target :clean_more do
verbose_rm_rf("build")
Work.invoke_subdirs(PRE_DIRS, "clean")
Work.invoke_subdir("tools/idl2", "clean")
Work.invoke_subdirs(MORE_DIRS, "clean")
end
target :clean do
verbose_rm_rf("build")
Work.invoke_subdirs(PRE_DIRS, "clean")
Work.invoke_subdir("tools/idl2", "clean")
Work.invoke_subdirs(ALL_DIRS, "clean")
end
Targets.invoke