c-template/README.md
2026-01-11 21:24:49 +01:00

1.1 KiB

c-template

A minimal, clean, and reusable C project template with unit testing support (Criterion), portable Makefile, and clear directory organization.

Features

  • Modern portable Makefile (with dependency management)
  • Example source and header structure (srcs/, includes/)
  • Unit test setup using Criterion
  • Ready-to-use targets: all, clean, fclean, re, test
  • Easily extensible for larger C projects

Getting Started

Requirements

  • A C compiler (GCC or Clang recommended)
  • Criterion for unit tests

Build and Run

make           # Build the main binary
make test      # Build and run unit tests
make clean     # Remove object files
make fclean    # Full clean (object files + binaries)
make re        # Full rebuild

Edit sources.mk to add your source and test files as the project grows.

Directory Structure

.
├── includes/      # Header files
├── srcs/          # Source files
├── tests/         # Unit test sources
├── Makefile
├── sources.mk

License

MIT