This repository provides a template for a C project that includes support for building static libraries and executable binaries. The Makefile simplifies common build tasks.
- Compile source code into an executable binary
- Generate a static library
- Inspect the generated static library
- Debug builds and custom build targets
gcc
oricx
(or any compatible C compiler)make
- Optional:
gnuplot
for visualizations (if applicable)
To build the project and generate the executable binary:
make
After compiling, you can execute the program using:
make execute
To create a static library from the source code:
make lib
To view the symbols in the generated static library:
make inspect
To remove all compiled files and intermediate build artifacts:
make clean
To compile with debug flags:
make debug
If your project includes submodules or parts with their own Makefiles, build them with:
make build-other
If you have gnuplot
installed, you can generate visualizations such as PNG or GIF plots using:
make png
make gif
This template is designed to be flexible and can be customized to suit various C projects. The Makefile supports both gcc
and icx
compilers and can be easily extended for other tools or targets.
Written by Croyfet in 2022, updated in 2024 for improved functionality and usability.