Debian Codegraph @

crt/s2n/tests/cbmc/proofs/Makefile.cbmc_batch

raw
1 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"). You may not use
4 # this file except in compliance with the License. A copy of the License is
5 # located at
6 #
7 # http://aws.amazon.com/apache2.0/
8 #
9 # or in the "license" file accompanying this file. This file is distributed on an
10 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11 # implied. See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 .PHONY: batch-yaml ci-yaml
15
16 ################################################################
17 # Launching cbmc on cbmc-batch
18 BATCH ?= cbmc-batch
19
20 BATCHFLAGS ?= \
21 --batchpkg $(BATCHPKG) \
22 --blddir $(SRCDIR) \
23 --bucket $(BUCKET) \
24 --cbmcflags $(call encode_options,$(CHECKFLAGS)) \
25 --cbmcpkg $(CBMCPKG) \
26 --coverage-memory $(COVMEM) \
27 --goto gotos/$(ENTRY).goto \
28 --jobprefix $(ENTRY) \
29 --no-build \
30 --no-copysrc \
31 --property-memory $(PROPMEM) \
32 --srcdir $(SRCDIR) \
33 --viewerpkg $(VIEWERPKG) \
34 --wsdir $(WS)
35
36 BATCHPKG ?= cbmc-batch.tar.gz
37 BUCKET ?= cbmc
38 CBMCPKG ?= cbmc.tar.gz
39 COVMEM ?= 64000
40
41 define encode_options
42 '=$(shell echo $(1) | sed 's/ ,/ /g' | sed 's/ /;/g')='
43 endef
44
45 PROPMEM ?= 64000
46 VIEWERPKG ?= cbmc-viewer.tar.gz
47 WS ?= ws
48
49 define yaml_encode_options
50 "$(shell echo $(1) | sed 's/ ,/ /g' | sed 's/ /;/g')"
51 endef
52
53 $(ENTRY).yaml:
54 echo 'batchpkg: $(BATCHPKG)' > $@
55 echo 'build: true' >> $@
56 echo 'cbmcflags: $(call yaml_encode_options,$(CHECKFLAGS) $(CBMCFLAGS))' >> $@
57 echo 'cbmcpkg: $(CBMCPKG)' >> $@
58 echo 'coverage_memory: $(COVMEM)' >> $@
59 echo 'expected: "SUCCESSFUL"' >> $@
60 echo 'goto: gotos/$(GOTO).goto' >> $@
61 echo 'jobos: ubuntu16' >> $@
62 echo 'property_memory: $(PROPMEM)' >> $@
63 echo 'viewerpkg: $(VIEWERPKG)' >> $@
64
65 batch-yaml: $(ENTRY).yaml Makefile
66
67 cbmc-batch.yaml:
68 echo 'cbmcflags: $(strip $(call yaml_encode_options,$(CHECKFLAGS) $(CBMCFLAGS)))' > $@
69 echo 'expected: "SUCCESSFUL"' >> $@
70 echo 'goto: gotos/$(ENTRY).goto' >> $@
71 echo 'jobos: ubuntu16' >> $@
72
73 empty-cbmc-batch.yaml:
74 echo ':' > 'cbmc-batch.yaml'
75 echo ' This file marks this directory as containing a CBMC proof. This file' >> 'cbmc-batch.yaml'
76 echo ' is automatically clobbered in CI and replaced with parameters for' >> 'cbmc-batch.yaml'
77 echo ' running the proof.' >> 'cbmc-batch.yaml'
78
79 ci-yaml: cbmc-batch.yaml Makefile
80
81 .PHONY: ci-yaml batch-yaml