forked from MoSync/MoSync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkfile.rb
executable file
·130 lines (108 loc) · 3.32 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
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
#!/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", "tools/MoSyncUpdater"]
ADDITIONAL_INTLIBS = ["intlibs/dgles-0.5"]
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"]
ADDITIONAL_INTLIBS = []
else
INTLIB_PLATFORM = HOST
# todo: add lcab
PLATFORM_TOOLS = []
ADDITIONAL_INTLIBS = []
end
MORE_DIRS = ["intlibs/helpers/platforms/#{INTLIB_PLATFORM}",
"intlibs/bluetooth",
"intlibs/demangle",
"intlibs/dll",
"intlibs/gsm_amr",
"intlibs/net",
"intlibs/stabs",
"runtimes/cpp/platforms/sdl",
"runtimes/cpp/platforms/sdl/mosynclib",
"runtimes/cpp/platforms/sdl/MoRE"
]
BASE_DIRS = ADDITIONAL_INTLIBS + MORE_DIRS + PLATFORM_TOOLS
PIPE_DIRS = ["tools/protobuild", "tools/pipe-tool", "tools/DefaultSkinGenerator", "libs"]
EXAM_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"]
class CopyDirWork < Work
def initialize(name)
@NAME = name
end
def setup
builddir = "#{mosyncdir}/#{@NAME}"
@prerequisites = [DirTask.new(self, builddir)]
sources = Dir["#{@NAME}/*"]
@prerequisites |= sources.collect do |src|
CopyFileTask.new(self, FileTask.new(self, "#{builddir}/#{File.basename(src)}"),
FileTask.new(self, src))
end
end
end
SKINS = CopyDirWork.new('skins')
RULES = CopyDirWork.new('rules')
target :base => [SKINS, RULES] do
SKINS.invoke
RULES.invoke
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 :examples => :base do
Work.invoke_subdirs(PIPE_DIRS + EXAM_DIRS)
end
target :all => :default do
Work.invoke_subdirs(EXAM_DIRS)
end
target :more => :base do
Work.invoke_subdirs(MORE_DIRS)
end
target :newlib => :base do
Work.invoke_subdirs(NEWLIB_DIRS)
end
target :libs => :base do
Work.invoke_subdirs(PIPE_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
target :all_configs do
sh 'ruby workfile.rb all'
sh 'ruby workfile.rb all CONFIG='
sh 'ruby workfile.rb all USE_NEWLIB='
sh 'ruby workfile.rb all USE_NEWLIB= CONFIG='
end
target :all_libs do
sh 'ruby workfile.rb libs'
sh 'ruby workfile.rb libs CONFIG='
sh 'ruby workfile.rb libs USE_NEWLIB='
sh 'ruby workfile.rb libs USE_NEWLIB= CONFIG='
end
Targets.invoke