Git Product home page Git Product logo

cctask's Introduction

CCTask

A XBuild/MSBuild task to compile C sources by Konrad Kruczyński.

What is it?

So, at this moment this is just more or less a construction site ;) What I like to have here in the future is the XBuild/MSBuild task that enables you to compile C sources on Linux, Windows or Mac. So, for example, if you have C# project that uses native binaries, you can compile it within xbuild. That's all ;)

What it can do now?

Currently the task is Linux only. This is my usually used environment, so I've started there. The task is able to compile simple C programs. You provide list of sources, flags and output name, the task compiles (look at the example). Moreover:

  • Object files (.o) that are created during compilation are in the buildcache_{output_file_name} subdirectory of the directory that the contains mentioned output. They are reused on recompilation if possible. In other words if you have three source files, compile, then modify one of them, only one is recompiled (also the linking process happens again). So, this works as make with the difference that make uses modification dates and I'm using hashes of the sources (also stored in the buildcache directory). Props to Peter Giełda for the idea.
  • Compilation is done using all your cores. Because compilation of each translation unit is independent from the other ones, we can compile them in parallel. This is what I do; again, this is more or less what make does with the -j switch, here it is done by default and automatically.
  • gcc -MM is used to obtain dependencies for source files (or rather for object files), header files in particular. So yes, if you modify a header file, all files including that header will be rebuilt.

Example

You can find sample project (three C files compiled to nothing-doing program) in the Testing project subdirectory. Go to that directory and run:

xbuild test.proj

and see what happens.

Want more?

Write an issue, do a pull request.

Licence

The project uses the MIT licence as you can tell from the source code.

cctask's People

Contributors

konrad-kruczynski avatar mateusz-holenko avatar

Watchers

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