50 lines
1.3 KiB
Markdown
50 lines
1.3 KiB
Markdown
# c-md-template
|
|
|
|
A minimal, modern C project template using
|
|
[c-md](https://github.com/lohhiiccc/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](https://github.com/Snaipe/Criterion)
|
|
- Common targets: `all`, `clean`, `fclean`, `re`, `test`
|
|
- Easily extensible for larger projects
|
|
|
|
## Requirements
|
|
|
|
- C compiler (GCC or Clang recommended)
|
|
- [Criterion](https://github.com/Snaipe/Criterion) for unit testing
|
|
- [c-md](https://github.com/ton-livre/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
|
|
|
|
```sh
|
|
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](LICENSE)
|