Page cover

My template for C Projects

I've established a standardized project structure to maintain consistency and efficiency across all my work. This foundation ensures coherence while significantly reducing setup time for new projects.

You can explore my template structure on Github, though this approach works equally well on other development platforms.

.
├── .clang-format
├── .git
├── .github
│   └── workflows
│       └── build.yaml
├── .gitignore
├── include
│   └── template.h
├── LICENSE
├── Makefile
├── README.md
└── src
    └── main.c

I will present to you the contents of my Makefile and the github workflow which defines the CI pipeline runs when code changes and should make sure all of your changes work with the rest of the code when it's integrated. And finally I show you how to create a template on github.

Content of my template

Makefile

Github Workflow

This GitHub Actions pipeline runs on push or pull requests to the main branch. It uses an Ubuntu environment to clone the repository, install essential build tools, and then format the code with the make format command.

By the way i also added a MIT LICENSE.arrow-up-right

A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

MIT LICENSE

Setup Your Github Template

  1. Create a GitHub repository named "random-template."

  2. Add the content that will make up your template to the repository. Commit and push your changes.

  3. Go to the repository's Settings and check the box labeled "Template repository."

  4. Now, anyone (including you) can generate a new repository using this template.

Last updated