Skip to content

kczimm/cork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cork: A Build System for C Projects

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.

Features

  • 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.

Getting Started

Prerequisites

  • Rust and Cargo installed on your system (installation guide)
  • GCC (or any C compiler that responds to the gcc command)

Installation

To install cork, you'll need to build it from source:

git clone <repository-url>
cd cork
cargo build --release

The 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.

Usage

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 b for build
  • cork r for run
  • cork c for clean

Project Structure

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

Commands Overview

  • cork new <project-name>: Generates a new project directory with the basic structure.
  • cork build [--release]: Compiles the project. Use --release for optimized builds.
  • cork run [--release]: Builds (if necessary) and runs the project.
  • cork clean: Removes the build directory, cleaning up all build artifacts.

Contributing

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

About

a build tool for C built in Rust inspired by Cargo

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages