Skip to content

Commit 601ac61

Browse files
committed
Update README.md
1 parent 68b4d59 commit 601ac61

1 file changed

Lines changed: 58 additions & 35 deletions

File tree

README.md

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ Designed to be simple, readable, and easy to extend, ideal for game engines, too
2020
## ⭐ Features
2121

2222
-**Cross-Platform**: Windows, Linux, macOS with automatic detection
23-
-**Debug & Release**: Configurations with proper optimization levels
24-
-**Architecture Optimization**: Architecture-specific optimization (`-march=native` by default)
23+
-**Build Types**: Multiple configurations (release, debug, relwithdebinfo, analyze) with proper optimization levels
24+
-**Architecture Optimization**: Architecture-specific optimization via `ARCH` variable (native, skylake, znver4, armv8-a, etc.)
25+
-**Link-Time Optimization (LTO)**: Control LTO with `USE_LTO` flag (enabled by default in release builds)
26+
-**Static Analysis**: Built-in `make analyze` target for static code analysis
2527
-**Dependency Tracking**: Automatic `.d` file generation
26-
-**Assembly Output**: Generate assembly files (`make asm`) and disassembly (`make disasm`)
28+
-**Assembly Output**: Generate assembly files (`make asm`) and disassembly (`make disassemble`)
2729
-**Parallel Builds**: Multi-core compilation support with automatic verbosity reduction
28-
-**Improved UI**: Better build output with status indicators
30+
-**Sanitizers**: AddressSanitizer and UndefinedBehaviorSanitizer support in debug builds (Linux/macOS)
31+
-**Improved UI**: Better build output with status indicators and build type information
2932
-**Two Templates**: Basic (simple) and Advanced (feature-rich)
3033

3134
## 🚩 Quick Start - Run the Examples
@@ -78,19 +81,21 @@ project/
7881
7982
## Main Commands
8083

81-
| Command | Description | When to use |
82-
| ----------------- | ----------------------------------------- | ------------------------------------- |
83-
| `make` | Release build (default target) | Everyday development |
84-
| `make release` | Explicit Release build with optimizations | Final/performance builds |
85-
| `make debug` | Debug build + symbols + sanitizers | Bug hunting, ASan/UBSan |
86-
| `make run` | Release build + execute binary | Quick testing |
87-
| `make run-debug` | Debug build + execute binary | Debugging sessions |
88-
| `make asm` | Generate Intel-syntax `.s` assembly files | Inspecting compiler output |
89-
| `make disasm` | Disassemble final binary (objdump) | Optimization / reverse engineering |
90-
| `make clean` | Remove objects, deps, asm, binary | Fresh start for current config |
91-
| `make full-clean` | Delete entire `./build/` directory | Changing compiler or major flags |
92-
| `make help` | Show help message | Quick reference |
93-
| `make info` | Show project configuration summary | Verify paths, compiler, sources count |
84+
| Command | Description | When to use |
85+
| -------------------- | ----------------------------------------- | ------------------------------------- |
86+
| `make` | Release build (default target) | Everyday development |
87+
| `make release` | Explicit Release build with optimizations | Final/performance builds |
88+
| `make debug` | Debug build + symbols + sanitizers | Bug hunting, ASan/UBSan |
89+
| `make relwithdebinfo`| Release with debug info (best of both) | Profiling with symbol debugging |
90+
| `make analyze` | Static analysis build | Code quality checks |
91+
| `make run` | Release build + execute binary | Quick testing |
92+
| `make run-debug` | Debug build + execute binary | Debugging sessions |
93+
| `make asm` | Generate Intel-syntax `.s` assembly files | Inspecting compiler output |
94+
| `make disassemble` | Disassemble final binary (objdump) | Optimization / reverse engineering |
95+
| `make clean` | Remove objects, deps, asm, binary | Fresh start for current config |
96+
| `make clean-all` | Delete entire `./build/` directory | Changing compiler or major flags |
97+
| `make help` | Show help message | Quick reference |
98+
| `make info` | Show project configuration summary | Verify paths, compiler, sources count |
9499

95100
## 🚀 Parallel / Multi-Core Builds (Recommended for Speed)
96101

@@ -124,35 +129,53 @@ make run -j12
124129

125130
These variables control the behavior of the project and can be overridden directly from the command line:
126131

127-
| Variable | Description | Default |
128-
| ---------------- | ------------------------------------- | ------------- |
129-
| **APP_NAME** | Output executable name (no extension) | `ProjectName` |
130-
| **SRC_EXT** | Source file extension | `cpp` |
131-
| **LANGUAGE** | C/C++ standard | `c++23` |
132-
| **CXX** | Compiler to use | `g++` |
133-
| **USE_CONSOLE** | Show console window on Windows | `true` |
134-
| **ARCH** | Target architecture (`-march=`) | `native` |
135-
| **LIBS** | Libraries to link (`-l`) | |
136-
| **LDFLAGS** | Library search paths (`-L`) | `-L./lib/` |
137-
| **SOURCE_DIRS** | Source directories | `src include` |
138-
| **INCLUDE_DIRS** | Include directories | `include` |
139-
| **OPT_RELEASE** | Optimization flags (Release) | `-O3` |
140-
| **OPT_DEBUG** | Optimization flags (Debug) | `-Og` |
132+
| Variable | Description | Default |
133+
| ---------------- | ---------------------------------------------- | ------------- |
134+
| **APP_NAME** | Output executable name (no extension) | `ProjectName` |
135+
| **SRC_EXT** | Source file extension | `cpp` |
136+
| **LANGUAGE** | C/C++ standard | `c++23` |
137+
| **CXX** | Compiler to use | `g++` |
138+
| **USE_CONSOLE** | Show console window on Windows | `true` |
139+
| **BUILD_TYPE** | Build variant (release/debug/relwithdebinfo) | `release` |
140+
| **USE_LTO** | Enable Link-Time Optimization | `true` |
141+
| **ANALYZE** | Enable static analysis flags | `false` |
142+
| **ARCH** | Target architecture (`-march=`) | `native` |
143+
| **LIBS** | Libraries to link (`-l`) | |
144+
| **LDFLAGS** | Library search paths (`-L`) | `-L./lib/` |
145+
| **SOURCE_DIRS** | Source directories | `src include` |
146+
| **INCLUDE_DIRS** | Include directories | `include` |
147+
| **OPT_RELEASE** | Optimization flags (Release) | `-O3` |
148+
| **OPT_DEBUG** | Optimization flags (Debug) | `-Og` |
141149

142150
```bash
143-
# Change name app
151+
# Change app name
144152
make APP_NAME=MyApp
145153

146-
# Use Clang++ and C++20 instead G++ and C++23 (Default values)
154+
# Use Clang++ and C++20 instead of G++ and C++23 (default values)
147155
make CXX=clang++ LANGUAGE=c++20
148156

149-
# Compile the $(APP_NAME) without console
157+
# Build without console window on Windows
150158
make release USE_CONSOLE=false
151159

152-
# Optimize for specific CPU
160+
# Optimize for specific CPU architecture
153161
make release ARCH=znver4 # AMD Zen 4
154162
make release ARCH=skylake # Intel 6th–9th gen
155163
make release ARCH=armv8-a # ARM (requires cross-compiler)
164+
165+
# Build with debug symbols and optimizations (best for profiling)
166+
make relwithdebinfo
167+
168+
# Build with static analysis enabled
169+
make ANALYZE=true release
170+
171+
# Debug build with all sanitizers and verbose output
172+
make debug VERBOSE=1
173+
174+
# Release build without Link-Time Optimization (faster linking)
175+
make release USE_LTO=false
176+
177+
# Parallel build with 8 cores (release configuration)
178+
make -j8 release
156179
```
157180

158181
### Adding libraries manually on Makefile (example: GLFW + OpenGL)

0 commit comments

Comments
 (0)