Minimal C-md project template featuring a portable Makefile, unit test integration, and clear folder structure.
Find a file Use this template
2026-01-12 19:41:21 +01:00
includes Initial commit 2026-01-12 19:41:21 +01:00
srcs Initial commit 2026-01-12 19:41:21 +01:00
tests Initial commit 2026-01-12 19:41:21 +01:00
.gitignore Initial commit 2026-01-12 19:41:21 +01:00
LICENSE Initial commit 2026-01-12 19:41:21 +01:00
Makefile Initial commit 2026-01-12 19:41:21 +01:00
README.md Initial commit 2026-01-12 19:41:21 +01:00
sources.mk Initial commit 2026-01-12 19:41:21 +01:00

c-md-template

A minimal, modern C project template using c-md for literate programming. Features a portable Makefile, clear directory structure, and unit testing with Criterion.

Features

  • Literate source files (.c.md and .h.md) extracted automatically using the c-md transpiler
  • Modern portable Makefile with full dependency handling
  • Example structure: srcs/, includes/, tests/
  • Unit test setup with Criterion
  • Common targets: all, clean, fclean, re, test
  • Easily extensible for larger projects

Requirements

  • C compiler (GCC or Clang recommended)
  • Criterion for unit testing
  • c-md transpiler

Directory Structure

.
|-- includes/          # Header files (.h.md)
|-- srcs/              # Source files (.c.md)
|-- tests/             # Unit test files (plain C)
|-- Makefile
|-- sources.mk

Usage

Build and Test

make           # Transpile and compile the project (outputs a.out)
make test      # Build and run unit tests
make clean     # Remove object files
make fclean    # Remove all build artifacts and binaries
make re        # Full rebuild

Add your source and header files in sources.mk to scale the project.

License

MIT