-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ninja
More file actions
158 lines (135 loc) · 9.46 KB
/
build.ninja
File metadata and controls
158 lines (135 loc) · 9.46 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# legacy file - default to using duck
# build.ninja
timer = /usr/bin/time -p
compiler_gnuc = gcc
compiler_gnu = g++
custom_libc_start = -nostartfiles src/asm/__start.S -x c
no_libc = -nostartfiles src/asm/__start.S
include_libc_start = start.o
compiler_llvm = clang++
cflags_debug = -g -march=native
cflags_optimizations = -Ofast -mavx2 -mbmi -march=native
# annoying but works
cflags_warn_all_llvm = -Weverything
cflags_warn_base = -Wall -Wextra -Wpedantic
cflags_warn_options = -Wno-cpp -Wunused -Wshadow -Wconversion -Wcast-qual -Wconversion-null -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wduplicated-cond -Wdouble-promotion -Wdisabled-optimization -Winline -Wfloat-equal -Wmissing-noreturn -Wpacked -Wnonnull -Wundef -Wtrampolines -Winline -Winit-self -Wcast-align -Wnarrowing -Wregister -Wmain -Wchanges-meaning -Wsequence-point -Wattributes
cflags_extra_errors = -Werror=missing-field-initializers -Werror=return-type
cflags_warn_ignore = -Wno-implicit-fallthrough -Wno-sign-conversion -Wno-variadic-macros
cflags_ext = -nodefaultlibs -fstack-protector-strong -fstack-clash-protection -fstrict-overflow -fopenmp -fext-numeric-literals -ffast-math -flto -fdiagnostics-color=always -fconcepts-diagnostics-depth=2
cflags_ext_llvm = -fopenmp -ffast-math -flto -fdiagnostics-color=always
cflags_llvm_debug = -std=c++23 $cflags_debug $cflags_optimizations $cflags_ext_llvm
cflags_gnu_debug = -std=c++23 $cflags_debug $cflags_warn_base $cflags_warn_options $cflags_warn_ignore $cflags_extra_errors $cflags_ext
cflags_gnu = -std=c++23 $cflags_optimizations $cflags_warn_base $cflags_warn_options $cflags_warn_ignore $cflags_extra_errors $cflags_ext
cflags_gnuc = -std=c11 $cflags_optimizations $cflags_warn_base $cflags_ext
cflags_llvm = -std=c++23 $cflags_optimizations $cflags_warn_all_llvm $cflags_ext_llvm
compile_flags_std = -lc -lgcc -lgcc_s -lstdc++ -lm
compile_flags_start = -c
clibs_location = -L./libs
clibs_includes = -Isrc
clibs_static = -static-libstdc++ -static-libgcc
build_directory = bin
rule as_c_cc_compile_cmnd
command = echo -e "\n\n\033[1;32mBuilding:\033[0m $out" && $timer $compiler_gnuc $cflags_gnuc $clibs_location $clibs_includes $compile_flags_start $in -o start.o;
rule cc_compile_cmnd
command = echo -e "\n\n\033[1;32mBuilding:\033[0m $out" && $timer $compiler_gnu $cflags_gnu $clibs_location $clibs_includes $in $compile_flags_std -o $build_directory/$out $clibs_static;
rule cc_compile_cmnd_debug_no_libc
command = echo -e "\n\n\033[1;32mBuilding:\033[0m $out" && $timer $compiler_gnu $no_libc $cflags_gnu_debug $clibs_location $clibs_includes $in $compile_flags_std $include_libc_start -o $build_directory/$out;
rule cc_compile_cmnd_debug
command = echo -e "\n\n\033[1;32mBuilding:\033[0m $out" && $timer $compiler_gnu $cflags_gnu_debug $clibs_location $clibs_includes $in $compile_flags_std -o $build_directory/$out;
rule cc_clang_compile_cmnd_debug
command = echo -e "\n\n\033[1;32mBuilding:\033[0m $out" && $timer $compiler_llvm $cflags_llvm_debug $clibs_location $clibs_includes $in $compile_flags_std -o $build_directory/$out;
# core
build micron_library_start: as_c_cc_compile_cmnd src/asm/start.c
build micron_build_bin: cc_compile_cmnd tools/src/build.cc
build bench_strings: cc_compile_cmnd benches/strings.cpp
build rigor_memory: cc_compile_cmnd tests/rigor/memory.cpp
build rigor_stack: cc_compile_cmnd tests/rigor/stack.cpp
build rigor_vector: cc_compile_cmnd tests/rigor/vector.cpp
build rigor_string: cc_compile_cmnd tests/rigor/string.cpp
build rigor_array: cc_compile_cmnd tests/rigor/array.cpp
build example_png: cc_compile_cmnd examples/sample.cpp
build prints: cc_compile_cmnd tests/prints.cpp
build core_tests_forks: cc_compile_cmnd_debug tests/core/forks.cpp
build core_tests_control: cc_compile_cmnd_debug tests/core/control.cpp
build core_tests_io_init: cc_compile_cmnd_debug tests/core/io_init.cpp
build core_tests_syscall: cc_compile_cmnd_debug tests/core/syscall.cpp
build core_tests_strings: cc_compile_cmnd_debug tests/core/cstrings.cpp
build core_tests_cmemory: cc_compile_cmnd_debug tests/core/cmemory.cpp
build core_tests_pointers: cc_compile_cmnd_debug tests/core/pointers.cpp
build core_tests_mutex: cc_compile_cmnd_debug tests/core/mutex.cpp
build core_tests_semaphore: cc_compile_cmnd_debug tests/core/semaphores.cpp
build core_tests_once: cc_compile_cmnd_debug tests/core/once.cpp
build core_tests_cpu: cc_compile_cmnd_debug tests/core/cpu.cpp
build core_tests_thread: cc_compile_cmnd_debug tests/core/threads.cpp
build core_tests_arena: cc_compile_cmnd_debug tests/core/arena.cpp
build core_tests_spawning: cc_compile_cmnd tests/core/spawning.cpp
build core_tests_linux: cc_compile_cmnd_debug tests/core/linux.cpp
build core_tests_channels: cc_compile_cmnd_debug tests/core/channels.cpp
build core_tests_abcmalloc: cc_compile_cmnd_debug tests/core/abcmalloc.cpp
build core_tests_abcmalloc_main: cc_compile_cmnd_debug tests/core/abcmalloc_main.cpp
build core_tests_abcmalloc_alloc_free: cc_compile_cmnd_debug tests/core/abcmalloc_alloc_free.cpp
build core_tests_abcmalloc_imm: cc_compile_cmnd_debug tests/core/abcmalloc_imm.cpp
build core_tests_abcmalloc_vet: cc_compile_cmnd_debug tests/core/abcmalloc_vet.cpp
build core_tests_abcmalloc_thread: cc_compile_cmnd_debug tests/core/abcmalloc_thread.cpp
build core_tests_abcmalloc_arena: cc_compile_cmnd_debug tests/core/abcmalloc_arena.cpp
build core_tests_resources: cc_compile_cmnd_debug tests/core/resources.cpp
build core_tests_abcmalloc_bench_abc_4gb: cc_compile_cmnd tests/core/abcmalloc_bench_abc_4gb.cpp
build core_tests_abcmalloc_bench_abc_small: cc_compile_cmnd tests/core/abcmalloc_bench_abc_small.cpp
build core_tests_abcmalloc_bench_abc_large: cc_compile_cmnd tests/core/abcmalloc_bench_abc_large.cpp
build core_tests_abcmalloc_bench_abc_large_freq: cc_compile_cmnd tests/core/abcmalloc_bench_abc_large_freq.cpp
build core_tests_abcmalloc_bench_abc: cc_compile_cmnd tests/core/abcmalloc_bench_abc.cpp
build core_tests_abcmalloc_bench_malloc: cc_compile_cmnd tests/core/abcmalloc_bench_malloc.cpp
build core_abcmalloc_benches: phony core_tests_abcmalloc_bench_abc_4gb core_tests_abcmalloc_bench_abc_small core_tests_abcmalloc_bench_abc_large_freq core_tests_abcmalloc_bench_abc_large core_tests_abcmalloc_bench_abc
build core_tests: phony core_tests_syscall core_tests_strings core_tests_cmemory core_tests_pointers core_tests_mutex core_tests_once core_tests_cpu core_tests_thread core_tests_arena core_tests_linux core_tests_channels
build uxin_virtual: cc_compile_cmnd_debug tests/uxin_virtual.cpp
build uxin_keyboard_test: cc_compile_cmnd_debug tests/uxin_keyboard.cpp
build uxin_mouse_test: cc_compile_cmnd_debug tests/uxin_mouse.cpp
build uxin_test: cc_compile_cmnd_debug tests/uxin_d.cpp
build simd_test: cc_compile_cmnd tests/simd.cpp
build type_traits_test: cc_compile_cmnd_debug tests/type_traits.cpp
build chrono_test: cc_compile_cmnd_debug tests/chrono.cpp
build trees_test: cc_compile_cmnd_debug tests/trees.cpp
build invoke_test: cc_compile_cmnd_debug tests/invoke.cpp
build printing_test: cc_compile_cmnd_debug tests/printing.cpp
build printing_bench: cc_compile_cmnd tests/printing_bench.cpp
build list_test: cc_compile_cmnd_debug tests/list.cpp
build pairs_test: cc_compile_cmnd_debug tests/pairs.cpp
build matrix_test: cc_compile_cmnd_debug tests/matrix.cpp
build streams_test: cc_compile_cmnd_debug tests/streams.cpp
build linux_files_test: cc_compile_cmnd_debug tests/files.cpp
build linux_fsys_test: cc_compile_cmnd_debug tests/fsys.cpp
build ftw_test: cc_compile_cmnd_debug tests/ftw.cpp
build serial_test: cc_compile_cmnd_debug tests/serial.cpp
build memset_test: cc_compile_cmnd_debug tests/memset.cpp
build strings_test: cc_compile_cmnd_debug tests/strings.cpp
build strmem_test: cc_compile_cmnd_debug tests/strmem.cpp
build iterator_test: cc_compile_cmnd_debug tests/iterators.cpp
build sleep_test: cc_compile_cmnd_debug tests/sleeping.cpp
build promises_test: cc_compile_cmnd_debug tests/promises.cpp
build algo_test: cc_compile_cmnd_debug tests/algo.cpp
build fold_test: cc_compile_cmnd tests/fold.cpp
build fsys_test: cc_compile_cmnd_debug tests/io.cpp
build ivector_test: cc_compile_cmnd_debug tests/ivector.cpp
build circle_buffer_test: cc_compile_cmnd_debug tests/circle_buffer.cpp
build array_test: cc_compile_cmnd_debug tests/array.cpp
build stacks_test: cc_compile_cmnd_debug tests/stack.cpp
build buffers_test: cc_compile_cmnd_debug tests/buffers.cpp
build slices_test: cc_compile_cmnd_debug tests/slices.cpp
build hashes_test: cc_compile_cmnd_debug tests/hashes.cpp
build compile_time_test: cc_compile_cmnd_debug tests/compile_time.cpp
build vector_test: cc_compile_cmnd_debug tests/vector.cpp
build fvector_test: cc_compile_cmnd_debug tests/fvector.cpp
build vector_tt_test: cc_compile_cmnd_debug tests/vector_tt.cpp
build queue_test: cc_compile_cmnd_debug tests/queue.cpp
build map_test: cc_compile_cmnd_debug tests/maps.cpp
build isort_test: cc_compile_cmnd_debug tests/insert_sort.cpp
build input_test: cc_compile_cmnd_debug tests/input.cpp
build allocators_test: cc_compile_cmnd_debug tests/allocators.cpp
build sorts_test: cc_compile_cmnd_debug tests/sorts.cpp
build process_test: cc_compile_cmnd tests/process.cpp
build bloom_test: cc_compile_cmnd_debug tests/bloom.cpp
build errno_test: cc_compile_cmnd_debug tests/errno.cpp
build container_leak_test: cc_compile_cmnd_debug tests/vector_leak.cpp
build threads_comparison: cc_compile_cmnd tests/comparison/threads_stl.cpp
#build vector_leak_test: cc_compile_cmnd_debug tests/vector_leak.cpp
#build vector_perf_test: cc_compile_cmnd_debug tests/vector_perf.cpp