1.9 KiB
1.9 KiB
makemake is a pure POSIX-compliant (.POSIX), multi-threaded build template for C projects. It utilizes a dynamic build graph generator, requires zero GNU or BSD extensions, and runs natively on any standard UNIX shell (/bin/sh).
Quick Start
- Place
.cfiles insource_code/and.hfiles inincludes/. - Run
make initonce to bootstrap the project layout. - Run
make -j8 debugto compile incrementally and in parallel.
Make Targets
| Target | Description |
|---|---|
make / make help |
Prints basic usage instructions and target overviews. |
make init |
Creates required project directories (source_code, includes, output, config) and starter templates. |
make debug |
Dynamically builds a parallel-safe dependency graph and compiles using DEBUG_FLAGS (-g3, -O0, UBSan). |
make fast |
Compiles an optimized release build using RELEASE_FLAGS (-O2, -s, NDEBUG) without modifying the version string. |
make release |
Bumps the version using an automated timestamp (_YY.DAY.HH.MMSS) and compiles an optimized release binary. |
make clean |
Wipes the output/ directory and temporary build scripts inside config/. |
Customization Guide
- How to change the compiler: Edit the
CC = gccvariable at the top of the file to useclangor other compilers. - How to change the C standard being used: Locate
CFLAGSand modify-std=c17to your preferred standard (e.g.,-std=c11,-std=c99) etc. - Modifying Warning Strictness: Add, or remove specific flags within the
CFLAGSblock. Removing-Werrorwill allow compilation to continue past warnings. - Linking External Libraries (e.g., Raylib): Locate the
debug,fast, andreleasetargets in the Makefile. Find the final linking step ($(CC) $(CFLAGS) ... -o $$OUT $$OBJS) and append your static library paths or system link flags (e.g.,-lraylib -lGL -lm -lpthread -ldl -lrt -lX11).