Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d60a5f0d01 | |||
| ac0f6087fc | |||
| f2a56f1c61 | |||
| c8a4accd12 | |||
| 7771d4c038 | |||
| d11981d4b2 | |||
| c3121f17cf | |||
| 2a9ccc2346 | |||
| 679c013eaa | |||
| 7189a04299 | |||
| 9e94493531 | |||
| 1e5f1043d5 | |||
| 9d14cc7eb0 | |||
| d255c7f46e | |||
| fc17a14008 | |||
| dbd764749b | |||
| b1b94595f6 | |||
| 55dc22db05 | |||
| 67fa432750 | |||
| 1b3e459ada | |||
| 125ab4c171 |
38
.github/workflows/run-tests.yml
vendored
38
.github/workflows/run-tests.yml
vendored
@ -1,38 +0,0 @@
|
|||||||
name: Run RScons Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
ruby-version: ['2.7', '3.0', '3.4']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Install dependencies (Linux)
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: sudo apt-get update && sudo apt-get install -y gcc gdc ldc clang flex bison
|
|
||||||
|
|
||||||
- name: Install dependencies (macOS)
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: brew install gcc ldc flex bison
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby
|
|
||||||
uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bundle install
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: rake all
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,5 +7,5 @@
|
|||||||
/gen/
|
/gen/
|
||||||
/large_project/
|
/large_project/
|
||||||
/pkg/
|
/pkg/
|
||||||
/test_run/
|
/test/
|
||||||
/yard/
|
/yard/
|
||||||
|
|||||||
75
CHANGELOG.md
75
CHANGELOG.md
@ -1,76 +1,3 @@
|
|||||||
## v3.3.0
|
|
||||||
|
|
||||||
### New Features
|
|
||||||
|
|
||||||
- Add support for Ruby 3.4.
|
|
||||||
- Fix up some macOS test cases.
|
|
||||||
- #177 - Remove dependency on base64
|
|
||||||
- #175 - Add support for building object files from LLVM assembly sources
|
|
||||||
|
|
||||||
## v3.2.0
|
|
||||||
|
|
||||||
### New Features
|
|
||||||
|
|
||||||
- #171 - Place object files next to source files for source files in build directory
|
|
||||||
- #170 - Use top-level build directory as environment build directory for unnamed environments
|
|
||||||
- #167 - Add upgrading instructions
|
|
||||||
- #166 - Replace CFile builder with Yacc and Lex builders
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- #172 - Fix configuration checks performed with ldc2 compiler
|
|
||||||
- #169 - Output a better error when pkg-config is not found
|
|
||||||
- #168 - Cannot output binary to an environment's build root with the same name as the top-level source directory
|
|
||||||
- #164 - Improve DSL method documentation
|
|
||||||
|
|
||||||
## v3.1.0
|
|
||||||
|
|
||||||
### New Features
|
|
||||||
|
|
||||||
- #162 - Improve configuration error messages
|
|
||||||
- #163 - Ruby 3.2 compatibility
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- #161 - builder registered during build hooks should increase build step count
|
|
||||||
|
|
||||||
## v3.0.2
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- #159 - Compiler check configure methods should respect :use flag
|
|
||||||
- #160 - Configure parameters should not be stored as unscoped construction variables
|
|
||||||
|
|
||||||
## v3.0.1
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- #156 - Avoid running configure operation twice
|
|
||||||
- #157 - Load configure task arguments before early configure operations
|
|
||||||
- #158 - Do not configure for clean tasks when not yet configured
|
|
||||||
|
|
||||||
## v3.0.0
|
|
||||||
|
|
||||||
- #136 - Move rsconscache into build directory
|
|
||||||
- #140 - Support naming environments
|
|
||||||
- #143 - Add Size builder
|
|
||||||
- #142 - Add 'sh' script DSL method
|
|
||||||
- #144 - Add FileUtils class methods to script DSL
|
|
||||||
- #145 - Support environment variable to set rscons build directory
|
|
||||||
- #146 - Add ^^/ shortcut to top-level build directory
|
|
||||||
- #139 - Add tasks
|
|
||||||
- #147 - Add task options
|
|
||||||
- #148 - Add license/copyright to distributable script
|
|
||||||
- #150 - Add env.expand() shortcut method to expand paths and construction variables
|
|
||||||
- #152 - Add download script method
|
|
||||||
- #153 - Allow passing spawn options to sh
|
|
||||||
- #154 - Record build directory absolute path
|
|
||||||
- #149 - Add shortcut method for creating environments
|
|
||||||
- #131 - Only configure if necessary
|
|
||||||
- #151 - Store configure task parameters in configuration cache data
|
|
||||||
- #137 - Add variants
|
|
||||||
- #155 - Add build_dir script method
|
|
||||||
|
|
||||||
## v2.3.0
|
## v2.3.0
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
@ -80,7 +7,7 @@
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
- #121 - env.depends() does not work with build-root-relative "^/" paths
|
- #121 - env.depends() does not work with built-root-relative "^/" paths
|
||||||
- #130 - Document -f command line option
|
- #130 - Document -f command line option
|
||||||
- #133 - Clarify failed command error message indicating to run -F
|
- #133 - Clarify failed command error message indicating to run -F
|
||||||
- #134 - Document CMD_STDOUT variable for Command builder
|
- #134 - Document CMD_STDOUT variable for Command builder
|
||||||
|
|||||||
@ -9,6 +9,6 @@ To run the rscons specs, the following commands must be available:
|
|||||||
* g++
|
* g++
|
||||||
* clang++
|
* clang++
|
||||||
* gdc
|
* gdc
|
||||||
* ldc2
|
* ldc
|
||||||
* flex
|
* flex
|
||||||
* bison
|
* bison
|
||||||
|
|||||||
4
Gemfile
4
Gemfile
@ -1,10 +1,8 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
gem "base64"
|
|
||||||
gem "rspec"
|
gem "rspec"
|
||||||
gem "rake"
|
gem "rake"
|
||||||
gem "simplecov"
|
gem "simplecov", "~> 0.15.0"
|
||||||
gem "openssl"
|
|
||||||
if RbConfig::CONFIG["host"]["msys"]
|
if RbConfig::CONFIG["host"]["msys"]
|
||||||
gem "json", "2.1.0"
|
gem "json", "2.1.0"
|
||||||
else
|
else
|
||||||
|
|||||||
65
Gemfile.lock
65
Gemfile.lock
@ -1,61 +1,46 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
base64 (0.3.0)
|
diff-lcs (1.4.4)
|
||||||
date (3.5.1)
|
docile (1.1.5)
|
||||||
diff-lcs (1.6.2)
|
json (2.5.1)
|
||||||
docile (1.4.1)
|
rake (13.0.6)
|
||||||
erb (6.0.1)
|
rdoc (6.3.2)
|
||||||
json (2.18.0)
|
redcarpet (3.5.1)
|
||||||
openssl (4.0.0)
|
rspec (3.10.0)
|
||||||
psych (5.3.1)
|
rspec-core (~> 3.10.0)
|
||||||
date
|
rspec-expectations (~> 3.10.0)
|
||||||
stringio
|
rspec-mocks (~> 3.10.0)
|
||||||
rake (13.3.1)
|
rspec-core (3.10.1)
|
||||||
rdoc (7.1.0)
|
rspec-support (~> 3.10.0)
|
||||||
erb
|
rspec-expectations (3.10.1)
|
||||||
psych (>= 4.0.0)
|
|
||||||
tsort
|
|
||||||
redcarpet (3.6.1)
|
|
||||||
rspec (3.13.2)
|
|
||||||
rspec-core (~> 3.13.0)
|
|
||||||
rspec-expectations (~> 3.13.0)
|
|
||||||
rspec-mocks (~> 3.13.0)
|
|
||||||
rspec-core (3.13.6)
|
|
||||||
rspec-support (~> 3.13.0)
|
|
||||||
rspec-expectations (3.13.5)
|
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.10.0)
|
||||||
rspec-mocks (3.13.7)
|
rspec-mocks (3.10.2)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.10.0)
|
||||||
rspec-support (3.13.6)
|
rspec-support (3.10.2)
|
||||||
simplecov (0.22.0)
|
simplecov (0.15.1)
|
||||||
docile (~> 1.1)
|
docile (~> 1.1.0)
|
||||||
simplecov-html (~> 0.11)
|
json (>= 1.8, < 3)
|
||||||
simplecov_json_formatter (~> 0.1)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.13.2)
|
simplecov-html (0.10.2)
|
||||||
simplecov_json_formatter (0.1.4)
|
|
||||||
stringio (3.2.0)
|
|
||||||
syntax (1.2.2)
|
syntax (1.2.2)
|
||||||
tsort (0.2.0)
|
yard (0.9.26)
|
||||||
yard (0.9.38)
|
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
x86-mingw32
|
x86-mingw32
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
base64
|
|
||||||
json
|
json
|
||||||
openssl
|
|
||||||
rake
|
rake
|
||||||
rdoc
|
rdoc
|
||||||
redcarpet
|
redcarpet
|
||||||
rspec
|
rspec
|
||||||
simplecov
|
simplecov (~> 0.15.0)
|
||||||
syntax
|
syntax
|
||||||
yard
|
yard
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.6.2
|
2.1.4
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2013-2025 Josh Holtrop
|
Copyright (c) 2013-2019 Josh Holtrop
|
||||||
|
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
|
|||||||
34
README.md
34
README.md
@ -4,39 +4,7 @@
|
|||||||
|
|
||||||
Rscons (https://github.com/holtrop/rscons) is an open-source build system
|
Rscons (https://github.com/holtrop/rscons) is an open-source build system
|
||||||
for developers.
|
for developers.
|
||||||
It supports the following features:
|
|
||||||
|
|
||||||
* multi-threaded job execution
|
Rscons is written in Ruby, and is inspired by [SCons](https://scons.org/) and [waf](https://waf.io/).
|
||||||
* auto-configuration
|
|
||||||
* built-in builders for several common operations
|
|
||||||
* out-of-the-box support for Assembly, C, C++, D, and LLVM
|
|
||||||
* extensibility for other languages or custom builders
|
|
||||||
* compatible with Windows, Linux, OS X, and FreeBSD
|
|
||||||
* colorized output with build progress
|
|
||||||
* build hooks
|
|
||||||
* user-defined tasks with dependencies and custom parameters
|
|
||||||
* build variants
|
|
||||||
|
|
||||||
At its core, Rscons is mainly an engine to:
|
|
||||||
|
|
||||||
* determine the proper order to perform build steps,
|
|
||||||
* determine whether each build target is up to date or in need of rebuild, and
|
|
||||||
* schedule those build steps across multiple threads as efficiently as possible.
|
|
||||||
|
|
||||||
Along the way, Rscons provides a concise syntax for specifying common types of
|
|
||||||
build steps, but also provides an extensible framework for performing
|
|
||||||
custom build operations as well.
|
|
||||||
|
|
||||||
Rscons takes inspiration from:
|
|
||||||
|
|
||||||
* [SCons](https://scons.org/)
|
|
||||||
* [waf](https://waf.io/)
|
|
||||||
* [rake](https://github.com/ruby/rake)
|
|
||||||
* [CMake](https://cmake.org/)
|
|
||||||
* [Autoconf](https://www.gnu.org/software/autoconf/)
|
|
||||||
|
|
||||||
Rscons is written in Ruby.
|
|
||||||
The only requirement to run Rscons is that the system has a Ruby interpreter
|
|
||||||
installed.
|
|
||||||
|
|
||||||
See [https://holtrop.github.io/rscons/index.html](https://holtrop.github.io/rscons/index.html) for User Guide and Installation instructions.
|
See [https://holtrop.github.io/rscons/index.html](https://holtrop.github.io/rscons/index.html) for User Guide and Installation instructions.
|
||||||
|
|||||||
39
Rakefile.rb
39
Rakefile.rb
@ -8,10 +8,8 @@ end
|
|||||||
require "rspec/core/rake_task"
|
require "rspec/core/rake_task"
|
||||||
require "rake/clean"
|
require "rake/clean"
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
require "simplecov"
|
|
||||||
require "stringio"
|
|
||||||
|
|
||||||
CLEAN.include %w[build_test_run .yardoc yard coverage test_run]
|
CLEAN.include %w[build_test_run .yardoc yard coverage test]
|
||||||
CLOBBER.include %w[dist gen large_project pkg]
|
CLOBBER.include %w[dist gen large_project pkg]
|
||||||
|
|
||||||
task :build_dist do
|
task :build_dist do
|
||||||
@ -21,43 +19,24 @@ end
|
|||||||
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
||||||
ENV["specs"] = "1"
|
ENV["specs"] = "1"
|
||||||
if args.example_string
|
if args.example_string
|
||||||
|
ENV["partial_specs"] = "1"
|
||||||
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
task :spec => :build_dist
|
||||||
task :spec do
|
task :spec do
|
||||||
ENV.delete("specs")
|
ENV.delete("specs")
|
||||||
end
|
end
|
||||||
task :spec => :build_tests
|
|
||||||
task :spec do
|
|
||||||
unless ENV["rscons_dist_specs"]
|
|
||||||
original_stdout = $stdout
|
|
||||||
sio = StringIO.new
|
|
||||||
$stdout = sio
|
|
||||||
SimpleCov.collate Dir["coverage/.resultset.json", "coverage/bt*/.resultset.json"]
|
|
||||||
$stdout = original_stdout
|
|
||||||
sio.string.lines.each do |line|
|
|
||||||
$stdout.write(line) unless line =~ /Coverage report generated for/
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
task :build_tests do |task, args|
|
|
||||||
ENV["specs"] = "1"
|
|
||||||
sh "ruby -Ilib build_tests/build_tests.rb"
|
|
||||||
ENV.delete("specs")
|
|
||||||
end
|
|
||||||
|
|
||||||
# dspec task is useful to test the distributable release script, but is not
|
# dspec task is useful to test the distributable release script, but is not
|
||||||
# useful for coverage information.
|
# useful for coverage information.
|
||||||
desc "Dist Specs"
|
desc "Dist Specs"
|
||||||
task :dspec, [:example_string] => :build_dist do |task, args|
|
task :dspec, [:example_string] => :build_dist do |task, args|
|
||||||
FileUtils.rm_rf("test_run")
|
FileUtils.mkdir_p("test")
|
||||||
FileUtils.mkdir_p("test_run")
|
FileUtils.cp("dist/rscons", "test/rscons.rb")
|
||||||
FileUtils.cp("dist/rscons", "test_run/rscons.rb")
|
ENV["dist_specs"] = "1"
|
||||||
ENV["rscons_dist_specs"] = "1"
|
Rake::Task["spec"].execute(args.example_string)
|
||||||
Rake::Task["spec"].execute(args)
|
ENV.delete("dist_specs")
|
||||||
Rake::Task["build_tests"].execute(args)
|
|
||||||
ENV.delete("rscons_dist_specs")
|
|
||||||
FileUtils.rm_f(Dir.glob(".rscons-*"))
|
FileUtils.rm_f(Dir.glob(".rscons-*"))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -97,7 +76,7 @@ task :gen_large_project, [:size] => :build_dist do |task, args|
|
|||||||
end
|
end
|
||||||
File.open("large_project/Rsconscript", "w") do |fh|
|
File.open("large_project/Rsconscript", "w") do |fh|
|
||||||
fh.puts <<EOF
|
fh.puts <<EOF
|
||||||
default do
|
build do
|
||||||
Environment.new do |env|
|
Environment.new do |env|
|
||||||
env.Program("project", glob("src/*.c"))
|
env.Program("project", glob("src/*.c"))
|
||||||
end
|
end
|
||||||
|
|||||||
10
UPGRADING.md
10
UPGRADING.md
@ -1,10 +0,0 @@
|
|||||||
# Upgrading
|
|
||||||
|
|
||||||
## v3.2.0
|
|
||||||
|
|
||||||
- Replace any calls to `env.CFile()` builder with `env.Lex()` or `env.Yacc()` as required.
|
|
||||||
|
|
||||||
## v3.0.0
|
|
||||||
|
|
||||||
- Move `build` block contents outside of `build` block and remove `build` call.
|
|
||||||
- Replace `Environment.new()` calls with `env()`.
|
|
||||||
File diff suppressed because it is too large
Load Diff
6
build_tests/cfile/Rsconscript
Normal file
6
build_tests/cfile/Rsconscript
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
|
env.CFile("lexer.c", "lexer.l")
|
||||||
|
env.CFile("parser.c", "parser.y")
|
||||||
|
end
|
||||||
|
end
|
||||||
5
build_tests/cfile/error_unknown_extension.rb
Normal file
5
build_tests/cfile/error_unknown_extension.rb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
|
env.CFile("file.c", "foo.bar")
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,10 +1,12 @@
|
|||||||
debug = env("dbg", echo: :command) do |env|
|
default do
|
||||||
|
debug = Environment.new(echo: :command) do |env|
|
||||||
env['CFLAGS'] = '-O2'
|
env['CFLAGS'] = '-O2'
|
||||||
env['CPPFLAGS'] = '-DSTRING="Debug Version"'
|
env['CPPFLAGS'] = '-DSTRING="Debug Version"'
|
||||||
env.Program('program-debug.exe', Dir['src/*.c'])
|
env.Program('program-debug.exe', Dir['src/*.c'])
|
||||||
end
|
end
|
||||||
|
|
||||||
release = debug.clone("rls") do |env|
|
release = debug.clone do |env|
|
||||||
env["CPPFLAGS"] = '-DSTRING="Release Version"'
|
env["CPPFLAGS"] = '-DSTRING="Release Version"'
|
||||||
env.Program('program-release.exe', Dir['src/*.c'])
|
env.Program('program-release.exe', Dir['src/*.c'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env1 = env("e1", echo: :command) do |env|
|
default do
|
||||||
|
env1 = Environment.new(echo: :command) do |env|
|
||||||
env['CFLAGS'] = '-O2'
|
env['CFLAGS'] = '-O2'
|
||||||
env.add_build_hook do |builder|
|
env.add_build_hook do |builder|
|
||||||
builder.vars['CPPFLAGS'] = '-DSTRING="Hello"'
|
builder.vars['CPPFLAGS'] = '-DSTRING="Hello"'
|
||||||
@ -9,6 +10,7 @@ env1 = env("e1", echo: :command) do |env|
|
|||||||
env.Program('program.exe', Dir['src/*.c'])
|
env.Program('program.exe', Dir['src/*.c'])
|
||||||
end
|
end
|
||||||
|
|
||||||
env2 = env1.clone("e2") do |env|
|
env2 = env1.clone do |env|
|
||||||
env.Program('program2.exe', Dir['src/*.c'])
|
env.Program('program2.exe', Dir['src/*.c'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
autoconf false
|
autoconf false
|
||||||
env do |env|
|
Environment.new do |env|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -3,6 +3,8 @@ configure do
|
|||||||
check_c_header "stdio.h"
|
check_c_header "stdio.h"
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Program("simple.exe", "simple.c")
|
env.Program("simple.exe", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_c_compiler "clang"
|
|
||||||
end
|
|
||||||
env do |env|
|
|
||||||
env.Program("simple.exe", "simple.c")
|
|
||||||
end
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_c_compiler "clang", use: "clang"
|
|
||||||
check_c_compiler
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t1" do |env|
|
|
||||||
env.Program("test_gcc.exe", "simple.c")
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t2", use: "clang" do |env|
|
|
||||||
env.Program("test_clang.exe", "simple.c")
|
|
||||||
end
|
|
||||||
@ -3,6 +3,8 @@ configure do
|
|||||||
check_c_header "frobulous.h", check_cpppath: ["./usr2"]
|
check_c_header "frobulous.h", check_cpppath: ["./usr2"]
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Object("test.o", "test.c")
|
env.Object("test.o", "test.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,6 +2,8 @@ configure do
|
|||||||
check_c_header "not___found.h", set_define: "HAVE_NOT___FOUND_H"
|
check_c_header "not___found.h", set_define: "HAVE_NOT___FOUND_H"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Object("simple.o", "simple.c")
|
env.Object("simple.o", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,6 +2,8 @@ configure do
|
|||||||
check_c_header "string.h", set_define: "HAVE_STRING_H"
|
check_c_header "string.h", set_define: "HAVE_STRING_H"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Object("simple.o", "simple.c")
|
env.Object("simple.o", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,6 +2,8 @@ configure do
|
|||||||
check_cfg program: "my-config"
|
check_cfg program: "my-config"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Program("myconfigtest", "simple.c")
|
env.Program("myconfigtest", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
ENV["PATH"] = ""
|
|
||||||
|
|
||||||
configure do
|
|
||||||
check_cfg package: "mypackage"
|
|
||||||
end
|
|
||||||
@ -2,6 +2,8 @@ configure do
|
|||||||
check_cfg package: "mypackage"
|
check_cfg package: "mypackage"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Program("myconfigtest", "simple.c")
|
env.Program("myconfigtest", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,12 +2,14 @@ configure do
|
|||||||
check_cfg package: "mypackage", use: "myp"
|
check_cfg package: "mypackage", use: "myp"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Copy("myconfigtest1.c", "simple.c")
|
env.Copy("myconfigtest1.c", "simple.c")
|
||||||
env.Program("myconfigtest1.exe", "myconfigtest1.c")
|
env.Program("myconfigtest1.exe", "myconfigtest1.c")
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command, use: "myp") do |env|
|
Environment.new(echo: :command, use: "myp") do |env|
|
||||||
env.Copy("myconfigtest2.c", "simple.c")
|
env.Copy("myconfigtest2.c", "simple.c")
|
||||||
env.Program("myconfigtest2.exe", "myconfigtest2.c")
|
env.Program("myconfigtest2.exe", "myconfigtest2.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_cxx_compiler "clang++", use: "clang"
|
|
||||||
check_cxx_compiler
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t1" do |env|
|
|
||||||
env.Program("test_gcc.exe", "simple.cc")
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t2", use: "clang" do |env|
|
|
||||||
env.Program("test_clang.exe", "simple.cc")
|
|
||||||
end
|
|
||||||
@ -3,6 +3,8 @@ configure do
|
|||||||
check_cxx_header "frobulous.h", check_cpppath: ["./usr2"]
|
check_cxx_header "frobulous.h", check_cpppath: ["./usr2"]
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Object("test.o", "test.cc")
|
env.Object("test.o", "test.cc")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
configure do
|
configure do
|
||||||
check_d_compiler "gdc", "ldc2", "ldc"
|
check_d_compiler "gdc", "ldc2"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_d_compiler "ldc2", use: "ldc2"
|
|
||||||
check_d_compiler
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t1" do |env|
|
|
||||||
env.Program("test_gcc.exe", "simple.d")
|
|
||||||
end
|
|
||||||
|
|
||||||
env "t2", use: "ldc2" do |env|
|
|
||||||
env.Program("test_ldc2.exe", "simple.d")
|
|
||||||
end
|
|
||||||
@ -4,6 +4,8 @@ configure do
|
|||||||
check_d_import "frobulous", check_d_import_path: ["./usr2"]
|
check_d_import "frobulous", check_d_import_path: ["./usr2"]
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Object("test.o", "test.d")
|
env.Object("test.o", "test.d")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Library("usr2/libfrobulous.a", "two.c")
|
env.Library("usr2/libfrobulous.a", "two.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -3,6 +3,8 @@ configure do
|
|||||||
check_lib "frobulous", check_libpath: ["./usr2"]
|
check_lib "frobulous", check_libpath: ["./usr2"]
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Program("simple.exe", "simple.c")
|
env.Program("simple.exe", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,6 +2,8 @@ configure do
|
|||||||
check_lib "m"
|
check_lib "m"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Program("simple.exe", "simple.c")
|
env.Program("simple.exe", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,12 +2,14 @@ configure do
|
|||||||
check_lib "m", use: :m
|
check_lib "m", use: :m
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Copy("test1.c", "simple.c")
|
env.Copy("test1.c", "simple.c")
|
||||||
env.Program("test2.exe", "test1.c")
|
env.Program("test2.exe", "test1.c")
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command, use: %w[m]) do |env|
|
Environment.new(echo: :command, use: %w[m]) do |env|
|
||||||
env.Copy("test2.c", "simple.c")
|
env.Copy("test2.c", "simple.c")
|
||||||
env.Program("test2.exe", "test2.c")
|
env.Program("test2.exe", "test2.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,7 +2,9 @@ configure do
|
|||||||
check_lib "m", use: false
|
check_lib "m", use: false
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Copy("test1.c", "simple.c")
|
env.Copy("test1.c", "simple.c")
|
||||||
env.Program("test2.exe", "test1.c")
|
env.Program("test2.exe", "test1.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_d_compiler "ldc2"
|
|
||||||
check_lib "z"
|
|
||||||
end
|
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
|
||||||
env.Program("simple.exe", "simple.d")
|
|
||||||
end
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_c_compiler
|
|
||||||
end
|
|
||||||
env do |env|
|
|
||||||
puts "Prefix is #{Task["configure"]["prefix"]}"
|
|
||||||
end
|
|
||||||
@ -23,6 +23,8 @@ configure do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
puts env["CPPDEFINES"]
|
puts env["CPPDEFINES"]
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -3,6 +3,8 @@ configure do
|
|||||||
check_c_header "stdio.h", set_define: "HAVE_STDIO_H"
|
check_c_header "stdio.h", set_define: "HAVE_STDIO_H"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Object("simple.o", "simple.c")
|
env.Object("simple.o", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
default do
|
|
||||||
puts "default"
|
|
||||||
end
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
std::cout << "Hi" << std::endl;
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
import std.stdio;
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
writeln("Hello");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@ -9,8 +9,10 @@ EOF
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(MySource)
|
env.add_builder(MySource)
|
||||||
env.MySource('inc.h', [])
|
env.MySource('inc.h', [])
|
||||||
env.Program('program.exe', Dir['*.c'])
|
env.Program('program.exe', Dir['*.c'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Command("inc.c",
|
env.Command("inc.c",
|
||||||
[],
|
[],
|
||||||
"CMD" => %w[ruby gen.rb ${_TARGET}],
|
"CMD" => %w[ruby gen.rb ${_TARGET}],
|
||||||
@ -9,3 +10,4 @@ env do |env|
|
|||||||
env.build_after("program.o", "${inc_c}")
|
env.build_after("program.o", "${inc_c}")
|
||||||
env.Program("program.exe", ["program.o", "inc.c"])
|
env.Program("program.exe", ["program.o", "inc.c"])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -9,10 +9,12 @@ EOF
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env = env do |env|
|
default do
|
||||||
|
env = Environment.new do |env|
|
||||||
env["hdr"] = "inc.h"
|
env["hdr"] = "inc.h"
|
||||||
env["src"] = "program.c"
|
env["src"] = "program.c"
|
||||||
env.add_builder(MySource)
|
env.add_builder(MySource)
|
||||||
env.MySource('${hdr}')
|
env.MySource('${hdr}')
|
||||||
env.Program('program.exe', "${src}")
|
env.Program('program.exe', "${src}")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -9,7 +9,8 @@ EOF
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
e1 = env do |env|
|
default do
|
||||||
|
e1 = Environment.new do |env|
|
||||||
env.add_builder(MySource)
|
env.add_builder(MySource)
|
||||||
env["one"] = "5"
|
env["one"] = "5"
|
||||||
env[:cfg] = {val: "9"}
|
env[:cfg] = {val: "9"}
|
||||||
@ -26,3 +27,4 @@ e1.clone do |env|
|
|||||||
env.MySource('inc.h', [])
|
env.MySource('inc.h', [])
|
||||||
env.Program('program.exe', Dir['*.c'])
|
env.Program('program.exe', Dir['*.c'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(:MyBuilder) do |options|
|
env.add_builder(:MyBuilder) do |options|
|
||||||
"hi"
|
"hi"
|
||||||
end
|
end
|
||||||
env.MyBuilder("foo")
|
env.MyBuilder("foo")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(:MyBuilder) do |options|
|
env.add_builder(:MyBuilder) do |options|
|
||||||
wait_for(1)
|
wait_for(1)
|
||||||
end
|
end
|
||||||
env.MyBuilder("foo")
|
env.MyBuilder("foo")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -12,8 +12,10 @@ class CHGen < Rscons::Builder
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(CHGen)
|
env.add_builder(CHGen)
|
||||||
env.CHGen("inc.c", ["program.c"])
|
env.CHGen("inc.c", ["program.c"])
|
||||||
env.Program("program.exe", %w[program.c inc.c])
|
env.Program("program.exe", %w[program.c inc.c])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["build_root"] = env.build_root
|
env["build_root"] = env.build_root
|
||||||
env["inc_h"] = "inc.h"
|
env["inc_h"] = "inc.h"
|
||||||
|
|
||||||
@ -13,3 +14,4 @@ env do |env|
|
|||||||
"CMD_DESC" => "Generating")
|
"CMD_DESC" => "Generating")
|
||||||
inc_c.produces("inc.h")
|
inc_c.produces("inc.h")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["build_root"] = env.build_root
|
env["build_root"] = env.build_root
|
||||||
env["inc_h"] = "inc.h"
|
env["inc_h"] = "inc.h"
|
||||||
|
|
||||||
@ -13,3 +14,4 @@ env do |env|
|
|||||||
"CMD_DESC" => "Generating")
|
"CMD_DESC" => "Generating")
|
||||||
env.produces("inc.c", "inc.h")
|
env.produces("inc.c", "inc.h")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -13,7 +13,9 @@ class MyBuilder < Rscons::Builder
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(MyBuilder)
|
env.add_builder(MyBuilder)
|
||||||
env.MyBuilder("foo")
|
env.MyBuilder("foo")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,6 +2,8 @@ configure do
|
|||||||
check_d_compiler "gdc"
|
check_d_compiler "gdc"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Program("hello-d.exe", glob("*.d"))
|
env.Program("hello-d.exe", glob("*.d"))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -2,6 +2,8 @@ configure do
|
|||||||
check_d_compiler "ldc2"
|
check_d_compiler "ldc2"
|
||||||
end
|
end
|
||||||
|
|
||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Program("hello-d.exe", glob("*.d"))
|
env.Program("hello-d.exe", glob("*.d"))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
env.Object("main.o", "main.d")
|
env.Object("main.o", "main.d")
|
||||||
env.Object("mod.o", "mod.d")
|
env.Object("mod.o", "mod.d")
|
||||||
env.Program("hello-d.exe", ["main.o", "mod.o"])
|
env.Program("hello-d.exe", ["main.o", "mod.o"])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Program("test.exe", glob("*.c"), direct: true)
|
env.Program("test.exe", glob("*.c"), direct: true)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
lib = env.SharedLibrary("mylib", ["two.c", "three.c"], direct: true)
|
lib = env.SharedLibrary("mylib", ["two.c", "three.c"], direct: true)
|
||||||
program = env.Program("test.exe", "main.c", "LIBS" => ["mylib"], "LIBPATH" => ["."])
|
program = env.Program("test.exe", "main.c", "LIBS" => ["mylib"], "LIBPATH" => ["."])
|
||||||
env.depends(program, lib)
|
env.depends(program, lib)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Program('header.exe', Dir['*.c'])
|
env.Program('header.exe', Dir['*.c'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
env.add_builder(:JsonToYaml) do |params|
|
env.add_builder(:JsonToYaml) do |params|
|
||||||
@ -14,3 +15,4 @@ env do |env|
|
|||||||
end
|
end
|
||||||
env.JsonToYaml('foo.yml', 'foo.json')
|
env.JsonToYaml('foo.yml', 'foo.json')
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
env do |env|
|
|
||||||
env.Lex("lexer.c", "lexer.l")
|
|
||||||
env.Yacc("parser.c", "parser.y")
|
|
||||||
end
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
env(echo: :command) do |env|
|
default do
|
||||||
env["LIBS"] << "mylib"
|
Environment.new(echo: :command) do |env|
|
||||||
env["LIBPATH"] << "."
|
env.Program('library.exe', ['lib.a', 'three.c'])
|
||||||
env.Program("library.exe", "one.c")
|
env.Library("lib.a", ['one.c', 'two.c'], 'CPPFLAGS' => ['-Dmake_lib'])
|
||||||
env.depends("library.exe", "libmylib.a")
|
end
|
||||||
env.Library("libmylib.a", ["two.c", "three.c"], "CPPFLAGS" => ["-Dmake_lib"])
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Program("library.exe", ["lib.a", "three.c"])
|
env.Program("library.exe", ["lib.a", "three.c"])
|
||||||
env.Object("two.o", "two.c")
|
env.Object("two.o", "two.c")
|
||||||
env.Library("lib.a", ["one.c", "two.o"], 'CPPFLAGS' => ['-Dmake_lib'])
|
env.Library("lib.a", ["one.c", "two.o"], 'CPPFLAGS' => ['-Dmake_lib'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,11 +1,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void two();
|
#ifdef make_lib
|
||||||
void three();
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
two();
|
|
||||||
printf("Library\n");
|
printf("Library\n");
|
||||||
three();
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
env(echo: :command) do |env|
|
default do
|
||||||
env["ARCMD"] = %w[ar rc ${_TARGET} ${_SOURCES}]
|
Environment.new(echo: :command) do |env|
|
||||||
|
env["ARCMD"] = %w[ar rcf ${_TARGET} ${_SOURCES}]
|
||||||
env.Library("lib.a", glob("*.c"))
|
env.Library("lib.a", glob("*.c"))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
void three(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
void two(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
env do |env|
|
|
||||||
env["LLVMAS_FLAGS"] += %w[-Wno-override-module]
|
|
||||||
env.Program("llvmtest.exe", %w[main.c one.ll])
|
|
||||||
end
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
configure do
|
|
||||||
check_c_compiler "clang"
|
|
||||||
end
|
|
||||||
|
|
||||||
env do |env|
|
|
||||||
env["LLVMAS_FLAGS"] += %w[-Wno-override-module]
|
|
||||||
env.Program("llvmtest.exe", %w[one.ll two.ll main2.c], direct: true)
|
|
||||||
end
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
extern int one(void);
|
|
||||||
|
|
||||||
int main(int argc, char * argv[])
|
|
||||||
{
|
|
||||||
return one();
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
extern int one(void);
|
|
||||||
extern int two(void);
|
|
||||||
|
|
||||||
int main(int argc, char * argv[])
|
|
||||||
{
|
|
||||||
one();
|
|
||||||
two();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
@str = private unnamed_addr constant [12 x i8] c"hello world\00"
|
|
||||||
|
|
||||||
declare i32 @puts(ptr nocapture) nounwind
|
|
||||||
|
|
||||||
define i32 @one()
|
|
||||||
{
|
|
||||||
call i32 @puts(ptr @str)
|
|
||||||
ret i32 0
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
@str = private unnamed_addr constant [12 x i8] c"hello again\00"
|
|
||||||
|
|
||||||
declare i32 @puts(ptr nocapture) nounwind
|
|
||||||
|
|
||||||
define i32 @two()
|
|
||||||
{
|
|
||||||
call i32 @puts(ptr @str)
|
|
||||||
ret i32 0
|
|
||||||
}
|
|
||||||
@ -1,3 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Program("foo.exe", glob("*.cc", "*.c"))
|
env.Program("foo.exe", glob("*.cc", "*.c"))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Preprocess("pp", "foo.h")
|
env.Preprocess("pp", "foo.h")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["CPPPATH"] << "src/lib"
|
env["CPPPATH"] << "src/lib"
|
||||||
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
|
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
|
||||||
env.Program("test-shared.exe",
|
env.Program("test-shared.exe",
|
||||||
@ -9,3 +10,4 @@ env do |env|
|
|||||||
env.Program("test-static.exe",
|
env.Program("test-static.exe",
|
||||||
glob("src/**/*.c"))
|
glob("src/**/*.c"))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
File.open("foo.xyz", "wb") do |fh|
|
File.open("foo.xyz", "wb") do |fh|
|
||||||
fh.puts("hi")
|
fh.puts("hi")
|
||||||
end
|
end
|
||||||
env.SharedObject("foo.o", "foo.xyz")
|
env.SharedObject("foo.o", "foo.xyz")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["CPPPATH"] << "src/lib"
|
env["CPPPATH"] << "src/lib"
|
||||||
env.Object("file.S", "src/lib/one.c", "CFLAGS" => env["CFLAGS"] + ["-S"])
|
env.Object("file.S", "src/lib/one.c", "CFLAGS" => env["CFLAGS"] + ["-S"])
|
||||||
libmine = env.SharedLibrary("mine", "file.S")
|
libmine = env.SharedLibrary("mine", "file.S")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["CPPPATH"] << "src/lib"
|
env["CPPPATH"] << "src/lib"
|
||||||
libmine = env.SharedLibrary("mine", glob("src/lib/*.cc"))
|
libmine = env.SharedLibrary("mine", glob("src/lib/*.cc"))
|
||||||
env.Program("test-shared.exe",
|
env.Program("test-shared.exe",
|
||||||
@ -9,3 +10,4 @@ env do |env|
|
|||||||
env.Program("test-static.exe",
|
env.Program("test-static.exe",
|
||||||
glob("src/**/*.cc"))
|
glob("src/**/*.cc"))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["CPPPATH"] << "src/lib"
|
env["CPPPATH"] << "src/lib"
|
||||||
libmine = env.SharedLibrary("mine", glob("src/lib/*.d"))
|
libmine = env.SharedLibrary("mine", glob("src/lib/*.d"))
|
||||||
env.Program("test-shared.exe",
|
env.Program("test-shared.exe",
|
||||||
@ -7,3 +8,4 @@ env do |env|
|
|||||||
"LIBS" => %w[mine])
|
"LIBS" => %w[mine])
|
||||||
env.build_after("test-shared.exe", libmine)
|
env.build_after("test-shared.exe", libmine)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["CPPPATH"] << "src/lib"
|
env["CPPPATH"] << "src/lib"
|
||||||
env.SharedObject("one.o", "src/lib/one.c")
|
env.SharedObject("one.o", "src/lib/one.c")
|
||||||
libmine = env.SharedLibrary("mine", ["one.o", "src/lib/two.c"])
|
libmine = env.SharedLibrary("mine", ["one.o", "src/lib/two.c"])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["CPPPATH"] << "src/lib"
|
env["CPPPATH"] << "src/lib"
|
||||||
env["SHLD"] = "gcc"
|
env["SHLD"] = "gcc"
|
||||||
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
|
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
|
||||||
@ -10,3 +11,4 @@ env do |env|
|
|||||||
env.Program("test-static.exe",
|
env.Program("test-static.exe",
|
||||||
glob("src/**/*.c"))
|
glob("src/**/*.c"))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Program('simple.exe', Dir['*.c'])
|
env.Program('simple.exe', Dir['*.c'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
class B < Builder
|
|
||||||
def run(*args)
|
|
||||||
puts @target
|
|
||||||
true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
env do |env|
|
|
||||||
env.add_builder(B)
|
|
||||||
env.B("one", File.expand_path("two"))
|
|
||||||
env.B("two")
|
|
||||||
env.B("three")
|
|
||||||
env.depends("two", File.expand_path("three"))
|
|
||||||
end
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
env(echo: :command) do |env|
|
default do
|
||||||
|
Environment.new(echo: :command) do |env|
|
||||||
tempdir = ENV["TEMP"] || ENV["TMP"] || "/tmp"
|
tempdir = ENV["TEMP"] || ENV["TMP"] || "/tmp"
|
||||||
source_file = File.join(tempdir, "abs.c")
|
source_file = File.join(tempdir, "abs.c")
|
||||||
File.open(source_file, "w") do |fh|
|
File.open(source_file, "w") do |fh|
|
||||||
@ -11,3 +12,4 @@ env(echo: :command) do |env|
|
|||||||
end
|
end
|
||||||
env.Program("abs.exe", source_file)
|
env.Program("abs.exe", source_file)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -10,7 +10,8 @@ class ThreadedTestBuilder < Rscons::Builder
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(ThreadedTestBuilder)
|
env.add_builder(ThreadedTestBuilder)
|
||||||
env.ThreadedTestBuilder("T3", [], "delay" => 3)
|
env.ThreadedTestBuilder("T3", [], "delay" => 3)
|
||||||
env.ThreadedTestBuilder("T2", [], "delay" => 1.0)
|
env.ThreadedTestBuilder("T2", [], "delay" => 1.0)
|
||||||
@ -20,3 +21,4 @@ env do |env|
|
|||||||
env.ThreadedTestBuilder("T5", [], "delay" => 1.0)
|
env.ThreadedTestBuilder("T5", [], "delay" => 1.0)
|
||||||
env.ThreadedTestBuilder("T4", [], "delay" => 0.5)
|
env.ThreadedTestBuilder("T4", [], "delay" => 0.5)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
class B < Builder
|
|
||||||
def run(*args)
|
|
||||||
puts "B:#{@target}"
|
|
||||||
true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
env do |env|
|
|
||||||
env.add_builder(B)
|
|
||||||
env.B("one")
|
|
||||||
env.B("two")
|
|
||||||
env.B("three")
|
|
||||||
env.Barrier(:bar, %w[two three])
|
|
||||||
env.depends("one", :bar)
|
|
||||||
end
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
env("e", echo: :command) do |env|
|
|
||||||
source_file = "#{env.build_root}/src/foo.c"
|
|
||||||
FileUtils.mkdir_p(File.dirname(source_file))
|
|
||||||
File.open(source_file, "w") do |fh|
|
|
||||||
fh.puts(<<-EOF)
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 29;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
end
|
|
||||||
env.Program("foo.exe", source_file)
|
|
||||||
end
|
|
||||||
@ -1,4 +1,6 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
object = env.Object("simple.o", "simple.c")
|
object = env.Object("simple.o", "simple.c")
|
||||||
env.Program("simple.exe", object)
|
env.Program("simple.exe", object)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -3,8 +3,9 @@ class TestBuilder < Rscons::Builder
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
default do
|
||||||
env do |env|
|
Environment.new do |env|
|
||||||
env.add_builder(TestBuilder)
|
env.add_builder(TestBuilder)
|
||||||
env.TestBuilder("file")
|
env.TestBuilder("file")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
class MyObject < Rscons::Builder
|
class MyObject < Rscons::Builder
|
||||||
def run(options)
|
def run(options)
|
||||||
if @builder
|
if @builder
|
||||||
if File.exist?(@target)
|
if File.exists?(@target)
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
@ -14,8 +14,10 @@ class MyObject < Rscons::Builder
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(MyObject)
|
env.add_builder(MyObject)
|
||||||
env.MyObject("simple.o", "simple.c")
|
env.MyObject("simple.o", "simple.c")
|
||||||
env.Program("simple.exe", "simple.o")
|
env.Program("simple.exe", "simple.o")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env["LIBS"] += ["m"]
|
env["LIBS"] += ["m"]
|
||||||
env.Program('simple.exe', Dir['*.c'])
|
env.Program('simple.exe', Dir['*.c'])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -27,10 +27,12 @@ class DebugBuilder < Rscons::Builder
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.add_builder(DebugBuilder)
|
env.add_builder(DebugBuilder)
|
||||||
if ENV["test"] == "new_user_dep"
|
if ENV["test"] == "new_user_dep"
|
||||||
env.depends("foo.o", "new_dep")
|
env.depends("foo.o", "new_dep")
|
||||||
end
|
end
|
||||||
env.DebugBuilder("foo.o", "simple.c")
|
env.DebugBuilder("foo.o", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Copy("simple.copy", "simple.c")
|
env.Copy("simple.copy", "simple.c")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
env do |env|
|
default do
|
||||||
|
Environment.new do |env|
|
||||||
env.Object("simple.o", "simple.c")
|
env.Object("simple.o", "simple.c")
|
||||||
env.process
|
env.process
|
||||||
env["LDCMD"] = %w[gcc -o ${_TARGET} simple.o]
|
env["LDCMD"] = %w[gcc -o ${_TARGET} simple.o]
|
||||||
env.Program('simple.exe', [])
|
env.Program('simple.exe', [])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user