Compare commits

...
167 Commits
Author SHA1 Message Date
josh 4dc1280f68 Add Util.glob() and use from Script 2026-01-28 11:56:34 -05:00
josh 355014def6 Add Precompile builder 2026-01-28 11:49:52 -05:00
josh af7aad716d Use absolute paths for Cache targets and dependencies 2026-01-28 10:58:01 -05:00
josh 13bd827d57 Store build targets, sources, and user dependencies internally as absolute paths 2026-01-28 10:44:03 -05:00
josh a3d739c472 Add Barrier build test 2026-01-28 08:35:01 -05:00
josh 319432bc61 Add Util.absolute_path() 2026-01-28 08:18:25 -05:00
josh d38cd2e8fb Show focused test count from build tests when focusing 2026-01-28 08:12:58 -05:00
josh 72d2802d1e Colorize build test results similar to RSpec tests 2026-01-28 07:56:36 -05:00
josh e6317ae236 Fix SimpleCov coverage results for multiple invocations from same build test 2026-01-27 23:50:04 -05:00
josh baf4e036fb Fix up dspec task for parallelization 2026-01-27 23:50:04 -05:00
josh 9d6321685e Clean up simplecov reporting 2026-01-27 23:50:04 -05:00
josh 3a5db626ac Parallelize build tests 2026-01-27 23:50:04 -05:00
josh 94a86e3433 Add Barrier builder 2026-01-16 22:54:22 -05:00
josh fc18c9f123 Test phony dependencies 2026-01-16 20:21:13 -05:00
josh 1d020d1aef Update gems 2026-01-15 21:07:18 -05:00
josh 19c5c8cfba Update gems 2025-11-22 00:14:26 -05:00
josh 4fc7ab6b25 v3.3.0 2025-06-10 20:14:15 -04:00
josh 161da80ffe Update CHANGELOG for v3.3.0 2025-06-10 20:13:37 -04:00
josh 8d9f19cb34 Add github workflow to run RScons tests
Fix up some macOS test cases
2025-06-08 20:46:09 -04:00
josh 18a2a075c1 Remove dependency on base64 - close #177 2025-06-08 02:48:03 -04:00
josh 1a280a8994 Update gems 2025-06-07 20:30:48 -04:00
josh a19c2e908e Update gems 2025-03-24 09:48:10 -04:00
josh 5223dfe211 Add base64 to Gemfile 2025-01-15 20:18:41 -05:00
josh d0c1b01598 Update gems 2024-03-28 09:11:07 -04:00
josh 57db93c59b Add LLVM support to documentation 2024-03-24 11:00:15 -04:00
josh ba71e8d5e3 Add support for building object files from LLVM assembly sources - close #175 2024-03-23 22:24:45 -04:00
josh 6e7139abb1 v3.2.0 2024-03-18 22:05:52 -04:00
josh 896a3e270f Indent docstrings under @overload 2024-03-18 22:05:10 -04:00
josh 3ee0015cef Update UPGRADING notes for v3.2.0 2024-03-18 21:53:04 -04:00
josh 0315729f69 Update CHANGELOG for v3.2.0 2024-03-18 21:45:43 -04:00
josh 8c865e668b Add upgrading instructions - close #167 2024-03-17 20:36:59 -04:00
josh 150960246b Improve DSL method documentation - close #164 2024-03-17 20:08:06 -04:00
josh c2277bc0a1 Update gems 2024-03-01 15:11:39 -05:00
josh 4baf26e492 Update ERB call to avoid deprecation warnings 2024-02-28 16:14:21 -05:00
josh 6044b64695 Update gems 2024-02-28 16:11:09 -05:00
josh 415fa424d1 Fix configuration checks performed with ldc2 compiler - close #172 2024-02-04 20:25:01 -05:00
josh f8c21a9bcc Use top-level build directory as environment build directory for unnamed environments - close #170 2023-09-10 21:41:42 -04:00
josh 6a8647a933 Place object files next to source files for source files in build directory - close #171 2023-09-10 10:00:41 -04:00
josh 3867133e89 Cannot output binary to an environment's build root with the same name as the top-level source directory - close #168 2023-09-10 08:51:03 -04:00
josh a7b962c11a Output a better error when pkg-config is not found - close #169 2023-09-08 21:05:01 -04:00
josh b490daa480 Update gems 2023-07-28 14:03:39 -04:00
josh ed7408367f Replace CFile builder with Yacc and Lex builders - close #166 2023-02-22 20:57:00 -05:00
josh d4ec07dd7a Fix user guide examples for task dependencies 2022-10-14 16:18:14 -04:00
josh 33b606ccb1 v3.1.0 2022-08-11 14:57:26 -04:00
josh c48526fd97 Improve configuration error messages - close #162 2022-08-11 14:41:29 -04:00
josh 419e6ed313 builder registered during build hooks should increase build step count - close #161 2022-08-05 17:05:13 -04:00
josh 132d22e886 Ruby 3.2 compatibility - close #163 2022-08-05 16:40:48 -04:00
josh 8f0f320a07 v3.0.2 2022-03-14 00:36:17 -04:00
josh 12f6936084 Update CHANGELOG for v3.0.2 2022-03-14 00:36:05 -04:00
josh 866b40d872 Configure parameters should not be stored as unscoped construction variables - close #160 2022-03-14 00:34:52 -04:00
josh f06d37c8b9 Compiler check configure methods should respect :use flag - close #159 2022-03-14 00:27:02 -04:00
josh 21f8e2435e v3.0.1 2022-03-13 22:27:16 -04:00
josh 97c4f7c757 Update CHANGELOG for v3.0.1 2022-03-13 22:27:16 -04:00
josh b3df37e9ea Do not configure for clean tasks when not yet configured - close #158 2022-03-13 22:27:16 -04:00
josh 1bf1c30242 Load configure task arguments before early configure operations - close #157 2022-03-13 20:16:01 -04:00
josh b932380b3b Avoid running configure operation twice - close #156 2022-03-11 21:17:07 -05:00
josh e3ea429253 Fix running dspec task with argument 2022-03-11 21:13:52 -05:00
josh dca4c49770 Avoid trailing spaces in distributable script 2022-03-07 21:08:17 -05:00
josh b068fe7574 Test that custom clean task action blocks are execution 2022-02-28 11:59:52 -05:00
josh ecd91e1171 v3.0.0 2022-02-27 20:55:16 -05:00
josh f36b71af3f Fix ARCMD spec for Linux and MacOS 2022-02-27 19:16:59 -05:00
josh 90c3867cae Tweak specs to all pass cleanly on MacOS 2022-02-27 19:10:18 -05:00
josh 20b5020284 bundle update 2022-02-27 18:06:39 -05:00
josh cb540741a4 Clarify task parameter construction variable names 2022-02-27 17:44:01 -05:00
josh bc17a9b38f Test that clean task does not process environments 2022-02-27 17:34:48 -05:00
josh cec1331054 Rename build specs from operation to task 2022-02-27 17:34:38 -05:00
josh bb4657e465 Process environments created during task execution phase 2022-02-27 16:55:59 -05:00
josh 29ca9b3f13 Fix YARD warnings 2022-02-27 16:40:09 -05:00
josh 5ab982b84c Add GCC Cross Compiler example build script 2022-02-27 16:28:09 -05:00
josh e6e860e3c1 Document download build script method 2022-02-27 16:27:24 -05:00
josh 3cfffed7ec Document spawn options to sh method 2022-02-27 16:07:35 -05:00
josh b2d47cd439 Document ^^/ prefix 2022-02-27 16:05:28 -05:00
josh 6a10d68fac Expand CLI usage printout 2022-02-27 16:02:00 -05:00
josh 88a8f2395d Update user guide for v3.0.0
Document variants
2022-02-27 15:51:20 -05:00
josh b82d6f2e62 Include user guide Overview section in README.md 2022-02-27 12:56:23 -05:00
josh 150943f23f Update CHANGELOG.md for v3.0.0 2022-02-27 12:52:59 -05:00
josh 59f1a89f4f Add -A CLI flag to show all tasks 2022-02-27 12:41:47 -05:00
josh ea66501311 Show variants in -T output 2022-02-22 15:46:19 -05:00
josh e9e3c6711f Add build_dir script method - close #155 2022-02-20 18:13:59 -05:00
josh 8269a98d01 Add variants - close #137 2022-02-20 08:54:33 -05:00
josh 19dee2b2a5 Add variants - #137
Add build script methods: variant, variant_group, with_variants
2022-02-16 12:23:30 -05:00
josh 5b6353395d Store configure task parameters in configuration cache data - close #151 2022-02-14 21:52:35 -05:00
josh 7e5c6e6b12 Store task parameter values in a Hash 2022-02-13 12:46:26 -05:00
josh 44f61da571 Only configure if necessary - close #131 2022-02-12 23:18:00 -05:00
josh 5c28e557bd Sort task output with -T 2022-02-12 22:14:10 -05:00
josh ef7e9259cb Add shortcut method for creating environments - close #149
Add env() method to create environments.
Process all environments created at build script top level before
executing any autoconf-enabled tasks, or if no tasks are specified by
the user.
2022-02-12 21:59:52 -05:00
josh 6d5f44d4e5 Allow passing spawn options to sh - close #153 2022-02-06 14:02:26 -05:00
josh 8b2387f7a3 Add download script method - close #152 2022-02-05 16:51:52 -05:00
josh 7b746db64e Tweak user guide styling; remove gradient border 2022-01-30 22:04:04 -05:00
josh 3aca248e9d Minor CHANGELOG fix 2022-01-30 22:03:43 -05:00
josh 3914dd896c Remove references to build operation in the user guide 2022-01-30 21:56:42 -05:00
josh df120af953 Add env.expand() shortcut method to expand paths and construction variables - close #150 2022-01-30 15:00:59 -05:00
josh b745ae1153 Add license/copyright to distributable script - close #148 2022-01-30 13:49:22 -05:00
josh 693f8cec64 Update LICENSE copyright 2022-01-30 13:46:42 -05:00
josh e12acccd33 Fix large project generated script 2022-01-30 13:46:23 -05:00
josh bd9cf55b85 Add tasks - close #139 2022-01-30 13:45:06 -05:00
josh f5ab51c477 Add ^^/ shortcut to top-level build directory - close #146 2022-01-21 20:45:05 -05:00
josh b0f2bbb7d5 Support environment variable to set rscons build directory - close #145 2022-01-17 18:02:58 -05:00
josh c1dcfa297f Add FileUtils class methods to script DSL - close #144 2022-01-17 16:41:36 -05:00
josh 034dbcd9a6 Update ruby-doc.org URL 2022-01-17 16:03:08 -05:00
josh b5d5fe7a7b Add 'sh' script DSL method - close #142 2022-01-17 15:57:34 -05:00
josh 610b8f1266 Add Size builder - close #143 2022-01-17 12:50:38 -05:00
josh a316c4f922 Support naming environments - close #140 2022-01-13 12:56:23 -05:00
josh 97dbaeb82d Move rsconscache into build directory - close #136 2022-01-09 23:08:28 -05:00
josh a2f72c6b87 v2.3.0 2021-12-04 09:43:03 -05:00
josh 7055cad73c Add v2.3.0 release notes 2021-12-04 09:27:24 -05:00
josh 4548f4e3c9 Document phony targets - close #141 2021-12-01 23:00:12 -05:00
josh 19dbab3426 Run subsidiary rscons binary from rscons() method if found - close #129 2021-11-28 22:36:24 -05:00
josh 69f5bea2b2 Fix specs for dependency file moving - #135 2021-11-28 15:10:25 -05:00
josh 2ee9dda49d Write dependency file to build directory when user invokes Object builder directly - close #135 2021-11-18 20:18:19 -05:00
josh f011b23499 Add PATH manipulation methods - close #126 2021-11-17 21:39:58 -05:00
josh 80d52f25b8 Document CMD_STDOUT variable for Command builder - close #134 2021-11-15 21:52:11 -05:00
josh 0face546e3 Clarify failed command error message indicating to run -F - close #133 2021-11-15 21:45:18 -05:00
josh ca747232cd Support passing a directory to rscons() method - close #128 2021-11-13 11:36:25 -05:00
josh a7b46093e9 Document -f command line option - close #130 2021-11-13 11:07:15 -05:00
josh 09892eed63 Add DEVELOPING.md 2021-11-07 21:09:42 -05:00
josh 117df43f64 Document rscons() build script method for subsidiary build scripts 2021-10-27 23:02:04 -04:00
josh acc12822b6 Add description for user_guide task 2021-10-27 22:42:31 -04:00
josh 8c7b43f60c Show a message when entering/leaving a subsidiary script directory 2021-10-22 16:48:44 -04:00
josh 7c8becc3f9 env.depends() does not work with build-root-relative "^/" paths - close #121 2021-10-22 16:03:10 -04:00
josh d1a35501ef Support subsidiary Rsconscript files - close #125 2021-10-22 13:58:38 -04:00
josh 28a245f0ab build_dist: Remove lines marked just for specs 2021-10-22 13:58:38 -04:00
josh 87a6d9f04f Do not run simplecov on dspec specs 2021-10-22 13:58:38 -04:00
josh 556c821cc6 Commonize error handling across all operations 2021-10-21 18:35:58 -04:00
josh 441fc9bc65 bundle update 2021-09-02 15:37:33 -04:00
josh 1861874f5c bundle update 2021-01-11 15:15:42 -05:00
dependabot[bot] 6d51c5cbde Bump redcarpet from 3.5.0 to 3.5.1
Bumps [redcarpet](https://github.com/vmg/redcarpet) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/vmg/redcarpet/releases)
- [Changelog](https://github.com/vmg/redcarpet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmg/redcarpet/compare/v3.5.0...v3.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 19:21:14 +00:00
josh 73af83803a add v2.2.0 release notes 2020-10-13 19:04:29 -04:00
josh 353f4f45bc v2.2.0 2020-10-13 18:59:18 -04:00
josh 5bac91f92f add failure messages for failed configuration checks - close #119 2020-10-12 21:01:04 -04:00
josh bbe9563ceb compiler checks should support cross-compilers and freestanding compilers - close #118 2020-10-08 19:23:17 -04:00
josh 5ec74604c6 improve support for MSYS2 - close #120 2020-10-08 19:04:50 -04:00
josh 8e06efe61e v2.1.0 2020-04-16 16:52:58 -04:00
josh 0756874ddb update CHANGELOG for v2.1.0 2020-04-16 16:51:16 -04:00
josh dded5e2648 ruby 2.7 compatibility - #117 2020-04-16 15:48:45 -04:00
josh fbe60f6ba2 stick with simplecov 0.15.x for now 2020-04-16 15:02:01 -04:00
josh 8dd9799666 Revert "update simplecov"
This reverts commit 01ca86de8b.
2020-04-16 15:02:01 -04:00
josh f2c755c8bb update bundle 2020-04-16 13:07:20 -04:00
josh 01ca86de8b update simplecov 2020-02-29 14:27:21 -05:00
josh 943fabd0d1 update some gems 2020-02-29 10:47:46 -05:00
josh d08e2f6b5c v2.0.2 2019-12-16 21:36:38 -05:00
josh 90365dd197 update CHANGELOG for v2.0.2 2019-12-16 21:36:22 -05:00
josh 8d05516c40 distinguish object files built from multiple sources with the same base name but different extensions - close #113 2019-12-14 00:10:42 -05:00
josh db49d86866 show a configuration failed message on stderr on configuration failure 2019-10-14 22:57:49 -04:00
josh e667455c32 user guide: fix configure script example 2019-10-14 22:49:34 -04:00
josh e62332aba6 avoid backtrace when configuring fails during autoconf 2019-10-14 22:23:18 -04:00
josh 397639849d call print_run_message() in json_to_yaml build test 2019-10-12 17:59:08 -04:00
josh 96d5caf2e5 user guide: fix print_run_message() examples 2019-10-12 17:57:58 -04:00
josh f4b10a30af update CHANGELOG for v2.0.1 2019-10-02 21:10:29 -04:00
josh cf52c3fc6f v2.0.1 2019-10-02 20:59:58 -04:00
josh 5378afb6f8 Install builder cannot replace a currently executing binary on Linux - close #112 2019-09-28 23:18:31 -04:00
josh 48d9273cc6 v2.0.0 2019-09-11 23:32:27 -04:00
josh efea4f1181 user guide: Installation: mention marking rscons executable 2019-09-11 23:29:25 -04:00
josh b4fa6d965c CHANGELOG - add logo 2019-09-11 23:25:19 -04:00
josh ac56ad34f6 add rscons logo to README 2019-09-11 23:24:20 -04:00
josh 2fd533a32a clobber large_project directory 2019-09-11 23:20:22 -04:00
josh c938ed71d1 add "all" rake task 2019-09-11 23:19:46 -04:00
josh ec60201a62 user guide: add rscons logo 2019-09-11 23:18:38 -04:00
josh 0cafb8c5b3 user guide: stylize as "Rscons" 2019-09-11 23:15:16 -04:00
josh 004810386b clobber should remove "gen" directory 2019-09-11 23:15:02 -04:00
josh a15ee9daaf add logo images 2019-09-11 23:02:17 -04:00
josh cd33405697 user guide: add FreeBSD compatibility 2019-09-01 21:52:32 -04:00
josh efa77066bf allow ConfigureOp#log_and_test_command to be passed standard input data - close #111 2019-09-01 21:50:57 -04:00
josh a1bb9d81fd check_program: do not fail on Windows for non-existent PATH entries 2019-08-27 19:47:21 -04:00
josh 0344f02cb1 build tests: use -m instead of -lc for mingw 2019-08-27 19:32:36 -04:00
josh d52bdaf046 build tests: do ldc2 tests even if omit_gdc_tests set 2019-08-27 18:51:56 -04:00
josh ad7ccb771d update build test for gdc fix 2019-08-27 18:50:01 -04:00
240 changed files with 8018 additions and 4344 deletions

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
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
+1 -1
View File
@@ -7,5 +7,5 @@
/gen/
/large_project/
/pkg/
/test/
/test_run/
/yard/
+116
View File
@@ -1,3 +1,118 @@
## 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
### New Features
- #125 - Support subsidiary Rsconscript files
- #126 - Add PATH manipulation methods
### Fixes
- #121 - env.depends() does not work with build-root-relative "^/" paths
- #130 - Document -f command line option
- #133 - Clarify failed command error message indicating to run -F
- #134 - Document CMD_STDOUT variable for Command builder
- #135 - Write dependency file to build directory when user invokes Object builder directly
- #141 - Document phony targets
## v2.2.0
### New Features
- #120 - improve support for MSYS2
- #119 - add failure messages for failed configuration checks
- #118 - compiler checks should support cross-compilers and freestanding compilers
## v2.1.0
### New Features
- #117 - ruby 2.7 compatibility
## v2.0.2
### Fixes
- #113 - distinguish object files built from multiple sources with the same base name but different extensions
## v2.0.1
### Fixes
- #112 - Install builder cannot replace a currently executing binary on Linux
## v2.0.0
- convert rscons from a Ruby gem to a standalone script
@@ -32,6 +147,7 @@
- various performance improvements
- wrote a new user guide
- added new website ([https://holtrop.github.io/rscons/](https://holtrop.github.io/rscons/))
- added new logo
## v1.17.0
+14
View File
@@ -0,0 +1,14 @@
# Developing
# Specs
To run the rscons specs, the following commands must be available:
* gcc
* clang
* g++
* clang++
* gdc
* ldc2
* flex
* bison
+11 -5
View File
@@ -1,10 +1,16 @@
source 'https://rubygems.org'
gem "json"
gem "base64"
gem "rspec"
gem "rake"
gem "simplecov"
gem "yard"
gem "rdoc"
gem "redcarpet"
gem "syntax"
gem "openssl"
if RbConfig::CONFIG["host"]["msys"]
gem "json", "2.1.0"
else
gem "json"
gem "yard"
gem "rdoc"
gem "redcarpet"
gem "syntax"
end
+39 -24
View File
@@ -1,39 +1,54 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.3)
docile (1.3.2)
json (2.2.0)
rake (12.3.2)
rdoc (6.1.1)
redcarpet (3.4.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
base64 (0.3.0)
date (3.5.1)
diff-lcs (1.6.2)
docile (1.4.1)
erb (6.0.1)
json (2.18.0)
openssl (4.0.0)
psych (5.3.1)
date
stringio
rake (13.3.1)
rdoc (7.1.0)
erb
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)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.1)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.7)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.2)
simplecov (0.15.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
stringio (3.2.0)
syntax (1.2.2)
yard (0.9.20)
tsort (0.2.0)
yard (0.9.38)
PLATFORMS
ruby
x86-mingw32
DEPENDENCIES
base64
json
openssl
rake
rdoc
redcarpet
@@ -43,4 +58,4 @@ DEPENDENCIES
yard
BUNDLED WITH
1.17.3
2.6.2
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2013-2019 Josh Holtrop
Copyright (c) 2013-2025 Josh Holtrop
MIT License
+35 -1
View File
@@ -1,8 +1,42 @@
# Rscons
![rscons logo](img/rscons_logo_1000.png)
Rscons (https://github.com/holtrop/rscons) is an open-source build system
for developers.
It supports the following features:
Rscons is written in Ruby, and is inspired by [SCons](https://scons.org/) and [waf](https://waf.io/).
* multi-threaded job execution
* 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.
+54 -18
View File
@@ -6,42 +6,61 @@ rescue Bundler::BundlerError => e
end
require "rspec/core/rake_task"
require "yard"
require "rake/clean"
require "fileutils"
require "simplecov"
require "stringio"
CLEAN.include %w[build_test_run .yardoc yard coverage test]
CLOBBER.include %w[dist pkg]
CLEAN.include %w[build_test_run .yardoc yard coverage test_run]
CLOBBER.include %w[dist gen large_project pkg]
task :build_dist do
sh "ruby rb/build_dist.rb"
end
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
ENV["specs"] = "1"
if args.example_string
ENV["partial_specs"] = "1"
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
end
end
task :spec => :build_dist
task :spec do
ENV.delete("specs")
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
# useful for coverage information.
desc "Dist Specs"
task :dspec, [:example_string] => :build_dist do |task, args|
FileUtils.mkdir_p("test")
FileUtils.cp("dist/rscons", "test/rscons.rb")
ENV["dist_specs"] = "1"
Rake::Task["spec"].invoke(args.example_string)
ENV.delete("dist_specs")
FileUtils.rm_rf("test_run")
FileUtils.mkdir_p("test_run")
FileUtils.cp("dist/rscons", "test_run/rscons.rb")
ENV["rscons_dist_specs"] = "1"
Rake::Task["spec"].execute(args)
Rake::Task["build_tests"].execute(args)
ENV.delete("rscons_dist_specs")
FileUtils.rm_f(Dir.glob(".rscons-*"))
end
YARD::Rake::YardocTask.new do |yard|
yard.files = ['lib/**/*.rb']
yard.options = ["-ogen/yard"]
end
task :gen_large_project, [:size] => :build_dist do |task, args|
size = (args.size || 10000).to_i
FileUtils.rm_rf("large_project")
@@ -78,7 +97,7 @@ task :gen_large_project, [:size] => :build_dist do |task, args|
end
File.open("large_project/Rsconscript", "w") do |fh|
fh.puts <<EOF
build do
default do
Environment.new do |env|
env.Program("project", glob("src/*.c"))
end
@@ -88,8 +107,25 @@ EOF
FileUtils.cp("dist/rscons", "large_project")
end
task :user_guide do
system("ruby", "-Ilib", "rb/gen_user_guide.rb")
unless RbConfig::CONFIG["host"]["msys"]
require "yard"
YARD::Rake::YardocTask.new do |yard|
yard.files = ['lib/**/*.rb']
yard.options = ["-ogen/yard"]
end
desc "Build user guide"
task :user_guide do
system("ruby", "-Ilib", "rb/gen_user_guide.rb")
end
end
task :default => :spec
task :all => [
:build_dist,
:spec,
:dspec,
:yard,
:user_guide,
]
+10
View File
@@ -0,0 +1,10 @@
# 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()`.
+1 -1
View File
@@ -3,5 +3,5 @@
require "rscons/cli"
if __FILE__ == $0
Rscons::Cli.run(ARGV)
Rscons::Cli.new.run(ARGV)
end
File diff suppressed because it is too large. Load diff
-6
View File
@@ -1,6 +0,0 @@
build do
Environment.new do |env|
env.CFile("lexer.c", "lexer.l")
env.CFile("parser.c", "parser.y")
end
end
@@ -1,5 +0,0 @@
build do
Environment.new do |env|
env.CFile("file.c", "foo.bar")
end
end
+9 -11
View File
@@ -1,12 +1,10 @@
build do
debug = Environment.new(echo: :command) do |env|
env['CFLAGS'] = '-O2'
env['CPPFLAGS'] = '-DSTRING="Debug Version"'
env.Program('program-debug.exe', Dir['src/*.c'])
end
release = debug.clone do |env|
env["CPPFLAGS"] = '-DSTRING="Release Version"'
env.Program('program-release.exe', Dir['src/*.c'])
end
debug = env("dbg", echo: :command) do |env|
env['CFLAGS'] = '-O2'
env['CPPFLAGS'] = '-DSTRING="Debug Version"'
env.Program('program-debug.exe', Dir['src/*.c'])
end
release = debug.clone("rls") do |env|
env["CPPFLAGS"] = '-DSTRING="Release Version"'
env.Program('program-release.exe', Dir['src/*.c'])
end
+11 -13
View File
@@ -1,16 +1,14 @@
build do
env1 = Environment.new(echo: :command) do |env|
env['CFLAGS'] = '-O2'
env.add_build_hook do |builder|
builder.vars['CPPFLAGS'] = '-DSTRING="Hello"'
end
env.add_post_build_hook do |builder|
$stdout.puts "post #{builder.target}"
end
env.Program('program.exe', Dir['src/*.c'])
env1 = env("e1", echo: :command) do |env|
env['CFLAGS'] = '-O2'
env.add_build_hook do |builder|
builder.vars['CPPFLAGS'] = '-DSTRING="Hello"'
end
env2 = env1.clone do |env|
env.Program('program2.exe', Dir['src/*.c'])
env.add_post_build_hook do |builder|
$stdout.puts "post #{builder.target}"
end
env.Program('program.exe', Dir['src/*.c'])
end
env2 = env1.clone("e2") do |env|
env.Program('program2.exe', Dir['src/*.c'])
end
+1
View File
@@ -1,3 +1,4 @@
configure do
check_c_compiler "nope.nope"
end
default
+2
View File
@@ -1 +1,3 @@
autoconf false
env do |env|
end
+2 -4
View File
@@ -3,8 +3,6 @@ configure do
check_c_header "stdio.h"
end
build do
Environment.new do |env|
env.Program("simple.exe", "simple.c")
end
env do |env|
env.Program("simple.exe", "simple.c")
end
@@ -1,3 +1,4 @@
configure do
check_c_compiler
end
default
@@ -0,0 +1,6 @@
configure do
check_c_compiler "clang"
end
env do |env|
env.Program("simple.exe", "simple.c")
end
@@ -0,0 +1,12 @@
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,8 +3,6 @@ configure do
check_c_header "frobulous.h", check_cpppath: ["./usr2"]
end
build do
Environment.new do |env|
env.Object("test.o", "test.c")
end
env do |env|
env.Object("test.o", "test.c")
end
@@ -2,8 +2,6 @@ configure do
check_c_header "not___found.h", set_define: "HAVE_NOT___FOUND_H"
end
build do
Environment.new(echo: :command) do |env|
env.Object("simple.o", "simple.c")
end
env(echo: :command) do |env|
env.Object("simple.o", "simple.c")
end
@@ -2,8 +2,6 @@ configure do
check_c_header "string.h", set_define: "HAVE_STRING_H"
end
build do
Environment.new(echo: :command) do |env|
env.Object("simple.o", "simple.c")
end
env(echo: :command) do |env|
env.Object("simple.o", "simple.c")
end
+2 -4
View File
@@ -2,8 +2,6 @@ configure do
check_cfg program: "my-config"
end
build do
Environment.new(echo: :command) do |env|
env.Program("myconfigtest", "simple.c")
end
env(echo: :command) do |env|
env.Program("myconfigtest", "simple.c")
end
@@ -0,0 +1,5 @@
ENV["PATH"] = ""
configure do
check_cfg package: "mypackage"
end
+2 -4
View File
@@ -2,8 +2,6 @@ configure do
check_cfg package: "mypackage"
end
build do
Environment.new(echo: :command) do |env|
env.Program("myconfigtest", "simple.c")
end
env(echo: :command) do |env|
env.Program("myconfigtest", "simple.c")
end
+8 -10
View File
@@ -2,14 +2,12 @@ configure do
check_cfg package: "mypackage", use: "myp"
end
build do
Environment.new(echo: :command) do |env|
env.Copy("myconfigtest1.c", "simple.c")
env.Program("myconfigtest1.exe", "myconfigtest1.c")
end
Environment.new(echo: :command, use: "myp") do |env|
env.Copy("myconfigtest2.c", "simple.c")
env.Program("myconfigtest2.exe", "myconfigtest2.c")
end
env(echo: :command) do |env|
env.Copy("myconfigtest1.c", "simple.c")
env.Program("myconfigtest1.exe", "myconfigtest1.c")
end
env(echo: :command, use: "myp") do |env|
env.Copy("myconfigtest2.c", "simple.c")
env.Program("myconfigtest2.exe", "myconfigtest2.c")
end
@@ -0,0 +1,12 @@
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,8 +3,6 @@ configure do
check_cxx_header "frobulous.h", check_cpppath: ["./usr2"]
end
build do
Environment.new do |env|
env.Object("test.o", "test.cc")
end
env do |env|
env.Object("test.o", "test.cc")
end
@@ -1,3 +1,3 @@
configure do
check_d_compiler "gdc", "ldc2"
check_d_compiler "gdc", "ldc2", "ldc"
end
@@ -0,0 +1,12 @@
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
@@ -1,10 +1,9 @@
configure do
check_d_compiler
check_d_import "std.stdio", check_d_import_path: ["./usr1"]
check_d_import "frobulous", check_d_import_path: ["./usr2"]
end
build do
Environment.new do |env|
env.Object("test.o", "test.d")
end
env do |env|
env.Object("test.o", "test.d")
end
@@ -1,3 +1,4 @@
configure do
check_d_compiler
check_d_import "std.stdio"
end
+2 -4
View File
@@ -1,5 +1,3 @@
build do
Environment.new(echo: :command) do |env|
env.Library("usr2/libfrobulous.a", "two.c")
end
env(echo: :command) do |env|
env.Library("usr2/libfrobulous.a", "two.c")
end
+2 -4
View File
@@ -3,8 +3,6 @@ configure do
check_lib "frobulous", check_libpath: ["./usr2"]
end
build do
Environment.new(echo: :command) do |env|
env.Program("simple.exe", "simple.c")
end
env(echo: :command) do |env|
env.Program("simple.exe", "simple.c")
end
+2 -4
View File
@@ -2,8 +2,6 @@ configure do
check_lib "m"
end
build do
Environment.new(echo: :command) do |env|
env.Program("simple.exe", "simple.c")
end
env(echo: :command) do |env|
env.Program("simple.exe", "simple.c")
end
+8 -10
View File
@@ -2,14 +2,12 @@ configure do
check_lib "m", use: :m
end
build do
Environment.new(echo: :command) do |env|
env.Copy("test1.c", "simple.c")
env.Program("test2.exe", "test1.c")
end
Environment.new(echo: :command, use: %w[m]) do |env|
env.Copy("test2.c", "simple.c")
env.Program("test2.exe", "test2.c")
end
env(echo: :command) do |env|
env.Copy("test1.c", "simple.c")
env.Program("test2.exe", "test1.c")
end
env(echo: :command, use: %w[m]) do |env|
env.Copy("test2.c", "simple.c")
env.Program("test2.exe", "test2.c")
end
+3 -5
View File
@@ -2,9 +2,7 @@ configure do
check_lib "m", use: false
end
build do
Environment.new(echo: :command) do |env|
env.Copy("test1.c", "simple.c")
env.Program("test2.exe", "test1.c")
end
env(echo: :command) do |env|
env.Copy("test1.c", "simple.c")
env.Program("test2.exe", "test1.c")
end
@@ -0,0 +1,8 @@
configure do
check_d_compiler "ldc2"
check_lib "z"
end
env(echo: :command) do |env|
env.Program("simple.exe", "simple.d")
end
@@ -0,0 +1,6 @@
configure do
check_c_compiler
end
env do |env|
puts "Prefix is #{Task["configure"]["prefix"]}"
end
+7 -5
View File
@@ -17,10 +17,12 @@ configure do
end
op.complete(status, success_message: "good!", fail_message: fail_message, fail: should_fail)
end
end
build do
Environment.new do |env|
puts env["CPPDEFINES"]
custom_check("Checking sed -E flag") do |op|
stdout, stderr, status = op.log_and_test_command(%w[sed -E -e s/ab+/rep/], stdin: "abbbc")
op.complete(stdout =~ /repc/ ? 0 : 1, success_message: "good", fail_message: "fail")
end
end
env do |env|
puts env["CPPDEFINES"]
end
@@ -1,3 +0,0 @@
Environment.new do |env|
env.Object("simple.o", "simple.cc")
end
+2 -4
View File
@@ -3,8 +3,6 @@ configure do
check_c_header "stdio.h", set_define: "HAVE_STDIO_H"
end
build do
Environment.new(echo: :command) do |env|
env.Object("simple.o", "simple.c")
end
env(echo: :command) do |env|
env.Object("simple.o", "simple.c")
end
@@ -0,0 +1,3 @@
default do
puts "default"
end
+5
View File
@@ -0,0 +1,5 @@
configure do
check_c_compiler "foo123c", fail: false, on_fail: "Install the foo123 package"
check_d_compiler "foo123d", fail: false
check_cxx_compiler "foo123cxx", on_fail: lambda {puts "Install the foo123cxx package"}
end
+6
View File
@@ -0,0 +1,6 @@
#include <iostream>
int main(int argc, char *argv[])
{
std::cout << "Hi" << std::endl;
}
+7
View File
@@ -0,0 +1,7 @@
import std.stdio;
int main()
{
writeln("Hello");
return 0;
}
+4 -6
View File
@@ -9,10 +9,8 @@ EOF
end
end
build do
Environment.new do |env|
env.add_builder(MySource)
env.MySource('inc.h', [])
env.Program('program.exe', Dir['*.c'])
end
env do |env|
env.add_builder(MySource)
env.MySource('inc.h', [])
env.Program('program.exe', Dir['*.c'])
end
+10 -11
View File
@@ -1,12 +1,11 @@
build do
Environment.new do |env|
env.Command("inc.c",
[],
"CMD" => %w[ruby gen.rb ${_TARGET}],
"CMD_DESC" => "Generating")
env["build_root"] = env.build_root
env["inc_c"] = "inc.c"
env.build_after("${build_root}/program.o", "${inc_c}")
env.Program("program.exe", ["program.c", "inc.c"])
end
env do |env|
env.Command("inc.c",
[],
"CMD" => %w[ruby gen.rb ${_TARGET}],
"CMD_DESC" => "Generating")
env["build_root"] = env.build_root
env["inc_c"] = "inc.c"
env.Object("program.o", "program.c")
env.build_after("program.o", "${inc_c}")
env.Program("program.exe", ["program.o", "inc.c"])
end
+6 -8
View File
@@ -9,12 +9,10 @@ EOF
end
end
build do
env = Environment.new do |env|
env["hdr"] = "inc.h"
env["src"] = "program.c"
env.add_builder(MySource)
env.MySource('${hdr}')
env.Program('program.exe', "${src}")
end
env = env do |env|
env["hdr"] = "inc.h"
env["src"] = "program.c"
env.add_builder(MySource)
env.MySource('${hdr}')
env.Program('program.exe', "${src}")
end
+14 -16
View File
@@ -9,22 +9,20 @@ EOF
end
end
build do
e1 = Environment.new do |env|
env.add_builder(MySource)
env["one"] = "5"
env[:cfg] = {val: "9"}
env["two"] = lambda do |args|
args[:env][:cfg][:val]
end
env["the_value"] = lambda do |args|
"${one}${two}78"
end
e1 = env do |env|
env.add_builder(MySource)
env["one"] = "5"
env[:cfg] = {val: "9"}
env["two"] = lambda do |args|
args[:env][:cfg][:val]
end
e1.clone do |env|
env[:cfg][:val] = "6"
env.MySource('inc.h', [])
env.Program('program.exe', Dir['*.c'])
env["the_value"] = lambda do |args|
"${one}${two}78"
end
end
e1.clone do |env|
env[:cfg][:val] = "6"
env.MySource('inc.h', [])
env.Program('program.exe', Dir['*.c'])
end
@@ -1,8 +1,6 @@
build do
Environment.new do |env|
env.add_builder(:MyBuilder) do |options|
"hi"
end
env.MyBuilder("foo")
env do |env|
env.add_builder(:MyBuilder) do |options|
"hi"
end
env.MyBuilder("foo")
end
+4 -6
View File
@@ -1,8 +1,6 @@
build do
Environment.new do |env|
env.add_builder(:MyBuilder) do |options|
wait_for(1)
end
env.MyBuilder("foo")
env do |env|
env.add_builder(:MyBuilder) do |options|
wait_for(1)
end
env.MyBuilder("foo")
end
@@ -12,10 +12,8 @@ class CHGen < Rscons::Builder
end
end
build do
Environment.new do |env|
env.add_builder(CHGen)
env.CHGen("inc.c", ["program.c"])
env.Program("program.exe", %w[program.c inc.c])
end
env do |env|
env.add_builder(CHGen)
env.CHGen("inc.c", ["program.c"])
env.Program("program.exe", %w[program.c inc.c])
end
+12 -13
View File
@@ -1,16 +1,15 @@
build do
Environment.new do |env|
env["build_root"] = env.build_root
env["inc_h"] = "inc.h"
env do |env|
env["build_root"] = env.build_root
env["inc_h"] = "inc.h"
env.Copy("copy_inc.h", "${inc_h}")
env.depends("${build_root}/program.o", "${inc_h}")
env.Program("program.exe", ["program.c", "inc.c"])
env.Copy("copy_inc.h", "${inc_h}")
env.depends("program.o", "${inc_h}")
env.Object("program.o", "program.c")
env.Program("program.exe", ["program.o", "inc.c"])
inc_c = env.Command("inc.c",
[],
"CMD" => %w[ruby gen.rb ${_TARGET}],
"CMD_DESC" => "Generating")
inc_c.produces("inc.h")
end
inc_c = env.Command("inc.c",
[],
"CMD" => %w[ruby gen.rb ${_TARGET}],
"CMD_DESC" => "Generating")
inc_c.produces("inc.h")
end
+12 -13
View File
@@ -1,16 +1,15 @@
build do
Environment.new do |env|
env["build_root"] = env.build_root
env["inc_h"] = "inc.h"
env do |env|
env["build_root"] = env.build_root
env["inc_h"] = "inc.h"
env.Copy("copy_inc.h", "${inc_h}")
env.depends("${build_root}/program.o", "${inc_h}")
env.Program("program.exe", ["program.c", "inc.c"])
env.Copy("copy_inc.h", "${inc_h}")
env.depends("program.o", "${inc_h}")
env.Object("program.o", "program.c")
env.Program("program.exe", ["program.o", "inc.c"])
env.Command("inc.c",
[],
"CMD" => %w[ruby gen.rb ${_TARGET}],
"CMD_DESC" => "Generating")
env.produces("inc.c", "inc.h")
end
env.Command("inc.c",
[],
"CMD" => %w[ruby gen.rb ${_TARGET}],
"CMD_DESC" => "Generating")
env.produces("inc.c", "inc.h")
end
@@ -13,9 +13,7 @@ class MyBuilder < Rscons::Builder
end
end
build do
Environment.new do |env|
env.add_builder(MyBuilder)
env.MyBuilder("foo")
end
env do |env|
env.add_builder(MyBuilder)
env.MyBuilder("foo")
end
+2 -4
View File
@@ -2,8 +2,6 @@ configure do
check_d_compiler "gdc"
end
build do
Environment.new(echo: :command) do |env|
env.Program("hello-d.exe", glob("*.d"))
end
env(echo: :command) do |env|
env.Program("hello-d.exe", glob("*.d"))
end
+2 -4
View File
@@ -2,8 +2,6 @@ configure do
check_d_compiler "ldc2"
end
build do
Environment.new(echo: :command) do |env|
env.Program("hello-d.exe", glob("*.d"))
end
env(echo: :command) do |env|
env.Program("hello-d.exe", glob("*.d"))
end
+4 -6
View File
@@ -1,7 +1,5 @@
build do
Environment.new(echo: :command) do |env|
env.Object("main.o", "main.d")
env.Object("mod.o", "mod.d")
env.Program("hello-d.exe", ["main.o", "mod.o"])
end
env(echo: :command) do |env|
env.Object("main.o", "main.d")
env.Object("mod.o", "mod.d")
env.Program("hello-d.exe", ["main.o", "mod.o"])
end
+2 -4
View File
@@ -1,5 +1,3 @@
build do
Environment.new do |env|
env.Program("test.exe", glob("*.c"), direct: true)
end
env do |env|
env.Program("test.exe", glob("*.c"), direct: true)
end
+4 -6
View File
@@ -1,7 +1,5 @@
build do
Environment.new do |env|
lib = env.SharedLibrary("mylib", ["two.c", "three.c"], direct: true)
program = env.Program("test.exe", "main.c", "LIBS" => ["mylib"], "LIBPATH" => ["."])
env.depends(program, lib)
end
env do |env|
lib = env.SharedLibrary("mylib", ["two.c", "three.c"], direct: true)
program = env.Program("test.exe", "main.c", "LIBS" => ["mylib"], "LIBPATH" => ["."])
env.depends(program, lib)
end
+2 -4
View File
@@ -1,5 +1,3 @@
build do
Environment.new do |env|
env.Program('header.exe', Dir['*.c'])
end
env do |env|
env.Program('header.exe', Dir['*.c'])
end
+12 -13
View File
@@ -1,17 +1,16 @@
build do
Environment.new do |env|
require 'json'
require 'yaml'
env.add_builder(:JsonToYaml) do |params|
unless @cache.up_to_date?(@target, :JsonToYaml, @sources, @env)
@cache.mkdir_p(File.dirname(@target))
File.open(@target, 'w') do |f|
f.write(YAML.dump(JSON.load(IO.read(@sources.first))))
end
@cache.register_build(@target, :JsonToYaml, @sources, @env)
env do |env|
require 'json'
require 'yaml'
env.add_builder(:JsonToYaml) do |params|
unless @cache.up_to_date?(@target, :JsonToYaml, @sources, @env)
print_run_message("JsonToYaml #{@target}", nil)
@cache.mkdir_p(File.dirname(@target))
File.open(@target, 'w') do |f|
f.write(YAML.dump(JSON.load(IO.read(@sources.first))))
end
true
@cache.register_build(@target, :JsonToYaml, @sources, @env)
end
env.JsonToYaml('foo.yml', 'foo.json')
true
end
env.JsonToYaml('foo.yml', 'foo.json')
end
+4
View File
@@ -0,0 +1,4 @@
env do |env|
env.Lex("lexer.c", "lexer.l")
env.Yacc("parser.c", "parser.y")
end
File renamed without changes.
File renamed without changes.
+6 -5
View File
@@ -1,6 +1,7 @@
build do
Environment.new(echo: :command) do |env|
env.Program('library.exe', ['lib.a', 'three.c'])
env.Library("lib.a", ['one.c', 'two.c'], 'CPPFLAGS' => ['-Dmake_lib'])
end
env(echo: :command) do |env|
env["LIBS"] << "mylib"
env["LIBPATH"] << "."
env.Program("library.exe", "one.c")
env.depends("library.exe", "libmylib.a")
env.Library("libmylib.a", ["two.c", "three.c"], "CPPFLAGS" => ["-Dmake_lib"])
end
+4 -6
View File
@@ -1,7 +1,5 @@
build do
Environment.new do |env|
env.Program("library.exe", ["lib.a", "three.c"])
env.Object("two.o", "two.c")
env.Library("lib.a", ["one.c", "two.o"], 'CPPFLAGS' => ['-Dmake_lib'])
end
env do |env|
env.Program("library.exe", ["lib.a", "three.c"])
env.Object("two.o", "two.c")
env.Library("lib.a", ["one.c", "two.o"], 'CPPFLAGS' => ['-Dmake_lib'])
end
+5 -2
View File
@@ -1,8 +1,11 @@
#include <stdio.h>
#ifdef make_lib
void two();
void three();
int main(int argc, char *argv[])
{
two();
printf("Library\n");
three();
}
#endif
+3 -5
View File
@@ -1,6 +1,4 @@
build do
Environment.new(echo: :command) do |env|
env["ARCMD"] = %w[ar rcf ${_TARGET} ${_SOURCES}]
env.Library("lib.a", glob("*.c"))
end
env(echo: :command) do |env|
env["ARCMD"] = %w[ar rc ${_TARGET} ${_SOURCES}]
env.Library("lib.a", glob("*.c"))
end
+3
View File
@@ -0,0 +1,3 @@
void three(void)
{
}
+3
View File
@@ -0,0 +1,3 @@
void two(void)
{
}
+4
View File
@@ -0,0 +1,4 @@
env do |env|
env["LLVMAS_FLAGS"] += %w[-Wno-override-module]
env.Program("llvmtest.exe", %w[main.c one.ll])
end
+8
View File
@@ -0,0 +1,8 @@
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
+6
View File
@@ -0,0 +1,6 @@
extern int one(void);
int main(int argc, char * argv[])
{
return one();
}
+9
View File
@@ -0,0 +1,9 @@
extern int one(void);
extern int two(void);
int main(int argc, char * argv[])
{
one();
two();
return 0;
}
+9
View File
@@ -0,0 +1,9 @@
@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
}
+9
View File
@@ -0,0 +1,9 @@
@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
}
@@ -0,0 +1,3 @@
env do |env|
env.Program("foo.exe", glob("*.cc", "*.c"))
end
+6
View File
@@ -0,0 +1,6 @@
#include <stdio.h>
void foo(void)
{
printf("foo\n");
}
+12
View File
@@ -0,0 +1,12 @@
#include <iostream>
extern "C" {
void foo(void);
}
int main(int argc, char * argv[])
{
foo();
std::cout << "main" << std::endl;
return 0;
}
+2 -4
View File
@@ -1,5 +1,3 @@
build do
Environment.new do |env|
env.Preprocess("pp", "foo.h")
end
env do |env|
env.Preprocess("pp", "foo.h")
end
+10 -12
View File
@@ -1,13 +1,11 @@
build do
Environment.new do |env|
env["CPPPATH"] << "src/lib"
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
env.Program("test-shared.exe",
glob("src/*.c"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
env.Program("test-static.exe",
glob("src/**/*.c"))
end
env do |env|
env["CPPPATH"] << "src/lib"
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
env.Program("test-shared.exe",
glob("src/*.c"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
env.Program("test-static.exe",
glob("src/**/*.c"))
end
@@ -1,8 +1,6 @@
build do
Environment.new do |env|
File.open("foo.xyz", "wb") do |fh|
fh.puts("hi")
end
env.SharedObject("foo.o", "foo.xyz")
env do |env|
File.open("foo.xyz", "wb") do |fh|
fh.puts("hi")
end
env.SharedObject("foo.o", "foo.xyz")
end
@@ -1,7 +1,5 @@
build do
Environment.new do |env|
env["CPPPATH"] << "src/lib"
env.Object("file.S", "src/lib/one.c", "CFLAGS" => env["CFLAGS"] + ["-S"])
libmine = env.SharedLibrary("mine", "file.S")
end
env do |env|
env["CPPPATH"] << "src/lib"
env.Object("file.S", "src/lib/one.c", "CFLAGS" => env["CFLAGS"] + ["-S"])
libmine = env.SharedLibrary("mine", "file.S")
end
@@ -1,13 +1,11 @@
build do
Environment.new do |env|
env["CPPPATH"] << "src/lib"
libmine = env.SharedLibrary("mine", glob("src/lib/*.cc"))
env.Program("test-shared.exe",
glob("src/*.cc"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
env.Program("test-static.exe",
glob("src/**/*.cc"))
end
env do |env|
env["CPPPATH"] << "src/lib"
libmine = env.SharedLibrary("mine", glob("src/lib/*.cc"))
env.Program("test-shared.exe",
glob("src/*.cc"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
env.Program("test-static.exe",
glob("src/**/*.cc"))
end
+8 -10
View File
@@ -1,11 +1,9 @@
build do
Environment.new do |env|
env["CPPPATH"] << "src/lib"
libmine = env.SharedLibrary("mine", glob("src/lib/*.d"))
env.Program("test-shared.exe",
glob("src/*.c"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
end
env do |env|
env["CPPPATH"] << "src/lib"
libmine = env.SharedLibrary("mine", glob("src/lib/*.d"))
env.Program("test-shared.exe",
glob("src/*.c"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
end
@@ -1,7 +1,5 @@
build do
Environment.new do |env|
env["CPPPATH"] << "src/lib"
env.SharedObject("one.o", "src/lib/one.c")
libmine = env.SharedLibrary("mine", ["one.o", "src/lib/two.c"])
end
env do |env|
env["CPPPATH"] << "src/lib"
env.SharedObject("one.o", "src/lib/one.c")
libmine = env.SharedLibrary("mine", ["one.o", "src/lib/two.c"])
end
@@ -1,14 +1,12 @@
build do
Environment.new do |env|
env["CPPPATH"] << "src/lib"
env["SHLD"] = "gcc"
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
env.Program("test-shared.exe",
glob("src/*.c"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
env.Program("test-static.exe",
glob("src/**/*.c"))
end
env do |env|
env["CPPPATH"] << "src/lib"
env["SHLD"] = "gcc"
libmine = env.SharedLibrary("mine", glob("src/lib/*.c"))
env.Program("test-shared.exe",
glob("src/*.c"),
"LIBPATH" => %w[.],
"LIBS" => %w[mine])
env.build_after("test-shared.exe", libmine)
env.Program("test-static.exe",
glob("src/**/*.c"))
end
+2 -4
View File
@@ -1,5 +1,3 @@
build do
Environment.new do |env|
env.Program('simple.exe', Dir['*.c'])
end
env do |env|
env.Program('simple.exe', Dir['*.c'])
end
+14
View File
@@ -0,0 +1,14 @@
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
+11 -13
View File
@@ -1,15 +1,13 @@
build do
Environment.new(echo: :command) do |env|
tempdir = ENV["TEMP"] || ENV["TMP"] || "/tmp"
source_file = File.join(tempdir, "abs.c")
File.open(source_file, "w") do |fh|
fh.puts(<<-EOF)
int main()
{
return 29;
}
EOF
end
env.Program("abs.exe", source_file)
env(echo: :command) do |env|
tempdir = ENV["TEMP"] || ENV["TMP"] || "/tmp"
source_file = File.join(tempdir, "abs.c")
File.open(source_file, "w") do |fh|
fh.puts(<<-EOF)
int main()
{
return 29;
}
EOF
end
env.Program("abs.exe", source_file)
end
+9 -11
View File
@@ -10,15 +10,13 @@ class ThreadedTestBuilder < Rscons::Builder
end
end
build do
Environment.new do |env|
env.add_builder(ThreadedTestBuilder)
env.ThreadedTestBuilder("T3", [], "delay" => 3)
env.ThreadedTestBuilder("T2", [], "delay" => 1.0)
env.ThreadedTestBuilder("T1", [], "delay" => 0.5)
env.barrier
env.ThreadedTestBuilder("T6", [], "delay" => 1.5)
env.ThreadedTestBuilder("T5", [], "delay" => 1.0)
env.ThreadedTestBuilder("T4", [], "delay" => 0.5)
end
env do |env|
env.add_builder(ThreadedTestBuilder)
env.ThreadedTestBuilder("T3", [], "delay" => 3)
env.ThreadedTestBuilder("T2", [], "delay" => 1.0)
env.ThreadedTestBuilder("T1", [], "delay" => 0.5)
env.barrier
env.ThreadedTestBuilder("T6", [], "delay" => 1.5)
env.ThreadedTestBuilder("T5", [], "delay" => 1.0)
env.ThreadedTestBuilder("T4", [], "delay" => 0.5)
end
+15
View File
@@ -0,0 +1,15 @@
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
@@ -0,0 +1,13 @@
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
+3 -5
View File
@@ -1,6 +1,4 @@
build do
Environment.new do |env|
object = env.Object("simple.o", "simple.c")
env.Program("simple.exe", object)
end
env do |env|
object = env.Object("simple.o", "simple.c")
env.Program("simple.exe", object)
end
+4 -5
View File
@@ -3,9 +3,8 @@ class TestBuilder < Rscons::Builder
true
end
end
build do
Environment.new do |env|
env.add_builder(TestBuilder)
env.TestBuilder("file")
end
env do |env|
env.add_builder(TestBuilder)
env.TestBuilder("file")
end
Loaded 100 of 240 files, more files were not shown because too many files have changed in this diff. Show more