-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 1.01 KB
/
Makefile
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
# We try to figure out the best include paths, compiler options, etc. from the build system.
SCYLLA_OPTS = --ccopts -DKRML_UNROLL_MAX=0,-I,test/include
# On OSX, querying xcrun appears to provide the sysroot.
ifeq ($(shell uname -s),Darwin)
ISYSROOT=$(shell xcrun --show-sdk-path)
ifneq ($(ISYSROOT),)
SCYLLA_OPTS += --ccopts -I,$(ISYSROOT)/usr/include
endif
endif
.PHONY: all
all: lib/DataModel.ml
@ocamlfind list | grep -q krml || test -L lib/krml || echo "⚠️⚠️⚠️ krml not found; we suggest cd lib && ln -s path/to/karamel/lib krml"
$(MAKE) build
lib/DataModel.ml: misc/data_model.exe
$< > $@
misc/data_model.exe: misc/data_model.o
$(CC) $< -o $@
.PHONY: build
build:
dune build && ln -sf _build/default/bin/main.exe scylla
# We extract all of the tests into the same hacl directory
test: test-chacha test-bignum_base
for f in rs/*.rs; do cp $$f out/hacl/src/; done
cd out/hacl && cargo test
test-%: test/%.c $(wildcard test/include/*) | all
./scylla $(SCYLLA_OPTS) $< --output out/hacl/src/