-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBarrfile
More file actions
76 lines (53 loc) · 2.44 KB
/
Barrfile
File metadata and controls
76 lines (53 loc) · 2.44 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
# -------------------------------------------------------------
# Recommended build file
# Copy this to Build Barrage root and rename to Barrfile to use it
# -------------------------------------------------------------
cc="${BARR_COMPILER_CLANG}";
print("Compiler: ${cc}");
COMPILER = "${cc}";
MAIN_ENTRY="build_barrage.c";
detect_features_dir = "tools/linux/detect_features";
detect_feats_out = "tools/bin/detect_feats";
run_cmd("${cc} ${detect_features_dir}/src/main.c -Wall -O2 -g -D_GNU_SOURCE -o ${detect_feats_out}");
run_cmd("./${detect_feats_out}");
# ----------------------------------------------------------------------
# Create $HOME/.loca/share/barr
run_cmd("mkdir -p ${BARR_DATA_DIR}");
# Create $HOME/.loca/share/barr/tools/bin
# barr_hq_bin = "${BARR_DATA_DIR}/tools/bin";
# run_cmd("mkdir -p ${barr_hq_bin}");
# -------------------------------------------------------------
# build forward observer
# -------------------------------------------------------------
fo_clean = "tools/fo/build tools/fo/.barr/cache/build.cache";
add_module("fo","tools/fo","no");
GEN_COMPILE_COMMANDS = "yes";
TARGET = "barr";
VERSION = "1.0.1";
TARGET_TYPE = "executable";
print("Building ${TARGET}-v${VERSION} | Type: ${TARGET_TYPE}");
LINKER = "mold";
BUILD_TYPE = "release";
OUT_DIR = "build/${BUILD_TYPE}";
std = "-std=c23";
#CFLAGS = "${std} -Wall -Werror -Wextra -g -pthread -DBARR_DEBUG";
opts = "-Wall -O3 -pthread -march=native -mbmi -mlzcnt";
extra_opts = "-fomit-frame-pointer -fno-common";
bug_detection = "-Wself-assign -Wunreachable-code";
safety = "-Wloop-analysis -Wthread-safety-pointer -Wvla";
quality = "-Wdocumentation -Wunicode-whitespace -Wredundant-decls";
CFLAGS_RELEASE = "${std} ${opts} ${extra_opts} ${bug_detection} ${safety} ${quality}";
EXCLUDE_PATTERNS = "tools examples scripts";
DEFINES = "-DNDEBUG -D_GNU_SOURCE -DBARR_RELEASE_BUILD";
pkgs = "xxhash";
find_package("${pkgs}");
LFLAGS = "-lpthread -Wl,--gc-sections,-s";
# ----------------------------------------------------------------------
# Write barr_hq
barr_hq_file = "${BARR_DATA_DIR}/barr_hq";
build_dir = "${BARR_CWD}/${OUT_DIR}";
file_write("root=${BARR_CWD}", "${barr_hq_file}");
file_write("version=${VERSION}", "${barr_hq_file}","true");
file_write("build_dir=${build_dir}", "${barr_hq_file}","true");
# ----------------------------------------------------------------------
CLEAN_TARGETS = "${fo_clean}"; # extra targets for 'barr clean' command