]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Added build scripts
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 24 Sep 2014 02:48:43 +0000 (22:48 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 24 Sep 2014 02:48:43 +0000 (22:48 -0400)
.gitmodules [new file with mode: 0644]
Rakefile
build-system [new submodule]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..22d2a64
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "build-system"]
+       path = build-system
+       url = https://github.com/mikedlowis/build-system.git
index 894833db47e599f2f9e4576a271bba365c5ea003..2be993b9134a7ed1434198d0ea8fe4bb2ab58913 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -1,19 +1,19 @@
-#------------------------------------------------------------------------------
-# Bundler Setup
-#------------------------------------------------------------------------------
-require "bundler"
-begin
-  Bundler.setup(:default, :development)
-rescue Bundler::BundlerError => e
-  raise LoadError.new("Unable to Bundler.setup(): You probably need to run `bundle install`: #{e.message}")
-end
-require 'rscons'
-require 'rbconfig'
+require './build-system/setup'
 
 def windows?
   RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
 end
 
+#------------------------------------------------------------------------------
+# Envrionment Definitions
+#------------------------------------------------------------------------------
+# Define the compiler environment
+BaseEnv = BuildEnv.new(echo: :command) do |env|
+  env.build_dir('source','build/obj/source')
+  env.set_toolset(:clang)
+  env["CFLAGS"] += ['-Wall', '-Wextra' ]#, '-Werror']
+end
+
 #------------------------------------------------------------------------------
 # Clang Toolchain Targets
 #------------------------------------------------------------------------------
@@ -42,33 +42,6 @@ task :clang => ["#{CLANG_BIN_DIR}/#{CLANG_BIN_NAME}"] do
     ENV['PATH'] = "#{CLANG_BIN_DIR}#{windows? ? ';':':'}#{ENV['PATH']}"
 end
 
-#------------------------------------------------------------------------------
-# Envrionment Definitions
-#------------------------------------------------------------------------------
-class Environment < Rscons::Environment
-  @@environments = []
-  def initialize(args,&block)
-    super(args,&block)
-    @@environments << self
-  end
-
-  def self.process_all()
-    @@environments.each {|e| e.process }
-  end
-end
-
-# Process all environments so we actually build the targets
-at_exit { Environment.process_all }
-
-# Define the compiler environment
-BaseEnv = Environment.new(echo: :command) do |env|
-  env.build_dir('source','build/obj/source')
-  env['CC'] = 'clang'
-  env['CXX'] = 'clang'
-  env['LD'] = 'clang'
-  env["CFLAGS"] += ['-Wall', '-Wextra' ]#, '-Werror']
-end
-
 #------------------------------------------------------------------------------
 # Rscons Build Targets
 #------------------------------------------------------------------------------
diff --git a/build-system b/build-system
new file mode 160000 (submodule)
index 0000000..81f2a99
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 81f2a99521abae709ccdeea0640f382908d20b64