Cork is a build tool designed to streamline the process of managing, building, and running C projects, inspired by Rust's Cargo. It aims to provide a simple, consistent, and efficient way to handle project initialization, building, running, and cleaning for C developers.
- Project Initialization: Create a new C project with a predefined directory structure.
- Build System: Compile your C code into executables with ease.
- Run: Build and run your project with one command.
- Clean: Remove build artifacts to keep your project directory clean.
- Git Integration: Automatically initializes a Git repository for version control.
- Rust and Cargo installed on your system (installation guide)
- GCC (or any C compiler that responds to the
gcccommand)
To install cork, you'll need to build it from source:
git clone <repository-url>
cd cork
cargo build --releaseThe binary will be located in the target/release directory. You can then move the binary to a directory in your $PATH or use it directly from there.
Here's how to use cork for different operations:
- Create a new project:
cork new <project-name>-Build the project:
cork build
# or for a release build
cork build --release- Run the project:
cork run- Clean build artifacts:
cork clean- Short aliases for commands:
cork bforbuildcork rforruncork cforclean
Cork expects and creates the following project structure:
myproject/
├── src/
│ ├── main.c
│ └── include/ # Private headers
│ └── internal.h
├── include/ # Public headers
│ └── myproject.h
├── tests/
│ └── test_main.c
├── Cork.toml
└── .gitignore
cork new <project-name>: Generates a new project directory with the basic structure.cork build [--release]: Compiles the project. Use--releasefor optimized builds.cork run [--release]: Builds (if necessary) and runs the project.cork clean: Removes thebuilddirectory, cleaning up all build artifacts.
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a pull request