Releases: DMsuDev/Basic-Makefile-Template
v1.2.2
v1.2.1 - Fixed Cross-Platform
Changes: Corrected configuration variables (LANGUAGE → CXX_STD), added FIXPATH for path normalization, and improved LIBS handling and ordering.
✨ What's Changed
- Fixed variable name: Replaced the incorrect
LANGUAGEvariable withCXX_STDacross the Makefile templates and examples. UseCXX_STDto set the C++ language standard (for example:CXX_STD = c++17). - Path normalization: Fixed the
FIXPATHmacro to normalize include and library paths on Windows and POSIX systems, preventing common path-related build failures.(Use now = instead of :=) - LIBS handling improvements: Sanitized and reordered
LIBSusage to avoid linker ordering issues, support optional/duplicate entries, and improve cross-platform link stability. - GitHub Actions: Added to build.yaml commands to install dependencies required for building
GLFWin Ubuntu environments.
v1.2.0
v1.2.0
Changes: New advanced CLI example (Task Manager) + improved makefile organization
✨ What's New
📋 New Example: Advanced CLI Task Manager
A complete, production-ready command-line task management system demonstrating:
- Object-Oriented Design: Task class with full lifecycle management
- Data Persistence: JSON-based storage using nlohmann/json (header-only)
- CLI Interface: Full command suite with help system
- Cross-Platform: Works on Windows, Linux, and macOS
- Uses Advanced Makefile Template: Shows full capabilities with debug, release, analyze targets
Features:
- ✅ Create, read, update, delete tasks (CRUD operations)
- ✅ Priority levels (Low, Medium, High)
- ✅ Statistics dashboard
- ✅ Persistent storage in user's home directory
- ✅ Rich terminal output with symbols and formatting
Location: examples/task-manager/
Quick Start:
# Build and display help
make run-tm
# Or build separately
make task-manager
./examples/task-manager/build/app/tm🎯 WARN_LEVEL Configuration
Control compiler warning strictness with three levels:
| Level | Flags | Best For |
|---|---|---|
| minimal | Base warnings only | Legacy code, third-party libraries |
| normal | + Type conversion, logic, safety | Standard development (recommended) |
| strict | + Code quality (-Wshadow, -Wunused) |
New projects, CI/CD pipelines (default) |
🔗 Automatic LTO Optimization
Compiler-aware LTO selection (no configuration needed):
| Compiler | LTO Type | Benefit |
|---|---|---|
| Clang/clang++ | -flto=thin |
Faster compilation, fewer issues |
| GCC/g++ | -flto=auto |
Better optimization |
📦 Examples Summary
| Example | Type | Purpose | Location |
|---|---|---|---|
| Donut | CLI | 3D ASCII animation in terminal | examples/donut-basic/ |
| ImGui | GUI | Modern graphical UI demo | examples/ImGui/ |
| Task Manager | CLI | Advanced task management system | examples/task-manager/ |
All examples support advanced Makefile features: debug/release builds, static analysis, profiling, and cross-platform compilation.
v1.1.0 - New features
🎉 v1.1.0 - Enhanced Build System & Consistency Update
🔄 What's Changed
Core Improvements
- Enhanced Makefile Architecture: Unified configuration system with
BUILD_TYPE,OPT_RELEASE,OPT_DEBUGvariables for better control - Better Platform Detection: Improved cross-platform support with automatic
HOST_ARCHandTARGET_ARCHdetection (Was improved) - Link-Time Optimization (LTO): New
USE_LTOflag for release builds with automatic-flto=autosupport
Compiler & Optimization
- Extended Compiler Flags: Added
-Wconversion,-Wsign-conversion,-Wdouble-promotionand more validation flags - Four Build Variants:
release,debug,relwithdebinfo,analyzefor different scenarios - Static Analysis: New
analyzetarget with-fanalyzersupport
Sanitizers & Debugging
- Improved Sanitizers: Platform-aware sanitizer flags (ASAN/UBSAN on Linux, different on macOS)
- Debug Symbols: Automatic
-ggdb3symbols in debug and relwithdebinfo builds - Debug Defines: Proper
-DDEBUG,-D_GLIBCXX_DEBUG,-DNDEBUGdefines per build type
User Experience
- Improved UI: New
TITLE_COLORandLINES_COLORfor better visual hierarchy - Verbose Mode: Smart detection of silent mode (
-sflag) and parallel builds (-jflag) - Better Output: Enhanced compilation messages with
[✓][OK]and[FAILED]status indicators - Build Information: Added
BUILD_TYPEdisplay in build banner
Build Configuration
- Extended Phony Targets: Explicit phony targets for all goals (debug, release, relwithdebinfo, analyze)
- Dependency Analysis: New
depsandgraph-depstargets for source dependency inspection - Consistent Directory Naming: Standardized to
build/appfor executables (consistent with v1.0.3) - Sed Handling: Platform-specific SED for macOS (
sed -i '') and other systems
✨ New Features
BUILD_TYPE=relwithdebinfo- Release optimizations + debug symbols for profilingANALYZE=true- Enable static analysis without building full debug binaryUSE_LTO=true/false- Control Link-Time Optimization (default: true for release)VERBOSE=0/1- Silent or detailed build output (auto-detected frommake -sand-j)depstarget - Show source and object file counts + dependenciesgraph-depstarget - Visualize dependency relationships- Better error handling with
2>/dev/null || truepatterns TARGET_ARCHvariable showing what architecture will be targeted
🛠️ Technical Enhancements
-
Platform-Specific Sanitizers:
- Linux: AddressSanitizer + UBSan with recovery
- macOS: AddressSanitizer + UBSan
- Windows: Disabled (MinGW limitations)
-
Optimization Chains:
- Release:
-O3 -DNDEBUG -march=<arch> -flto=auto - Debug:
-Og -ggdb3 -DDEBUG -D_GLIBCXX_DEBUG + sanitizers - RelWithDebInfo:
-O2 -ggdb3 -DNDEBUG -DRELWITHDEBINFO
- Release:
-
Command Detection:
- Powers detection via
PowerShell -NoProfile -Command(Windows) - uname for macOS and Linux
- Powers detection via
📝 Updated Targets
| Target | Change |
|---|---|
all |
Better error message when no sources found |
debug |
Now uses BUILD_TYPE system + sanitizers |
release |
Cleaner output with success messages |
relwithdebinfo |
NEW - Perfect for profiling |
analyze |
NEW - Static analysis without debug |
asm/disassemble |
Better color-coded output |
clean-all |
Renamed from full-clean for consistency |
help |
Completely redesigned with better examples |
info |
Enhanced with BUILD_TYPE and LTO status |
🔄 Breaking Changes
full-clean→clean-all(rename for consistency)- Sanitizers now part of BUILD_TYPE system (not manual flags)
disasm→disassemble(better naming)
📦 Files Updated
- ✅
templates/advanced/makefile- Core template - ✅
examples/ImGui/makefile- Now fully synced with advanced template
v1.0.2 - New `makefile` for Examples & Fixes
✨ What's Changed
Changes
- Change old ImGui example of Win32 to new ImGui example of GLFW + OpenGL32
- New logic in
makefilestemplates & examples to automatically detect platform and set appropriate compiler and flags - Updated commons
LIBSvariables inmakefilesdepending on platform (Windows, Linux)
Added
- Added a
makefileon root directory for easier compilation of examples
v1.0.1
v1.0.1 - Fixes & Improvements
Small maintenance release focusing on code quality, correctness and consistency. No breaking changes.
✨ What's Changed
Changes
- Refactored luminance (illumination) calculation in
renderFrame - More accurate and cleaner lighting model for the spinning donut (better visual quality)
- Changed default
APP_NAMEvalue in the basic template
Fixes
- Fixed incorrect / inconsistent variable assignments in
makefiles(?=,:=, etc.)
Now all templates (basic, advanced) and examples use correct conditional defaults
Easier and safer overriding from command line
Added
- Dear ImGui license file to
examples/ImGui
Happy coding! ❤️
— DMsuDev
v1.0.0
🎉 Modern C/C++ Makefile Template v1.0.0
A lightweight, cross-platform Makefile template for modern C/C++ projects.
Supports Windows (MinGW-w64/MSYS2), Linux, and macOS (macOS support is experimental).
Perfect for small-to-medium applications, CLI tools, learning projects, game prototypes, or as a simple alternative to CMake.
🚀 Quick Start
Option 1: Start a new project (recommended)
Copy the template you want (replace "my-project" with your name)
# Linux/macOS/WSL/Git Bash
cp -r templates/advanced my-project
cd my-project
# or on Windows (cmd/PowerShell):
xcopy /E /I templates\advanced my-project
cd my-projectThen build & run
# Linux / macOS / Git Bash / WSL
make run
# or (Windows cmd / PowerShell / MinGW prompt)
mingw32-make run2. Try the Examples
Steps to build & run any example:
# Enter the example folder (pick one)
cd examples/donut-basic
# or
cd examples/ImGui
# Build & run
make run # Linux / macOS / Git Bash / WSL
# or (most common on plain Windows cmd/PowerShell)
mingw32-make runMore commands: make debug, make clean, make help, make info, make asm, make disasm...
Full customization and command list → see the main README.md
📁 What's included
templates/basic→ minimalMakefile(~130 lines)templates/advanced→ full-featured with ANSI colors, sanitizers, parallel builds, asm output...examples/donut-basic→ spinning ASCII donut (classic demo)examples/ImGui→ Dear ImGui + DirectX12 windowed example (Windows only)
Thanks for trying it out!
Happy coding! ❤️
— DMsuDev