omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / research / atemporal / at1 / model / Makefile
| 1 | # AT-1 candidate engine (Agent 3). POSIX make: works with GNU Make 3.81 (macOS) and later. |
| 2 | # Only cc, libc and libm. Override the compiler with: make CC=clang |
| 3 | CC = cc |
| 4 | CFLAGS = -std=c11 -O2 -ffp-contract=off -Wall -Wextra -Werror -pedantic |
| 5 | SANFLAGS = -std=c11 -O1 -g -ffp-contract=off -Wall -Wextra -Werror -pedantic -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all |
| 6 | LDLIBS = -lm |
| 7 | SHA = ../../../../src |
| 8 | LIB = at1_bn.c at1_case.c at1_exact.c at1_numeric.c at1_result.c at1_io.c $(SHA)/omega_om_units.c |
| 9 | HDR = at1_model.h $(SHA)/sha256.h |
| 10 | |
| 11 | all: build/at1-model build/test_model |
| 12 | |
| 13 | build/at1-model: $(LIB) at1_main.c $(HDR) |
| 14 | mkdir -p build |
| 15 | $(CC) $(CFLAGS) -I$(SHA) -o build/at1-model $(LIB) at1_main.c $(LDLIBS) |
| 16 | |
| 17 | build/test_model: $(LIB) tests/test_model.c $(HDR) |
| 18 | mkdir -p build |
| 19 | $(CC) $(CFLAGS) -I$(SHA) -I. -o build/test_model $(LIB) tests/test_model.c $(LDLIBS) |
| 20 | |
| 21 | test: all |
| 22 | ./build/test_model tests/cases build/at1-model |
| 23 | |
| 24 | # Sanitizer run, only where the compiler supports the flags (probed first; skipped otherwise). |
| 25 | asan: |
| 26 | mkdir -p build |
| 27 | @if echo 'int main(void){return 0;}' > build/probe.c && $(CC) $(SANFLAGS) -o build/probe build/probe.c 2>/dev/null && ./build/probe; then \ |
| 28 | $(CC) $(SANFLAGS) -I$(SHA) -o build/at1-model-asan $(LIB) at1_main.c $(LDLIBS) && \ |
| 29 | $(CC) $(SANFLAGS) -I$(SHA) -I. -o build/test_model-asan $(LIB) tests/test_model.c $(LDLIBS) && \ |
| 30 | ASAN_OPTIONS=detect_leaks=1 ./build/test_model-asan tests/cases build/at1-model-asan; \ |
| 31 | else echo "asan: -fsanitize=address,undefined not supported by $(CC) here; skipped"; fi |
| 32 | |
| 33 | clean: |
| 34 | rm -rf build |
| 35 | |
| 36 | .PHONY: all test asan clean |