From 79c96aa2c1e6021f125170e216c10904d4b60e78 Mon Sep 17 00:00:00 2001 From: devans Date: Mon, 13 May 2013 17:55:07 -0400 Subject: [PATCH] Removed rake build system and associated directories --- APL/rake.project.rb | 23 -- APLTestTools/APLTestTools.vcproj | 344 ---------------- APLTestTools/rake.project.rb | 23 -- APLXML/rake.project.rb | 23 -- DNP3/rake.project.rb | 23 -- DNP3Java/rake.project.rb | 14 - DNP3Test/rake.project.rb | 28 -- DNP3XML/rake.project.rb | 23 -- TeamCitySupport/rake.project.rb | 23 -- Terminal/rake.project.rb | 5 - TerminalTest/rake.project.rb | 7 - TestAPL/rake.project.rb | 27 -- TestSet/rake.project.rb | 25 -- TestSet/tmw_test.rb | 72 ---- XMLBindings/rake.project.rb | 5 - demos/slave-cpp/rake.project.rb | 25 -- {TestSet => docs}/TestSetUserManual.docx | Bin rakefile.rb | 85 ---- tinyxml/rake.project.rb | 5 - tools/rake_build_system/plugins/rake.boost.rb | 47 --- .../plugins/rake.cpp.enviroment.rb | 120 ------ tools/rake_build_system/plugins/rake.cpp.rb | 389 ------------------ .../plugins/rake.crosstest.rb | 35 -- .../rake_build_system/plugins/rake.source.rb | 60 --- .../plugins/rake.swigjava.rb | 83 ---- tools/rake_build_system/rake.environment.rb | 80 ---- 26 files changed, 1594 deletions(-) delete mode 100644 APL/rake.project.rb delete mode 100644 APLTestTools/APLTestTools.vcproj delete mode 100644 APLTestTools/rake.project.rb delete mode 100644 APLXML/rake.project.rb delete mode 100644 DNP3/rake.project.rb delete mode 100755 DNP3Java/rake.project.rb delete mode 100644 DNP3Test/rake.project.rb delete mode 100644 DNP3XML/rake.project.rb delete mode 100644 TeamCitySupport/rake.project.rb delete mode 100755 Terminal/rake.project.rb delete mode 100755 TerminalTest/rake.project.rb delete mode 100644 TestAPL/rake.project.rb delete mode 100644 TestSet/rake.project.rb delete mode 100644 TestSet/tmw_test.rb delete mode 100755 XMLBindings/rake.project.rb delete mode 100755 demos/slave-cpp/rake.project.rb rename {TestSet => docs}/TestSetUserManual.docx (100%) delete mode 100644 rakefile.rb delete mode 100755 tinyxml/rake.project.rb delete mode 100755 tools/rake_build_system/plugins/rake.boost.rb delete mode 100755 tools/rake_build_system/plugins/rake.cpp.enviroment.rb delete mode 100755 tools/rake_build_system/plugins/rake.cpp.rb delete mode 100755 tools/rake_build_system/plugins/rake.crosstest.rb delete mode 100755 tools/rake_build_system/plugins/rake.source.rb delete mode 100755 tools/rake_build_system/plugins/rake.swigjava.rb delete mode 100755 tools/rake_build_system/rake.environment.rb diff --git a/APL/rake.project.rb b/APL/rake.project.rb deleted file mode 100644 index ec1c3766..00000000 --- a/APL/rake.project.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -$options = { -:target => 'libapl.a', -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -} diff --git a/APLTestTools/APLTestTools.vcproj b/APLTestTools/APLTestTools.vcproj deleted file mode 100644 index 934f2c40..00000000 --- a/APLTestTools/APLTestTools.vcproj +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/APLTestTools/rake.project.rb b/APLTestTools/rake.project.rb deleted file mode 100644 index db1cc6d6..00000000 --- a/APLTestTools/rake.project.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -$options = { -:target => 'libapltesttools.a', -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -} diff --git a/APLXML/rake.project.rb b/APLXML/rake.project.rb deleted file mode 100644 index 308490e5..00000000 --- a/APLXML/rake.project.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -$options = { -:target => 'libpsixml.a', -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES] -} diff --git a/DNP3/rake.project.rb b/DNP3/rake.project.rb deleted file mode 100644 index 46d15676..00000000 --- a/DNP3/rake.project.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# -#setup the psi project -$options = { -:target => 'libdnp3.a', -:includes => [Boost::get_includes_dir,DEFAULT_INCLUDES], -} diff --git a/DNP3Java/rake.project.rb b/DNP3Java/rake.project.rb deleted file mode 100755 index cf76c217..00000000 --- a/DNP3Java/rake.project.rb +++ /dev/null @@ -1,14 +0,0 @@ - -$options = { -:allowed_platforms => ['pc_cygwin', 'Linux_i686'], -:target => 'libdnp3java.so', -:cc_release_flags => '-O1 -fPIC', #compiling the swig binding at O2 and above was causing programs to seg fault -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -:link_options => [], -:libs => $PLATFORM_LIBS + Boost::get_static_libs + $WINSOCK_LIBS, -:project_libs => [:dnp3, :apl], -:plugins => ['swigjava'], #swigjava specific options -:java_package => 'org.totalgrid.reef.protocol.dnp3', -:java_outdir => 'src/main/java/org/totalgrid/reef/protocol/dnp3' -} - diff --git a/DNP3Test/rake.project.rb b/DNP3Test/rake.project.rb deleted file mode 100644 index fc2fc49c..00000000 --- a/DNP3Test/rake.project.rb +++ /dev/null @@ -1,28 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# -#setup the dnp3test project -$options = { -:target => 'dnp3test.exe', -:project_libs => [:dnp3, :apltesttools, :apl], -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -:warn_flags => ['-Wno-sign-compare'], -:libs => $PLATFORM_LIBS + Boost::get_static_libs -} - -$options[:project_libs] << :teamcity if($USE_TEAM_CITY) diff --git a/DNP3XML/rake.project.rb b/DNP3XML/rake.project.rb deleted file mode 100644 index 510c1e09..00000000 --- a/DNP3XML/rake.project.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -$options = { -:target => 'libdnp3xml.a', -:includes => [Boost::get_includes_dir,DEFAULT_INCLUDES] -} diff --git a/TeamCitySupport/rake.project.rb b/TeamCitySupport/rake.project.rb deleted file mode 100644 index 39d2b1c0..00000000 --- a/TeamCitySupport/rake.project.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# -#setup the psi project -$options = { -:target => 'libteamcity.a', -:includes => [Boost::get_includes_dir,DEFAULT_INCLUDES], -} diff --git a/Terminal/rake.project.rb b/Terminal/rake.project.rb deleted file mode 100755 index 79d7c2d8..00000000 --- a/Terminal/rake.project.rb +++ /dev/null @@ -1,5 +0,0 @@ - -$options = { -:target => 'libterminal.a', -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES] -} diff --git a/TerminalTest/rake.project.rb b/TerminalTest/rake.project.rb deleted file mode 100755 index 7487c571..00000000 --- a/TerminalTest/rake.project.rb +++ /dev/null @@ -1,7 +0,0 @@ - -$options = { -:target => 'terminaltest.exe', -:project_libs => [:terminal, :apltesttools, :apl], -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -:libs => Boost::get_static_libs + $PLATFORM_LIBS -} diff --git a/TestAPL/rake.project.rb b/TestAPL/rake.project.rb deleted file mode 100644 index 5509a6f7..00000000 --- a/TestAPL/rake.project.rb +++ /dev/null @@ -1,27 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -$options = { -:target => 'testapl.exe', -:project_libs => [:xmlbindings, :tinyxml, :aplxml, :apltesttools, :apl], -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -:warn_flags => ['-Wno-sign-compare'], -:libs => Boost::get_static_libs + $PLATFORM_LIBS -} -$options[:project_libs] << :teamcity if($USE_TEAM_CITY) diff --git a/TestSet/rake.project.rb b/TestSet/rake.project.rb deleted file mode 100644 index eebf702b..00000000 --- a/TestSet/rake.project.rb +++ /dev/null @@ -1,25 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -$options = { -:target => 'testset.exe', -:project_libs => [:terminal, :xmlbindings, :dnp3xml, :dnp3, :tinyxml, :aplxml, :apl], -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -:libs => Boost::get_static_libs + $PLATFORM_LIBS -} diff --git a/TestSet/tmw_test.rb b/TestSet/tmw_test.rb deleted file mode 100644 index aa97aef1..00000000 --- a/TestSet/tmw_test.rb +++ /dev/null @@ -1,72 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -require 'rexml/document' -include REXML - -return -1 unless ARGV.count >= 7 - -s_confirms = ARGV[0] -app_conf_timeout = ARGV[1] -unsol_allowed = ARGV[2] -unsol_retry_period = ARGV[3] -unsol_offline_delay = ARGV[4] -tx_frag_size = ARGV[5] -self_address = ARGV[6] - -test_msg = ARGV[7] if ARGV.count >= 8 -test_msg ||= "" - -#puts "SCONFIRMS: " + s_confirms -#puts "APPCONFTIMEOUT: " + app_conf_timeout -#puts "UNSOLALLOWED: " + unsol_allowed -#puts "UNSOLRETRYPER: " + unsol_retry_period -#puts "UNSOLOFFLINEDELAY: " + unsol_offline_delay -#puts "TXFRAGSIZE: " + tx_frag_size -#puts "SELFADDRESS: " + self_address -#puts "Test: " + test_msg - - -file = File.open("C:\\code\\DNP\\TestSet\\tmw_template.xml") -doc = Document.new file - -doc.elements.each("//LinkLayer") do |link| - link.attributes["UseConfirmations"] = (s_confirms == "always") ? "true" : "false" -end - -doc.elements.each("//AppLayer") do |app| - app.attributes["ConfTimeoutMS"] = app_conf_timeout > unsol_retry_period ? app_conf_timeout : unsol_retry_period - app.attributes["MaxFragmentSize"] = tx_frag_size -end - -doc.elements.each("//UnsolDefaults") do |app| - app.attributes["UnsolEnabled"] = unsol_allowed - #app.attributes["DoClass1"] = unsol_allowed - #app.attributes["DoClass2"] = unsol_allowed - #app.attributes["DoClass3"] = unsol_allowed - app.attributes["RetryMS"] = 0 -end - -filename = "C:/code/DNP/TestSet/temp_slave.xml" -outfile = File.new(filename, "w+") -doc.write outfile -outfile.close - -puts filename - diff --git a/XMLBindings/rake.project.rb b/XMLBindings/rake.project.rb deleted file mode 100755 index 2261bc3a..00000000 --- a/XMLBindings/rake.project.rb +++ /dev/null @@ -1,5 +0,0 @@ - -$options = { -:target => 'libxmlbindings.a', -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES] -} diff --git a/demos/slave-cpp/rake.project.rb b/demos/slave-cpp/rake.project.rb deleted file mode 100755 index afa300f1..00000000 --- a/demos/slave-cpp/rake.project.rb +++ /dev/null @@ -1,25 +0,0 @@ -# -# Licensed to Green Energy Corp (www.greenenergycorp.com) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. Green Enery Corp licenses this file -# to you 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. -# - -$options = { -:target => 'slavedemo.exe', -:project_libs => [:dnp3, :apl], -:includes => [Boost::get_includes_dir, DEFAULT_INCLUDES], -:libs => Boost::get_static_libs + $PLATFORM_LIBS -} diff --git a/TestSet/TestSetUserManual.docx b/docs/TestSetUserManual.docx similarity index 100% rename from TestSet/TestSetUserManual.docx rename to docs/TestSetUserManual.docx diff --git a/rakefile.rb b/rakefile.rb deleted file mode 100644 index b8a60499..00000000 --- a/rakefile.rb +++ /dev/null @@ -1,85 +0,0 @@ - -$: << './tools/rake_build_system' #make sure this rakefile can see all the build system files - -ENV['BOOST_VERSION']='boost_1_47_0' - -require 'rake/clean' -CLOBBER.include('doc') # remove any doxygen-generated files - -require 'rake.environment.rb' # this sets up a slew of environment constants -require 'plugins/rake.cpp.rb' # this provides the facilities for declaring C++ style builds -require 'plugins/rake.boost.rb' # provides location and names of the boost libraries -require 'plugins/rake.swigjava.rb' # provides helpers for creating cpp/java bindings using swig -require 'plugins/rake.source.rb' # provides licensing helpers - -DEFAULT_INCLUDES << __FILE__.pathmap('%d') - -$USE_TEAM_CITY = !ENV['teamcity'].nil? -$DNP3_JAVA = !ENV['java'].nil? - -#format is name => options, :dir is required -$projects = { -:apl => {:dir => 'APL' }, -:testapl => {:dir => 'TestAPL'}, -:apltesttools => {:dir => 'APLTestTools'}, -:dnp3 => {:dir => 'DNP3'}, -:dnp3xml => {:dir => 'DNP3XML'}, -:xmlbindings => {:dir => 'XMLBindings'}, -:dnp3test => {:dir => 'DNP3Test'}, -:testset => {:dir => 'TestSet'}, -:slavedemo => {:dir => 'demos/slave-cpp'}, -:tinyxml => {:dir => 'tinyxml'}, -:aplxml => {:dir => 'APLXML'}, -:terminal => {:dir => 'Terminal'}, -:terminaltest => {:dir => 'TerminalTest'}, -} - -$projects[:dnp3java] = {:dir => 'DNP3Java'} if $DNP3_JAVA -$projects[:teamcity] = {:dir => 'TeamCitySupport'} if $USE_TEAM_CITY - -add_projects($projects) #removes projects that are not valid for $hw_os - -SOURCE_PROJECTS = [:apl, :testapl, :apltesttools, :dnp3, :dnp3test, :dnp3xml, :aplxml, :testset] -SOURCE_DIRS = SOURCE_PROJECTS.collect { |p| $projects[p][:dir] } - -desc 'Generate doxygen html docs for the project' -task :document do - `doxygen ./config/doxygen.config` -end - -desc 'Generate a sloccount report for the project' -task :sloccount do - dirs = SOURCE_DIRS + ['tools/rake_build_system'] - `sloccount --wide --details #{dirs.join(' ')} > sloccount.sc` -end - -desc 'Formats all of the C++ h/cpp files with uncrustify' -task :format do - excludes = ['tinyxml'].collect{|e| "--exclude=#{e}"}.join(" ") - cmd = "astyle --options=config/astyle.cfg #{excludes} -r *.cpp *.h" - puts cmd - `#{cmd}` -end - -namespace :license do - - license_dirs = SOURCE_DIRS << 'External\build_system' - - license_types = { - :cpp => {:exts => ['.cpp','.h'], :comment => '// '}, - :ruby => {:exts => ['.rb'], :comment => '# '}, - } - - extensions = license_types.collect { |k,v| v[:exts] }.join('/') - - desc "add the licensing file to all #{extensions}" - task :add do - license_types.each { |key,options| add_license(license_dirs, options, 'FILE_LICENSE') } - end - - desc "remove the licensing file from all #{extensions}" - task :remove do - license_types.each { |key,options| remove_license(license_dirs, options, 'FILE_LICENSE') } - end - -end diff --git a/tinyxml/rake.project.rb b/tinyxml/rake.project.rb deleted file mode 100755 index 3730c032..00000000 --- a/tinyxml/rake.project.rb +++ /dev/null @@ -1,5 +0,0 @@ -#setup the psi project -$options = { -:target => 'libtinyxml.a', -:includes => [DEFAULT_INCLUDES] -} diff --git a/tools/rake_build_system/plugins/rake.boost.rb b/tools/rake_build_system/plugins/rake.boost.rb deleted file mode 100755 index 128a35aa..00000000 --- a/tools/rake_build_system/plugins/rake.boost.rb +++ /dev/null @@ -1,47 +0,0 @@ - -class Boost - -#names of the various boost libraries -BOOST_SYSTEM_NAME = "boost_system" -BOOST_THREAD_NAME = "boost_thread" -BOOST_DATE_TIME_NAME = "boost_date_time" -BOOST_PROGRAM_OPTIONS_NAME = "boost_program_options" -BOOST_UNIT_TEST_NAME = "boost_unit_test_framework" - -BOOST_LIB_NAMES = [BOOST_SYSTEM_NAME, BOOST_THREAD_NAME, BOOST_DATE_TIME_NAME, BOOST_PROGRAM_OPTIONS_NAME, BOOST_UNIT_TEST_NAME] - -#figure out where the tools directory is -def self.get_tools_home - if ENV['TOOLS_HOME'] - fix_path(ENV['TOOLS_HOME'].gsub(/\\/,'/')) - else - abort 'The TOOLS_HOME environment variable is not set. On windows, set this in Control Panel -> System -> Advanced -> Environment variables. On linux add the following to the end of your ~/.bashrc export TOOLS_HOME=~/tools' - end -end - -def self.get_boost_version - if ENV['BOOST_VERSION'] - ENV['BOOST_VERSION'] - else - abort 'Environment variable BOOST_VERSION must be set in your main rakefile or OS environment. Format is booost_1_xx' - end -end - -def self.get_includes_dir - #puts get_tools_home - "#{get_tools_home}/boostlib/#{get_boost_version}/include".gsub(/\\/,'/') -end - -def self.get_libs_dir - __FILE__.pathmap("#{get_tools_home}/boostlib/#{get_boost_version}/#{$hw_os}") -end - -def self.get_shared_libs - ["-L#{get_libs_dir}"] + BOOST_LIB_NAMES.collect { |lib| "-l#{lib}" } -end - -def self.get_static_libs - BOOST_LIB_NAMES.collect { |lib| "#{get_libs_dir}/lib#{lib}.a" } -end - -end \ No newline at end of file diff --git a/tools/rake_build_system/plugins/rake.cpp.enviroment.rb b/tools/rake_build_system/plugins/rake.cpp.enviroment.rb deleted file mode 100755 index e87f10a7..00000000 --- a/tools/rake_build_system/plugins/rake.cpp.enviroment.rb +++ /dev/null @@ -1,120 +0,0 @@ - -# when buidling for ARM we have to modify PATH to point first to the cross compiler -if ENV['arm'] - ENV['PATH'] = case $hw_os - when 'pc_cygwin' - '/opt/crosstool/gcc-3.3.4-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/bin/:/opt/crosstool/gcc-3.3.4-glibc-2.3.2/arm-unknown-linux-gnu/bin/:' + ENV['PATH'] - when 'Linux_i686' - '/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin:/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/arm-linux/bin:' + ENV['PATH'] - else - puts "Don't know what cross-compiler to use for #{$hw_os}" - Process.exit(1) - end - $hw_os = 'pc_linux_arm' -end - -# defaults for compiler, archiver, and indexer -$CC = ENV['ccache'] ? 'ccache g++' : 'g++' - -$AR = 'ar cruv' -$RANLIB = 'ranlib' -$LD = 'ld' - -COMPILER_VERSION = case $hw_os - when 'pc_cygwin' - '-gcc34' - when 'Linux_i686' - '-gcc41' - when 'pc_linux_arm' - '-gcc33' -end - -#common to all platforms -preprocessor = ['BOOST_ASIO_ENABLE_CANCELIO', 'BOOST_REGEX_NO_LIB'] - -preprocessor = case $hw_os - when 'pc_cygwin' - ['_WIN32_WINNT=0x0501', '__USE_W32_SOCKETS'] - when 'pc_linux_arm' - ['ARM','BOOST_ASIO_DISABLE_EPOLL'] - else [] -end - -if ENV['PREPROCESSOR'] - preprocessor << ENV['PREPROCESSOR'] -end - -$CC_PREPROCESSOR = preprocessor.collect { |d| "-D#{d}"}.join(' ') - -$WINSOCK_LIBS = case $hw_os - when 'pc_cygwin' - ['/lib/w32api/libwsock32.a','/lib/w32api/libws2_32.a'] - else - [] -end - -def get_release_cc_flags - case $hw_os - when 'pc_linux_arm' - ['-O3'] - when 'pc_cygwin' - ['-O3'] - else - ['-O3 -fpic'] - end -end - -def get_debug_cc_flags - case $hw_os - when 'pc_linux_arm' - [] - else - ['-g -fpic'] - end -end - -def get_coverage_cc_flags - case $hw_os - when 'pc_linux_arm' - [] - else - ['-g -fPIC -O0 -fprofile-arcs -ftest-coverage -DNDEBUG -DPSI_LOGALL'] - end -end - -#By default, the build is set to debug -$WARN_FLAGS = ['-Wall', '-Wno-strict-aliasing'] -$RELEASE_TYPE = ENV['debug'] ? 'debug' : (ENV['coverage'] ? 'coverage' : 'release') -$CC_FLAGS = case $RELEASE_TYPE - when 'release' - get_release_cc_flags() - when 'debug' - get_debug_cc_flags() - when 'coverage' - get_coverage_cc_flags() - else - puts "Unknown $RELEASE_TYPE = #{$RELEASE_TYPE}" - Process.exit 1 -end - -$OBJ_DIR = "#{$hw_os}/#{$RELEASE_TYPE}" - -$PLATFORM_LIBS = case $hw_os - when 'pc_cygwin' - ['-lpthread'] - when 'Linux_i686' - ['-lpthread'] - when 'pc_linux_arm' - ['-lpthread'] - else - [] -end - -RUBY_INC = case $hw_os - when 'pc_cygwin' - '/lib/ruby/1.8/i386-cygwin' - when 'Linux_i686' - '/usr/lib/ruby/1.8/i486-linux/' -end - -$PLATFORM_LIBS << '-lgcov' if $RELEASE_TYPE == 'coverage' diff --git a/tools/rake_build_system/plugins/rake.cpp.rb b/tools/rake_build_system/plugins/rake.cpp.rb deleted file mode 100755 index c9859a98..00000000 --- a/tools/rake_build_system/plugins/rake.cpp.rb +++ /dev/null @@ -1,389 +0,0 @@ -#Helpers related to C++ development -require File.join(File.dirname(__FILE__), 'rake.cpp.enviroment') - -# extract all dependencies from a dependency file, returning an array of dependencies for object file -# corresponding to the input dep file -def dependencies(path) - deps = [] - open(path) do |file| - deps = file.read.scan(/ [^\s|\\]+/).collect { |s| s.strip } - end - deps.reject!{|s| s.include?("/opt") || s.include?("/usr") || s.include?("include/boost")} - deps -end - -def filtered_dependencies(path) - deps = dependencies(path) - deps.reject!{|f| !File.exists? f} - deps -end - -#turn an array of path incldues into a string suitable for g++ -def include_string(arr) - arr.map{ |s| "-I#{s}" }.join(' ') -end - -def make_dep_file(source, dep_file, includes) - inc = include_string(includes) - sh "g++ -M #{source} #{inc} #{$CC_PREPROCESSOR} > #{dep_file}" -end - -def make_obj_file(source, obj_file, includes, cc_flags, warn_flags) - inc = include_string(includes) - warn = warn_flags.join(' ') - cmd = "#{$CC} #{cc_flags} #{warn} -c -o #{obj_file} #{source} #{inc} #{$CC_PREPROCESSOR}" - puts "compiling #{source} with #{$CC} #{cc_flags} #{warn} #{$CC_PREPROCESSOR}" - sh cmd -end - -def make_library(lib, obj) - puts "Creating archive: #{lib}" - sh "#{$AR} #{lib} #{obj}" - puts "Indexing archive: #{lib}" - sh "#{$RANLIB} #{lib}" -end - -def make_shared_library(lib, obj, link_options, libs) - puts "Creating shared library: #{lib}" - sh "#{$CC} -shared -o #{lib} #{obj} #{link_options.join(' ')} #{libs.join(' ')}" -end - -def make_executable(exe,obj,libs) - puts "Linking: #{exe}" - libtool_prefix = "libtool --mode=link " - libtool_prefix = "" if $hw_os == 'pc_linux_arm' - cc = $CC.gsub('ccache ','') - sh "#{libtool_prefix}#{cc} #{obj.join(' ')} #{libs.join(' ')} -o #{exe}" -end - - - -def add_cpp_based_target(name, options) - - namespace name do - - target_name = options[:target] #the target file that we are creating for this project, (.a, .exe, etc) - - includes = options[:includes].flatten # these already are paths - includes << options[:dir] #the project directory should always be explicitly on the include path - - includes.each do |path| - unless File.directory? path - puts "In project #{name}, include directory does not exist: #{path}" - end - end - - excludes = options[:cppexcludes] || [] #some source files may be excluded from the build - - # override the source extension for cpp using the :src_ext option - src_ext = - if options[:src_ext] - options[:src_ext] - else - '.cpp' - end - - dir = options[:dir] - obj_dir = "#{dir}/#{$OBJ_DIR}" #directory where the objects, dep files, and libraries go - target = "#{obj_dir}/#{target_name}" #full path the the target - - src_list = FileList["#{dir}/**/*#{src_ext}"].reject { |f| excludes.include? f.pathmap('%f') } - - # the project may have a way to create dyanmic source code from other dependencies - if options[:dynamic_src] - options[:dynamic_src].each do |f| - src_list << f unless src_list.include? f - end - end - - #create a map from source to object files - obj_to_src = src_list.inject({}) do |sum, src| - sum.merge! src.pathmap("#{obj_dir}/%f").ext('.o') => src - end - - directory obj_dir # task for directory - file target => obj_dir #the library depends on the obj directory being created - - cc_flags = (ENV['debug'] || options[:cc_release_flags].nil?) ? $CC_FLAGS : options[:cc_release_flags] - - warn_flags = [] - warn_flags.concat($WARN_FLAGS) - warn_flags.concat(options[:warn_flags]) if options[:warn_flags] - - #explicitly declare dependencies between .o and source files - obj_to_src.each do |obj, src| - dep_file = obj.ext('dep') - file obj => src do |t| - make_dep_file src, dep_file, includes - make_obj_file src, t.name, includes, cc_flags, warn_flags - end - end - - desc 'Remove and regenerate dependency files' - task :updatedep do - `rm #{obj_dir}/*.dep` - obj_to_src.each do |obj, src| - puts "Generating dependencies for #{source}" - make_dep_file src, obj.ext('.dep'), includes - end - end - - task :build => :dependencies - - task :dependencies => src_list do - print "loading existing dependencies for #{name}... " - obj_to_src.keys.each do |obj| - dep = obj.ext('.dep') - file obj => filtered_dependencies(dep) if File.exists? dep - end - puts 'done.' - end - - # should generate the rule for building the target - yield target, obj_to_src, includes - - desc "Build and archive the #{name} library" - task :build => target - - desc "Clobber the #{name} project" - task :clobber do |t| - puts "clobber1: rm -R -f #{obj_dir}" - sh "rm -R -f #{obj_dir}" - end - - desc "Copy the target" - task :copytarget, [:dest, :name, :sudo] => target do |task, args| - cmd = "cp #{target} #{args[:dest]}/#{args[:name]}" - cmd = "sudo " + cmd if args[:sudo] - sh "#{cmd}" - end - - desc "Run remote tests" - task [:testremote, :host, :user, :passwd, :xml] => target do |task, args| - #require here so that we don't blow up w/o net-ssh/openssl - require File.join(File.dirname(__FILE__), 'rake.crosstest.rb') - CrossTest::do_test_sequence(args[:host], args[:user], args[:passwd], target, args[:xml]) - end - - end #end namespace -end #end method - -def add_static_lib(name, options) - - add_cpp_based_target(name, options) do |target, obj_to_src, includes| - - file target => obj_to_src.keys do |t| #rule for making the target - make_library target, obj_to_src.keys.join(' ') - end - - end - -end #end method - -def add_shared_lib(name, options) - - dep_libs = get_dep_libs(name, options) - - link_options = [] - link_options = options[:link_options] if options[:link_options] - - add_cpp_based_target(name, options) do |target, obj_to_src, includes| - file target => dep_libs - dep_libs += options[:libs] if options[:libs] - file target => obj_to_src.keys do |t| #rule for making the target - make_shared_library target, obj_to_src.keys.join(' '), link_options, dep_libs - end - end - -end #end method - -def get_dep_libs(name, options) - - if options[:project_libs] - options[:project_libs].collect do |l| - proj = $projects[l] - if $projects[l] - "#{$projects[l][:dir]}/#{$OBJ_DIR}/#{$projects[l][:target]}" - else - puts "Unknown dependency #{l} in #{name}" - exit -1 - end - end - end -end - -def add_executable(name, options) - - dep_libs = get_dep_libs(name, options) - - add_cpp_based_target(name, options) do |target, obj_to_src, includes| - - file target => dep_libs #force a relink if a lib changes - task :build => options[:project_libs].collect { |libname| "#{libname}:build" } #force a load of the dependencies for the sub-libraries - - task :run => :build - - desc 'runs the executable with optional cmd line arguments' - task :run, [:cmdline] => target do |task, args| - puts "#{target} #{args[:cmdline] ? args[:cmdline] : ''}" - sh "#{target} #{args[:cmdline] ? args[:cmdline] : ''}" - run_coverage( name, options) if $RELEASE_TYPE == 'coverage' - end - - desc 'blindly run the executable -- no build dependency' - task :runblind, [:cmdline] => target do |task, args| - puts "#{target} #{args[:cmdline] ? args[:cmdline] : ''}" - sh "#{target} #{args[:cmdline] ? args[:cmdline] : ''}" - run_coverage( name, options) if $RELEASE_TYPE == 'coverage' - end - - file target => obj_to_src.keys do |t| - make_executable target, obj_to_src.keys, (dep_libs + options[:libs] + $WINSOCK_LIBS) - end - - end - -end - -# Generate code coverage results. -def run_coverage( name, options) - dep_dirs = options[:project_libs].collect{ |lib| $projects[lib][:dir] + "/#{$hw_os}/#{$RELEASE_TYPE}" } - lcov_dir = "#{$projects[name][:dir]}/#{$hw_os}/#{$RELEASE_TYPE}" - lcov_out = "#{lcov_dir}/lcov.out" - if ENV['LCOV_HTML'] - lcov_html = ENV['LCOV_HTML'] + "/#{lcov_dir}" - sh "mkdir -p #{lcov_html}" - else - lcov_html = "#{lcov_dir}/html" - end - - puts "lcov -d #{$projects[name][:dir]}/#{$hw_os}/#{$RELEASE_TYPE} #{dep_dirs.collect{|x| ' -d '+x}} -b #{Dir.pwd} -c -o #{lcov_out}" - sh "lcov -d #{$projects[name][:dir]}/#{$hw_os}/#{$RELEASE_TYPE} #{dep_dirs.collect{|x| ' -d '+x}} -b #{Dir.pwd} -c -o #{lcov_out}" - - Dir.mkdir(lcov_html) unless File.directory? lcov_html - puts "genhtml -o #{lcov_html} #{lcov_out}" - sh "genhtml -o #{lcov_html} #{lcov_out}" - - puts "\nHTML coverage results are at:\n#{lcov_html}/index.html" - - # Add a symbolic link for gcov. Bitten will pass "coverage" as the prefix. - dir = $projects[name][:dir] - link = "#{$RELEASE_TYPE}-#{dir}" - sh "ln -s #{dir}/#{$hw_os}/#{$RELEASE_TYPE} #{link}" unless File.exists? link - # Add symbolic links for dependencies (for gcov again). - dep_dirs = options[:project_libs].each do |lib| - dir = $projects[lib][:dir] - link = "#{$RELEASE_TYPE}-#{dir}" - sh "ln -s #{dir}/#{$hw_os}/#{$RELEASE_TYPE} #{link}" unless File.exists? link - end - -end - - -def create_header_only_distribution(name, options) - - namespace name do - - task :collect_headers do - options[:headers].each do |project, files| - - # we need to recreate the right directories so the includes obj_dir - task :collect_libs => options[:project_libs].collect{|l| "#{l}:build"} - task :collect_libs do - # go and collect the static libraries from the other projects - options[:project_libs].each do |l| - sh "cp #{$projects[l][:dir]}/#{$OBJ_DIR}/#{$projects[l][:target]} #{obj_dir}" - end - # copy the static libraries but ignore the dynamic ones (Ex: -lpthread) - options[:libs].reject{|l| l =~ /^-[lL]/}.each do |l| - sh "cp #{l} #{obj_dir}" - end - end - - task :build => :collect_libs - - task :run_pre_package_commands => [:collect_headers] do - Dir.chdir(options[:dir]) do - options[:pre_package_commands].each do |command_hash| - command_hash.each do |command, args| - # if the command is a symbol and a project name we replace it with that projects target exe name - command = "#{$OBJ_DIR}/#{$projects[command][:target]}" if command.is_a?(Symbol) and $projects[command] - sh "#{command} #{args}" - end - end - end - end - - desc "Make a package of the headers and libraries for distribution" - task :package => [:build, :run_pre_package_commands] do - Dir.chdir(options[:dir]) do - sh "tar -czvf #{options[:target]} #{options[:files_to_package].join(' ')}" - end - end - - desc "Clobber the #{name} project" - task :clobber do |t| - puts "clobber2: rm -R -f #{obj_dir}" - sh "rm -R -f #{obj_dir}" - end - - end -end #end method - - -def add_cpp_dependecies(name, options) - case options[:target] - when /\.tar\.gz/ - create_header_only_distribution name, options - when /\.a$/ - add_static_lib name, options - when /\.exe$/ - add_executable name, options - when /\.so$/ - add_shared_lib name, options - end -end - -def add_global_cpp_tasks - - desc 'Creates all libraries and executables' - task :default => $projects.collect { |name, opt| "#{name}:build" } - - desc 'Updates all C++ dependencies' - task :updatedep => ($projects.collect { |name, opt| "#{name}:updatedep" }) - - desc 'Clobbers all of the build targets' - task :clobber => $projects.collect { |name, opt| "#{name}:clobber" } - -end - - -$build_lambdas << lambda { |name, options| add_cpp_dependecies(name,options) } -$post_build_lambdas << lambda { add_global_cpp_tasks } diff --git a/tools/rake_build_system/plugins/rake.crosstest.rb b/tools/rake_build_system/plugins/rake.crosstest.rb deleted file mode 100755 index 4b33f037..00000000 --- a/tools/rake_build_system/plugins/rake.crosstest.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'net/ftp' -require 'net/ssh' - -module CrossTest - - def self.put(host, user, passwd, file) - ftp = Net::FTP.new(host, user, passwd) - STDOUT.sync = true - ftp.putbinaryfile(file) { |block| print '*' } - ftp.close - end - - def self.get(host, user, passwd, remote_file, local_file) - ftp = Net::FTP.new(host, user, passwd) - STDOUT.sync = true - ftp.getbinaryfile(remote_file, local_file) { |block| print '*' } - ftp.close - end - - def self.run_tests(host, user, passwd, file) - Net::SSH.start(host, user, :password => passwd) do |ssh| - ssh.exec! "rm report.xml" - ssh.exec! "chmod +x #{file}" - ssh.exec! "./#{file} --output_format=XML --log_level=all --report_level=no > report.xml" - ssh.exec! "rm #{file}" - end - end - - def self.do_test_sequence(host, user, passwd, file, testfile) - self.put(host, user, passwd, file) - self.run_tests(host, user, passwd, File.basename(file)) - self.get(host, user, passwd, 'report.xml', testfile) - end - -end \ No newline at end of file diff --git a/tools/rake_build_system/plugins/rake.source.rb b/tools/rake_build_system/plugins/rake.source.rb deleted file mode 100755 index 0001ac6b..00000000 --- a/tools/rake_build_system/plugins/rake.source.rb +++ /dev/null @@ -1,60 +0,0 @@ - -def get_files_to_process(root, extensions) - files = [] - extensions.each do |ext| - files.concat(FileList["#{root}/**/*#{ext}"]) - end - files -end - -def get_license_text(license, comment) - license_text = File.foreach(license).collect do |line| - comment + line - end.join -end - -def add_license(dirs, options, license) - - files = dirs.inject([]) do |sum,dir| - sum += get_files_to_process(dir, options[:exts]) - end - - puts "adding #{license} from the #{files.size} files matching #{options[:exts].join(', ')}" - - license_text = get_license_text(license, options[:comment]) - - first_line = license_text.lines.first - - files.each do |h| - txt = File.open(h).read - next if txt.index(first_line) == 0 - f = File.open("#{h}.tmp", 'w') - f.write license_text - f.write txt - f.close - FileUtils.rm(h) - FileUtils.mv("#{h}.tmp",h) - end -end - -def remove_license(dirs, options, license) - - files = dirs.inject([]) do |sum,dir| - sum += get_files_to_process(dir, options[:exts]) - end - - puts "removing #{license} from the #{files.size} files matching #{options[:exts].join(', ')}" - - license_text = get_license_text(license, options[:comment]) - license_size = license_text.size - - files.each do |h| - txt = File.open(h).read - next if txt.index(license_text) != 0 - f = File.open("#{h}.tmp", 'w') - f.write txt[license_size..-1] - f.close - FileUtils.rm(h) - FileUtils.mv("#{h}.tmp",h) - end -end diff --git a/tools/rake_build_system/plugins/rake.swigjava.rb b/tools/rake_build_system/plugins/rake.swigjava.rb deleted file mode 100755 index b6d8653e..00000000 --- a/tools/rake_build_system/plugins/rake.swigjava.rb +++ /dev/null @@ -1,83 +0,0 @@ - - -jdk_home = if ENV['JDK_HOME'] - ENV['JDK_HOME'] -elsif ENV['JAVA_HOME'] - ENV['JAVA_HOME'] -else - nil -end - -unless jdk_home and File.directory? jdk_home - puts 'To use the swig-java plugin, the JDK_HOME or JAVA_HOME environment variables must be set to your JDK directory, comment out the "require \'plugins/swigjava.rb\'" line in rakefile.rb to supress this message.' -else - jdk_home = File.expand_path jdk_home #this will normailze to linux slashes in case we're using an ENV var from windows - $jdk_home = jdk_home - - puts "Using jdk directory #{$jdk_home}" - - platform = case $hw_os #need this to get the correct directory for some of the jni includes - when 'pc_cygwin' - 'win32' - else - 'linux' - end - - jdk_includes = ["#{jdk_home}/include","#{jdk_home}/include/#{platform}"] - - def add_swig_java_dependencies(name, options) - - includes = options[:includes].flatten # these already are paths - includes << options[:dir] #the project directory should always be explicitly on the include path - - package = if options[:java_package] - "-package #{options[:java_package]}" - else - '' - end - - outdir = if options[:java_outdir] - dir = "#{options[:dir]}/#{options[:java_outdir]}" - directory dir #create the directory - dir - else - nil - end - - generated_sources = get_generated_swig_java_cpp(options[:dir]) - generated_sources.each do |cppfile| - ifile = cppfile.ext('.i') - file cppfile => outdir if outdir - outdirective = '' - outdirective = "-outdir #{outdir}" if outdir - file cppfile => ifile do |t| - # we need to add this define that gcc normally adds if we are on 64bit - declares_necessary = [] - declares_necessary << '__x86_64__' if `uname -m`.strip == 'x86_64' - declares = declares_necessary.collect{|d|"-D#{d}"}.join(' ') - puts "creating swig cpp/java binding from #{ifile} (#{declares})" - sh "swig -c++ -java #{package} #{include_string(includes)} #{outdirective} #{declares} -o #{cppfile} #{ifile}" - end - end - generated_sources - end - - def get_generated_swig_java_cpp(dir) - FileList["#{dir}/*.i"].ext('.cpp') - end - - $pre_build_lambdas << lambda do |name, options| - if options[:plugins] and (options[:plugins].include? 'swigjava') - options[:includes] ||= [] - options[:includes] += jdk_includes # add the jdk includes so that they are seen by both swig and C++ - options[:dynamic_src] ||= [] - options[:dynamic_src] += get_generated_swig_java_cpp options[:dir] - end - end - - $build_lambdas << lambda do |name, options| - if options[:plugins] and (options[:plugins].include? 'swigjava') - add_swig_java_dependencies(name, options) - end - end -end diff --git a/tools/rake_build_system/rake.environment.rb b/tools/rake_build_system/rake.environment.rb deleted file mode 100755 index c17b2b9c..00000000 --- a/tools/rake_build_system/rake.environment.rb +++ /dev/null @@ -1,80 +0,0 @@ - -if ENV['SH_VERBOSE'] #set on command line with SH_VERBOSE=true to see all subcommands - verbose(true) -else - verbose(false) -end - -# first thing to do is figure out the platform we're on -$hw_os = case RUBY_PLATFORM.strip - when /linux/ - # we don't actually care if we are building for i686 or x86_64 - #`uname -sm`.strip.gsub(/\s/,'_') - # TODO: replace Linux_i686 with just linux in rest of build system - 'Linux_i686' - when /cygwin/ - 'pc_cygwin' - else - RUBY_PLATFORM -end - - -def fix_path(path) - case $hw_os - when 'pc_cygwin' - # need to strip off line ending from cygpath - `cygpath #{path}`.strip - when 'Linux_i686' - path - else - path - end -end - -def add_projects(projects) - - #get the additional options from the project files - projects.each do |name, options| - $options = nil #expect that the require statement sets this variable - require "#{options[:dir]}/rake.project.rb" - unless $options - puts "Require for #{name} did not set the $options variable" - Process.exit 1 - end - options.merge! $options - options[:target_path] = "#{options[:dir]}/#{$OBJ_DIR}" - end - - - #Do a final pass to configure the projects now that all the options are in place - projects.each do |name, options| - - if platform_ok options - - $pre_build_lambdas.each { |lam| lam.call(name, options) } # give any plugin's pre-builds the chance to add information to options - $build_lambdas.each { |lam| lam.call(name, options) } # call all the plugin's build functions - - else - - puts "Ignoring project #{name} for platform #{$hw_os}" - projects.delete name - end - end - - $post_build_lambdas.each { |lam| lam.call } - -end - -def platform_ok(options) - if options[:allowed_platforms] - options[:allowed_platforms].include? $hw_os - else - true - end -end - -DEFAULT_INCLUDES = [] - -$pre_build_lambdas = [] -$build_lambdas = [] -$post_build_lambdas = []