This repository has been archived by the owner on Apr 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.root.xml
196 lines (180 loc) · 8.27 KB
/
build.root.xml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2013 Cheolmin Jo (webos21@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<project name="xi.root" default="usage" basedir=".">
<!-- ==================== PREPARE ================== -->
<!-- PREPARE : Environment -->
<target name="_prepare.env">
<property environment="env" />
</target>
<!-- PREPARE : Check Environment -->
<target name="_prepare.antcfg" depends="_prepare.env">
<condition property="ant_cfg_issetTarget">
<isset property="ant_cfg_target" />
</condition>
<condition property="ant_cfg_isWin">
<os family="windows" />
</condition>
<condition property="ant_cfg_isOSX">
<and>
<os family="mac" />
<os family="unix" />
</and>
</condition>
<condition property="ant_cfg_isXnix">
<and>
<os family="unix" />
<not>
<os family="mac" />
</not>
</and>
</condition>
<dirname property="test_java_home" file="${java.home}" />
<property name="build_tool_javac" value="${test_java_home}/bin/javac" />
</target>
<!-- PREPARE : Load Properties -->
<!-- you can define additional properties in [build_target.mk]!!! -->
<target name="_prepare.load.def" depends="_prepare.antcfg">
<property file="${basedir}/buildx/antmk/project.mk" />
<property file="${basedir}/buildx/antmk/java.mk" />
</target>
<target name="_prepare.load.buildprop" depends="_prepare.load.def" if="ant_cfg_issetTarget">
<echo>Load the request properties - [${basedir}/buildx/antmk/build_${ant_cfg_target}.mk]</echo>
<property file="${basedir}/buildx/antmk/build_${ant_cfg_target}.mk" />
</target>
<target name="_prepare.load.defprop" depends="_prepare.load.def" unless="ant_cfg_issetTarget">
<echo>Load the default properties - [${basedir}/buildx/antmk/build_${project_def_target}.mk]</echo>
<property file="${basedir}/buildx/antmk/build_${project_def_target}.mk" />
<property name="ant_cfg_target" value="${project_def_target}" />
<property name="ant_cfg_issetTarget" value="true" />
</target>
<target name="_prepare.load" depends="_prepare.load.buildprop, _prepare.load.defprop" />
<!-- PREPARE : Check Properties -->
<target name="_prepare.check.runnable" depends="_prepare.load">
<condition property="ant_cfg_isRunnable">
<or>
<!-- Xnix can build [linux32,linux64,android,bcm7403,smp8654] -->
<and>
<contains string="linux32,linux64,android,bcm7403,smp8654" substring="${build_cfg_target}" />
<and>
<os family="unix" />
<not>
<os family="mac" />
</not>
</and>
</and>
<!-- OSX can build [osx32,osx64] -->
<and>
<contains string="osx32,osx64" substring="${build_cfg_target}" />
<and>
<os family="unix" />
<os family="mac" />
</and>
</and>
<!-- Windows can build [mingw32,mingw64] -->
<and>
<contains string="mingw32,mingw64,win32,win64" substring="${build_cfg_target}" />
<os family="windows" />
</and>
</or>
</condition>
</target>
<target name="_prepare.check.fail" depends="_prepare.check.runnable" unless="ant_cfg_isRunnable">
<echo>Your OS is [${os.name}] and you request ${build_cfg_target}!!!</echo>
<echo>Cannot proceed the building!!!</echo>
<fail message="Cannot build!!!!!" />
</target>
<target name="_prepare.check" depends="_prepare.check.runnable, _prepare.check.fail" />
<!-- PREPARE : Make Directories -->
<target name="_prepare.mkdir" depends="_prepare.check">
<mkdir dir="${basedir}/ant" />
<mkdir dir="${basedir}/ant/${build_cfg_target}" />
</target>
<!-- PREPARE : Display prepared values -->
<target name="_prepare.result" depends="_prepare.mkdir">
<echo>======================= ${project_name} - Build Plan ========================</echo>
<echo>os.name : ${os.name}</echo>
<echo>os.arch : ${os.arch}</echo>
<echo>----------------------------------------------------------------</echo>
<echo>ant.home : ${env.ANT_HOME}</echo>
<echo>ant.file : ${ant.file}</echo>
<echo>----------------------------------------------------------------</echo>
<echo>project_version : ${project_version}</echo>
<echo>----------------------------------------------------------------</echo>
<echo>build_cfg_target : ${build_cfg_target}</echo>
<echo>build_dir_target : ${basedir}/ant/${build_cfg_target}</echo>
<echo>----------------------------------------------------------------</echo>
<echo>build_tool_javac : ${build_tool_javac}</echo>
<echo>build_tool_cc : ${build_tool_cc}</echo>
<echo>build_tool_cxx : ${build_tool_cxx}</echo>
<echo>build_tool_linker : ${build_tool_linker}</echo>
<echo>build_tool_ar : ${build_tool_ar}</echo>
<echo>build_tool_ranlib : ${build_tool_ranlib}</echo>
<echo>----------------------------------------------------------------</echo>
<echo>build_opt_a_pre : ${build_opt_a_pre}</echo>
<echo>build_opt_a_ext : ${build_opt_a_ext}</echo>
<echo>build_opt_so_pre : ${build_opt_so_pre}</echo>
<echo>build_opt_so_ext : ${build_opt_so_ext}</echo>
<echo>build_opt_exe_ext : ${build_opt_exe_ext}</echo>
<echo>----------------------------------------------------------------</echo>
<echo>build_opt_c : ${build_opt_c}</echo>
<echo>build_opt_cxx : ${build_opt_cxx}</echo>
<echo>build_opt_fPIC : ${build_opt_fPIC}</echo>
<echo>build_opt_ld : ${build_opt_ld}</echo>
<echo>build_opt_ld_so : ${build_opt_ld_so}</echo>
<echo>build_opt_ld_rpath : ${build_opt_ld_rpath}</echo>
<echo>build_opt_ld_noud : ${build_opt_ld_noud}</echo>
<echo>build_opt_ld_mgwcc : ${build_opt_ld_mgwcc}</echo>
<echo>build_opt_ld_mgwcx : ${build_opt_ld_mgwcx}</echo>
<echo>================================================================</echo>
</target>
<target name="_prepare" depends="_prepare.result" />
<!-- ==================== ENTRY ================== -->
<!-- START : default entry point -->
<target name="usage">
<echo>==================== USAGE =====================</echo>
<echo>* You can choose binary types</echo>
<echo> in belows : </echo>
<echo> - binary type : linux, macosx, mingw, bcm7403, smp8654</echo>
<echo>---------------------------------------------</echo>
<echo>* So, actual commands are like these : </echo>
<echo> - ant linux32 : build all modules for linux 32bit</echo>
<echo> - ant linux64 : build all modules for linux 64bit</echo>
<echo> - ant osx32 : build all modules for osx 32bit</echo>
<echo> - ant osx64 : build all modules for osx 64bit</echo>
<echo> - ant mingw32 : build all modules for mingw 32bit</echo>
<echo> - ant mingw64 : build all modules for mingw 64bit</echo>
<echo> - ant android : build all modules for android</echo>
<echo> - ant bcm7403 : build all modules for bcm7403</echo>
<echo> - ant smp8654 : build all modules for smp8654</echo>
<echo>================================================</echo>
</target>
<!-- xbionic -->
<target name="xbionic.build" depends="_prepare">
<echo>xbionic.build</echo>
<subant antfile="xbionic/build.xml" inheritall="true" buildpath="${basedir}" />
</target>
<target name="xbionic.clean" depends="_prepare">
<echo>xbionic.clean</echo>
<subant antfile="xbionic/build.xml" target="clean" inheritall="true" buildpath="${basedir}" />
</target>
<!-- All -->
<target name="all" depends="xbionic.build" />
<!-- CLEAN : delete top build and test files -->
<target name="clean" depends="_prepare">
<delete dir="${basedir}/ant/${build_cfg_target}" />
</target>
</project>