Giter Club home page Giter Club logo

ckit's Introduction

ckit

The little C kit

  • bin/ckit — tool for building and testing projects (calls cmake & ninja)
  • pkg/rbase — common functionality for C projects (optional to use)
  • example/hello/ — an example project
  • ckit.cmake — CMake routines

Quick install: (see Installing for details and options)

git clone https://github.com/rsms/ckit.git ~/ckit
cat << EOF >> ~/`[[ $SHELL == *"/zsh" ]] && echo .zshrc || echo .bashrc`
export CKIT_DIR=\$HOME/ckit
export PATH=\$PATH:\$CKIT_DIR/bin
EOF

bin/ckit

This multitool provides a few convenience commands:

  • ckit build or ckit — build project of current directory
  • ckit test — build & run tests
  • ckit watch — build & run as sources files change
  • ckit init — generate cmakelists.txt file for a project

See ckit -help for details or have a look at an example project

Installing

ckit can be installed in two ways:

  • Placed in a shared location, for example ~/ckit
  • "Vendored" as a subfolder in a project, for example myproject/ckit

Example of ckit installed in a shared location:

git clone https://github.com/rsms/ckit.git ~/ckit
export CKIT_DIR=$HOME/ckit
export PATH=$PATH:$CKIT_DIR/bin
mkdir ~/myproject
cd ~/myproject
echo "int main() { return 0; }" > hello.c
ckit init                # generate cmakelists.txt
ckit build               # build all targets
./out/debug/myproject    # run example program
ckit test                # build & run tests
ckit watch -r myproject  # build & run as sources change

Example of ckit as a subdirectory:

mkdir ~/myproject
cd ~/myproject
git clone https://github.com/rsms/ckit.git
echo "int main() { return 0; }" > hello.c
./ckit/bin/ckit init                # generate cmakelists.txt
./ckit/bin/ckit build               # build all targets
./out/debug/myproject               # run example program
./ckit/bin/ckit test                # build & run tests
./ckit/bin/ckit watch -r myproject  # build & run as sources change

Dependencies:

  • modern C shell like zsh, bash, ash or hush
  • modern C compiler like clang 10 or GCC 10 (one that supports C11)
  • ninja
  • cmake >=3.12

Additionally, the ckit watch command requires:

Note that you don't have to use bin/ckit. ckit packages are plain CMake projects and thus you can just use CMake if you want.

Notes

Some CMake reading:

ckit's People

Contributors

rsms avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.