Minimal C-md project template featuring a portable Makefile, unit test integration, and clear folder structure.
| includes | ||
| srcs | ||
| tests | ||
| .gitignore | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| sources.mk | ||
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.mdand.h.md) extracted automatically using thec-mdtranspiler - 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
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.