Skip to content

Releases: DMsuDev/Basic-Makefile-Template

v1.2.2

10 Feb 03:47

Choose a tag to compare

Fixes

Added -lGL for Linking the example of ImGui on Linux

v1.2.1 - Fixed Cross-Platform

10 Feb 03:27

Choose a tag to compare

Changes: Corrected configuration variables (LANGUAGECXX_STD), added FIXPATH for path normalization, and improved LIBS handling and ordering.

✨ What's Changed

  • Fixed variable name: Replaced the incorrect LANGUAGE variable with CXX_STD across the Makefile templates and examples. Use CXX_STD to set the C++ language standard (for example: CXX_STD = c++17).
  • Path normalization: Fixed the FIXPATH macro 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 LIBS usage 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 GLFW in Ubuntu environments.

v1.2.0

06 Feb 04:20

Choose a tag to compare

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

05 Feb 23:46

Choose a tag to compare

🎉 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_DEBUG variables for better control
  • Better Platform Detection: Improved cross-platform support with automatic HOST_ARCH and TARGET_ARCH detection (Was improved)
  • Link-Time Optimization (LTO): New USE_LTO flag for release builds with automatic -flto=auto support

Compiler & Optimization

  • Extended Compiler Flags: Added -Wconversion, -Wsign-conversion, -Wdouble-promotion and more validation flags
  • Four Build Variants: release, debug, relwithdebinfo, analyze for different scenarios
  • Static Analysis: New analyze target with -fanalyzer support

Sanitizers & Debugging

  • Improved Sanitizers: Platform-aware sanitizer flags (ASAN/UBSAN on Linux, different on macOS)
  • Debug Symbols: Automatic -ggdb3 symbols in debug and relwithdebinfo builds
  • Debug Defines: Proper -DDEBUG, -D_GLIBCXX_DEBUG, -DNDEBUG defines per build type

User Experience

  • Improved UI: New TITLE_COLOR and LINES_COLOR for better visual hierarchy
  • Verbose Mode: Smart detection of silent mode (-s flag) and parallel builds (-j flag)
  • Better Output: Enhanced compilation messages with [✓][OK] and [FAILED] status indicators
  • Build Information: Added BUILD_TYPE display in build banner

Build Configuration

  • Extended Phony Targets: Explicit phony targets for all goals (debug, release, relwithdebinfo, analyze)
  • Dependency Analysis: New deps and graph-deps targets for source dependency inspection
  • Consistent Directory Naming: Standardized tobuild/app for 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 profiling
  • ANALYZE=true - Enable static analysis without building full debug binary
  • USE_LTO=true/false - Control Link-Time Optimization (default: true for release)
  • VERBOSE=0/1 - Silent or detailed build output (auto-detected from make -s and -j)
  • deps target - Show source and object file counts + dependencies
  • graph-deps target - Visualize dependency relationships
  • Better error handling with 2>/dev/null || true patterns
  • TARGET_ARCH variable 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
  • Command Detection:

    • Powers detection via PowerShell -NoProfile -Command (Windows)
    • uname for macOS and Linux

📝 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-cleanclean-all (rename for consistency)
  • Sanitizers now part of BUILD_TYPE system (not manual flags)
  • disasmdisassemble (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

27 Jan 02:21

Choose a tag to compare

✨ What's Changed

Changes

  • Change old ImGui example of Win32 to new ImGui example of GLFW + OpenGL32
  • New logic in makefiles templates & examples to automatically detect platform and set appropriate compiler and flags
  • Updated commons LIBS variables in makefiles depending on platform (Windows, Linux)

Added

  • Added a makefile on root directory for easier compilation of examples

v1.0.1

21 Jan 20:45

Choose a tag to compare

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_NAME value 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

21 Jan 05:58
3b3da73

Choose a tag to compare

🎉 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-project

Then build & run

# Linux / macOS / Git Bash / WSL
make run
# or (Windows cmd / PowerShell / MinGW prompt)
mingw32-make run

2. 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 run

More 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 → minimal Makefile (~130 lines)
  • templates/advanced → full-featured with ANSI colors, sanitizers, parallel builds, asm output...
  • examples/donut-basic → spinning ASCII donut (classic demo)
  • examples/ImGuiDear ImGui + DirectX12 windowed example (Windows only)

Thanks for trying it out!

Happy coding! ❤️

DMsuDev