2.0 KiB
Basic Overview
makemake is a lightweight/dependency-free C build system built entirely around standard POSIX tools. It brings a python-style virtual environment to your C projects using a simple shell script. It tracks your compiler, linker flags, project version, and build options in a local state file without needing cmake or other heavy build generators.
Example Use
To get started with a fresh project, create your directory and run the initialization command:
make init
Next, activate your virtual environment by sourcing the configuration script into your current shell session:
. config/activate (or source config/activate — the former is simply POSIX compliant).
Once you are inside the environment, you can run your builds and clean up whenever you want:
make debug
make build
make clean
What Each Build Target Does
- init sets up the required folder structure and generates the activation script.
- debug compiles your code using your configured debug flags (typically with debug symbols enabled and optimization turned off).
- build compiles your code using your configured build flags (typically used for optimized production binaries).
- clean removes all intermediate object files, generated makefiles, and output binaries.
Example env_set Commands
You can adjust your toolchain, compiler options, and project version dynamically using the env_set function while the environment is active.
Example uses:
env_set CC ccenv_set VERSION _v1.0.0env_set CFLAGS -std=c17 -pedantic -Wall -Wextraenv_set DEBUG_FLAGS -g3 -O0env_set BUILD_FLAGS -O2 -DNDEBUGenv_set LIBS -lm
Tips
- If you update a
.hfile you MUST do amake cleanbefore building again, otherwise the header changes will not be used. - If you remove a
.cfile, you MUST do amake cleanor manually remove.ofiles, otherwise they will never be wiped (even if they are no longer linked, it will just waste some disk-space).