Autobuild is a simple Python script to build a simple C++ program based on one file or all files in the same directory, which aims to fit the interfaces of editors, such as Visual Studio Code.
- Python 3
- A C++ Compiler (G++ or some compiler compatible)
- Make
It is recommended on Windows to install Autobuild with Scoop.
-
Add the bucket Orihime 1 to Scoop (if you have never done so):
scoop bucket add orihime https://github.com/YangHanlin/OrihimeFirst
-
Install Autobuild with one command:
scoop install orihime/autobuild-insider # stable version not available yet
-
Run command
autobuild(instead ofautobuild.py, because Scoop actually creates a shim namedautobuild) to check, which, if configured correctly, will result in the following output:usage: autobuild.py [-h] -t TARGET [-d DIR] [-c FLAGS] [-m FLAGS] [-V] SOURCE autobuild.py: error: the following arguments are required: SOURCE, -t/--target
If you do not have Scoop installed or you are not working on Windows, you can also perform installation steps manually.
-
Clone (which is recommended because it enables you to stay updated) or download the repository;
-
Add path of the directory containing downloaded files into the
PATHenvironment variable; -
Run command
autobuild.pyto check, which, if configured correctly, will result in the following output:usage: autobuild.py [-h] -t TARGET [-d DIR] [-c FLAGS] [-m FLAGS] [-V] SOURCE autobuild.py: error: the following arguments are required: SOURCE, -t/--target
Find the configuration file .autobuildrc in your user home directory (%USERPROFILE% on Windows or $HOME on *nix), open and edit it:
-
Check whether the value of
cc, which indicates the command to invoke the compiler, by defaultg++, works as a compiler and as desired. If your desired compiler is not compatible withg++, modifycc-flagsas well to fit your compiler’s interface. -
Check whether the value of
make, which indicated the command to invoke Make and is by defaultmake, works as desired. You may addmake-flagsto define the flags passed to Make by default.
$ autobuild.py --help
usage: autobuild.py [-h] -t TARGET [-d DIR] [-c FLAGS] [-m FLAGS] [-V] SOURCE
A simple cross-platform build script for C++.
positional arguments:
SOURCE filename or path of (one of) the source file(s)
optional arguments:
-h, --help show this help message and exit
-t TARGET, --target TARGET
filename or path of the built target
-d DIR, --change-dir DIR
change the working directory to the specified one
before building
-c FLAGS, --cc-flags FLAGS
additional flags passed to the compiler
-m FLAGS, --make-flags FLAGS
additional flags passed to Make
-V, --version show version information and exit
All content in this repository, unless otherwise noted, is licensed under the GNU General Public License 3.0 (GPLv3).