interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / research / atemporal / at1 / model / Makefile

36 lines · 1623 bytes Raw Blame History
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
3CC = cc
4CFLAGS = -std=c11 -O2 -ffp-contract=off -Wall -Wextra -Werror -pedantic
5SANFLAGS = -std=c11 -O1 -g -ffp-contract=off -Wall -Wextra -Werror -pedantic -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all
6LDLIBS = -lm
7SHA = ../../../../src
8LIB = at1_bn.c at1_case.c at1_exact.c at1_numeric.c at1_result.c at1_io.c $(SHA)/omega_om_units.c
9HDR = at1_model.h $(SHA)/sha256.h
10
11all: build/at1-model build/test_model
12
13build/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
17build/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
21test: 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).
25asan:
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
33clean:
34 rm -rf build
35
36.PHONY: all test asan clean