Skip to content

Commit 41fbc34

Browse files
committed
chore: Update default WARN_LEVEL to minimal in makefiles
1 parent 2645367 commit 41fbc34

File tree

5 files changed

+53
-50
lines changed

5 files changed

+53
-50
lines changed

README.md

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ make help
6767

6868
## 📁 Build Output Structure (v1.0.3+)
6969

70-
```
70+
```txt
7171
project/
7272
├── build/
7373
│ ├── app/ ← Executables
@@ -81,21 +81,21 @@ project/
8181
8282
## Main Commands
8383

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 |
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 |
9999

100100
## 🚀 Parallel / Multi-Core Builds (Recommended for Speed)
101101

@@ -129,24 +129,24 @@ make run -j12
129129

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

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-
| **WARN_LEVEL** | Warning strictness (minimal/normal/strict) | `strict` |
144-
| **LIBS** | Libraries to link (`-l`) | |
145-
| **LDFLAGS** | Library search paths (`-L`) | `-L./lib/` |
146-
| **SOURCE_DIRS** | Source directories | `src include` |
147-
| **INCLUDE_DIRS** | Include directories | `include` |
148-
| **OPT_RELEASE** | Optimization flags (Release) | `-O3` |
149-
| **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+
| **WARN_LEVEL** | Warning strictness (minimal/normal/strict) | `minimal` |
144+
| **LIBS** | Libraries to link (`-l`) | |
145+
| **LDFLAGS** | Library search paths (`-L`) | `-L./lib/` |
146+
| **SOURCE_DIRS** | Source directories | `src include` |
147+
| **INCLUDE_DIRS** | Include directories | `include` |
148+
| **OPT_RELEASE** | Optimization flags (Release) | `-O3` |
149+
| **OPT_DEBUG** | Optimization flags (Debug) | `-Og` |
150150

151151
```bash
152152
# Change app name
@@ -185,11 +185,11 @@ Control compiler warning strictness with the **`WARN_LEVEL`** variable. Perfect
185185

186186
### Available Levels
187187

188-
| Level | Flags | Use Case |
189-
|-------|-------|----------|
190-
| **minimal** | Base warnings only (`-Wall -Wextra -pedantic-errors`) | Legacy code, third-party libraries |
191-
| **normal** | + Type conversion, logic, and safety checks | Standard development (recommended) |
192-
| **strict** | + Code quality warnings (`-Wshadow`, `-Wunused`, etc) | New projects, CI/CD pipelines (default) |
188+
| Level | Flags | Use Case |
189+
| ----------- | ----------------------------------------------------- | --------------------------------------- |
190+
| **minimal** | Base warnings only (`-Wall -Wextra -pedantic-errors`) | Legacy code, third-party libraries |
191+
| **normal** | + Type conversion, logic, and safety checks | Standard development (recommended) |
192+
| **strict** | + Code quality warnings (`-Wshadow`, `-Wunused`, etc) | New projects, CI/CD pipelines (default) |
193193

194194
### Examples
195195

@@ -204,19 +204,22 @@ make WARN_LEVEL=normal CXX=clang++ -j8
204204
### What Each Level Includes
205205

206206
**minimal:**
207-
```
207+
208+
```txt
208209
-Wall -Wextra -pedantic-errors
209210
```
210211

211212
**normal** (minimal +):
212-
```
213+
214+
```txt
213215
-Wconversion -Wsign-conversion -Wdouble-promotion
214216
-Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict
215217
-Wnull-dereference -Wformat=2 -Wunreachable-code
216218
```
217219

218220
**strict** (normal +):
219-
```
221+
222+
```txt
220223
-Wshadow -Wunused -Wunused-parameter
221224
```
222225

examples/ImGui/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ DOC_BUILD := $(BUILD_BASE)/docs
4848
# ─── Compiler Configuration ───────────────────────────────────────────────────
4949

5050
# Warning Level Configuration
51-
# Options: minimal, normal, strict (default: strict)
51+
# Options: minimal, normal, strict (default: minimal)
5252
# - minimal: Only -Wall -Wextra -pedantic-errors
5353
# - normal: + type conversion and format checks
5454
# - strict: + logic, safety, and quality warnings
55-
WARN_LEVEL ?= strict
55+
WARN_LEVEL ?= minimal
5656

5757
# Base warnings (always applied)
5858
ERROFFLAGS := -Wall -Wextra -pedantic-errors

examples/donut-basic/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ DEP_DIR := $(BUILD_BASE)/dep
3434
CXXFLAGS_BASE := -std=$(LANGUAGE) -fdiagnostics-color=always
3535

3636
# Warning Level Configuration
37-
# Options: minimal, normal, strict (default: strict)
37+
# Options: minimal, normal, strict (default: minimal)
3838
# - minimal: Only -Wall -Wextra -pedantic-errors
3939
# - normal: + type conversion and format checks
4040
# - strict: + logic, safety, and quality warnings
41-
WARN_LEVEL ?= strict
41+
WARN_LEVEL ?= minimal
4242

4343
# Base warnings (always applied)
4444
ERRORFLAGS := -Wall -Wextra -pedantic-errors

templates/advanced/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ DOC_BUILD := $(BUILD_BASE)/docs
4848
# ─── Compiler Configuration ───────────────────────────────────────────────────
4949

5050
# Warning Level Configuration
51-
# Options: minimal, normal, strict (default: strict)
51+
# Options: minimal, normal, strict (default: minimal)
5252
# - minimal: Only -Wall -Wextra -pedantic-errors
5353
# - normal: + type conversion and format checks
5454
# - strict: + logic, safety, and quality warnings
55-
WARN_LEVEL ?= strict
55+
WARN_LEVEL ?= minimal
5656

5757
# Base warnings (always applied)
5858
ERRORFLAGS := -Wall -Wextra -pedantic-errors

templates/basic/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ DEP_DIR := $(BUILD_BASE)/dep
3434
CXXFLAGS_BASE := -std=$(LANGUAGE) -fdiagnostics-color=always
3535

3636
# Warning Level Configuration
37-
# Options: minimal, normal, strict (default: strict)
37+
# Options: minimal, normal, strict (default: minimal)
3838
# - minimal: Only -Wall -Wextra -pedantic-errors
3939
# - normal: + type conversion and format checks
4040
# - strict: + logic, safety, and quality warnings
41-
WARN_LEVEL ?= strict
41+
WARN_LEVEL ?= minimal
4242

4343
# Base warnings (always applied)
4444
ERROFFLAGS := -Wall -Wextra -pedantic-errors

0 commit comments

Comments
 (0)