Like the go
tool for Go, this is intended to be a simple tool for C which
allows for managing C codebases.
Planned commands:
-
build
: build C projects which abide by a specific structure.See
doc/cbuild.md
for details. -
fmt
: formats C code automatically. Whatever style I end up defining this to format will essentially be the "canonical" format for code using this tool. -
doc
: generates HTML documentation from C code and (optionally) opens the web browser to the output folder. -
run
: compiles and runs the specified program. -
version
: prints the version of thec
tool and compiler being used. -
test
: Compiles and runs tests, but I don't know exactly how we'll do that for now.See my encoding project for an idea of what I'm thinking of.
-
export
: Generates amalgamations for every module, then generates ameson.build
compatible-project which builds everything, converting module imports to subprojects (with wraps if needed).After this process is done, it should be possible to either use a
meson
-compatible build system to build your library or excutable on any supported OS.This is what you would put up for download as a "release", so no one needs this tool to build from source or make use of your library.
-
tool
: Compiles and runs a tool from thetools/
subdirectory of the project.In the
tools/
subdirectory, each.c
file or directory will be built as a binary (following the same rules assrc/cmd
), and their name will be the name of the tool which can be run withc tool X
assumingX
is the tool's name. -
compile
: Runs the C compiler which would be used if you ranc build
.For example, if I'm using
clang
as my compiler,c compile --version
should print something likeUbuntu clang version 14.0.0-1ubuntu1.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
On my home computer.
Public Domain or 0-Clause BSD. The 0BSD license is included in the LICENSE
file in the repository's root.