add Getting Started section
This commit is contained in:
parent
8222958ae3
commit
dbd8b47bf9
@ -73,6 +73,13 @@ files, dependency files, etc...) in a `build` directory.
|
|||||||
This keeps files generated by the build cleanly separated from user-controlled
|
This keeps files generated by the build cleanly separated from user-controlled
|
||||||
source files.
|
source files.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
To use Rscons on your project, you must:
|
||||||
|
|
||||||
|
1. Install the `rscons` script in your project (See [#Installation]).
|
||||||
|
2. Write the `Rsconscript` build script for your project (See [#The Build Script]).
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
Rscons is designed to be distributed as a stand-alone single file script that
|
Rscons is designed to be distributed as a stand-alone single file script that
|
||||||
@ -90,7 +97,7 @@ The following files should be added to source control:
|
|||||||
* `rscons`
|
* `rscons`
|
||||||
* `Rsconscript`
|
* `Rsconscript`
|
||||||
|
|
||||||
Add the following line to `.gitignore` (or the equivalent thereof for different
|
Add the following contents to `.gitignore` (or the equivalent thereof for different
|
||||||
version control systems):
|
version control systems):
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -98,26 +105,6 @@ version control systems):
|
|||||||
/build/
|
/build/
|
||||||
```
|
```
|
||||||
|
|
||||||
# The Build Script
|
|
||||||
|
|
||||||
Rscons looks for instructions for what to build by reading a build script file
|
|
||||||
called `Rsconscript` (or `Rsconscript.rb`).
|
|
||||||
Here is a simple example `Rsconscript` file:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
build do
|
|
||||||
Environment.new do |env|
|
|
||||||
env.Program("myprog.exe", glob("src/**/*.c"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
This `Rsconscript` file would instruct Rscons to produce a *Program* target
|
|
||||||
called `myprog.exe` which is to be built from all C source files found
|
|
||||||
(recursively) under the `src` directory.
|
|
||||||
|
|
||||||
The `Rsconscript` file is a Ruby script.
|
|
||||||
|
|
||||||
# Command-Line Operation
|
# Command-Line Operation
|
||||||
|
|
||||||
Rscons is typically invoked from the command-line as `./rscons`.
|
Rscons is typically invoked from the command-line as `./rscons`.
|
||||||
@ -179,7 +166,25 @@ An `uninstall` operation will remove any items installed by an `install`
|
|||||||
operation.
|
operation.
|
||||||
It will not remove all built target files, just the installed copies.
|
It will not remove all built target files, just the installed copies.
|
||||||
|
|
||||||
# Writing the Build Script
|
# The Build Script
|
||||||
|
|
||||||
|
Rscons looks for instructions for what to build by reading a build script file
|
||||||
|
called `Rsconscript` (or `Rsconscript.rb`).
|
||||||
|
Here is a simple example `Rsconscript` file:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
build do
|
||||||
|
Environment.new do |env|
|
||||||
|
env.Program("myprog.exe", glob("src/**/*.c"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
This `Rsconscript` file would instruct Rscons to produce a *Program* target
|
||||||
|
called `myprog.exe` which is to be built from all C source files found
|
||||||
|
(recursively) under the `src` directory.
|
||||||
|
|
||||||
|
The `Rsconscript` file is a Ruby script.
|
||||||
|
|
||||||
## Configuration Operations
|
## Configuration Operations
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user