-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBarrfile
More file actions
83 lines (68 loc) · 4.01 KB
/
Barrfile
File metadata and controls
83 lines (68 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Auto-generated by Build Barrage v1.0.1
# Latest update: 2026-02-26
# ------------------------------------------------------------------
#
# • All constant values must be written in ALL_CAPS_WITH_UNDERSCORES.
# • lowercase / camelCase → Your custom variables (free to define)
# • Lines that start with '#' are comments and are ignored.
# • Use ${VAR_NAME} to reference another variable.
# • Variables not defined keep their built-in defaults.
#
# ------------------------------------------------------------------
print("Barrfile execution started");
# ------------------------------------------------------------------
# 1. PROJECT METADATA
# ------------------------------------------------------------------
TARGET = "ember";
VERSION = "0.0.1"; # Project version (informational)
TARGET_TYPE = "executable"; # "executable" | "static" | "shared"
print("Building ${TARGET}-v${VERSION} | Type: ${TARGET_TYPE}");
# ------------------------------------------------------------------
# 2. TOOLCHAIN
# ------------------------------------------------------------------
COMPILER = "/usr/bin/clang"; # C compiler (full path recommended)
LINKER = "mold"; # Linker (ld, gold, lld,mold …)
# ------------------------------------------------------------------
# 3. BUILD TYPE & OUTPUT
# ------------------------------------------------------------------
BUILD_TYPE = "release"; # "debug" (default) | "release"
OUT_DIR = "build/${TARGET}/${BUILD_TYPE}"; # Directory for objects & final binary
# ------------------------------------------------------------------
# 4. COMPILATION FLAGS
# ------------------------------------------------------------------
# You can define your own variables like the line below.
std = "-std=c23"; # C standard (c11, c17, c23, …)
CFLAGS = "${std} -Wall -Werror -Wextra -g"; # Debug flags
CFLAGS_RELEASE = "${std} -Wall -O3 -march=native -flto";
DEFINES = "-DDEBUG -D_GNU_SOURCE";
# ------------------------------------------------------------------
# 7. LINKING & LIBRARIES
# ------------------------------------------------------------------
LFLAGS = "-lvx -flto -Wl,-s";
# LIB_PATHS = "-L/usr/local/lib"; # Library search paths
# ------------------------------------------------------------------
# 8. MISCELLANEOUS
# ------------------------------------------------------------------
GEN_COMPILE_COMMANDS = "on";
# EXCLUDE_PATTERNS = "build test"; # Patterns excluded from glob scanning
# ------------------------------------------------------------------
# 9. MODULE SUPPORT
# ------------------------------------------------------------------
# To build a module for ${TARGET} you can add this function.
# barr build will run it, before building the ${TARGET}
# add_module("engine","engine","required");
# engine_includes = "-Iinclude -Iengine_public_inc";
# engine_clean_targets = "engine/build engine/.barr/cache/build.cache";
# Finalize the module includes in case of multiple modules
# MODULES_INCLUDES = "${engine_includes}"; # Aggregated includes from modules
# CLEAN_TARGETS = "${engine_clean_targets} ${other_clean_targets}..."; # Extra paths removed by 'barr clean'
# ------------------------------------------------------------------
# 10. PACKAGES SUPPORT
# ------------------------------------------------------------------
# Finding a system package eg: "xxhash" and "zlib"
pkgs = "sdl3 glew";
find_package("${pkgs}");
# ------------------------------------------------------------------
# End of Barrfile
# ------------------------------------------------------------------
print("Barrfile execution finished");