2014-07-14 19:32:44 +00:00
|
|
|
#
|
|
|
|
# Copyright 2014, General Dynamics C4 Systems
|
|
|
|
#
|
2020-03-09 06:18:30 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2014-07-14 19:32:44 +00:00
|
|
|
#
|
|
|
|
|
2016-02-16 07:06:25 +00:00
|
|
|
SHELL=bash
|
2018-01-26 00:03:59 +00:00
|
|
|
SEL4_VERSION=../../seL4/VERSION
|
2016-02-16 07:06:25 +00:00
|
|
|
|
2017-03-30 04:24:20 +00:00
|
|
|
# default to primary verification platform
|
|
|
|
L4V_ARCH?=ARM
|
|
|
|
|
2014-07-14 19:32:44 +00:00
|
|
|
## Targets
|
|
|
|
images: ASpec CKernel
|
|
|
|
default: images test
|
|
|
|
all: images test
|
|
|
|
report-regression:
|
2017-05-10 04:08:18 +00:00
|
|
|
@echo ASpec ExecSpec DSpec TakeGrant CKernel CSpec \
|
2014-07-14 19:32:44 +00:00
|
|
|
binary-verification-input
|
|
|
|
|
|
|
|
#
|
|
|
|
# Setup heaps.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Spec heaps.
|
2020-03-27 03:28:19 +00:00
|
|
|
HEAPS += ASpec ExecSpec DSpec CKernel CSpec TakeGrant ASepSpec
|
2014-07-14 19:32:44 +00:00
|
|
|
|
|
|
|
# Additional dependencies
|
|
|
|
|
2020-08-07 05:03:37 +00:00
|
|
|
# CKernel uses the `machinety=machine_state` option for `install_C_file`,
|
|
|
|
# and therefore depends on `design-spec`.
|
2017-08-08 03:56:44 +00:00
|
|
|
CKernel CSpec: c-kernel design-spec
|
2014-07-14 19:32:44 +00:00
|
|
|
|
2020-03-27 03:28:19 +00:00
|
|
|
ExecSpec DSpec : design-spec
|
2018-01-26 00:03:59 +00:00
|
|
|
|
2020-03-27 03:28:19 +00:00
|
|
|
ASPEC_VERSION_FILE=abstract/document/VERSION
|
|
|
|
ASPEC_GITREV_FILE=abstract/document/gitrev.tex
|
|
|
|
GIT_ROOT_FILE=abstract/document/git-root.tex
|
2018-01-26 00:03:59 +00:00
|
|
|
|
2020-03-27 03:28:19 +00:00
|
|
|
# NOTE: The abstract spec imports Events from Haskell hence the dependency
|
2020-10-28 03:34:32 +00:00
|
|
|
ASpec: ASpec-files design-spec
|
|
|
|
|
|
|
|
ASpec-files: $(ASPEC_VERSION_FILE) $(GIT_ROOT_FILE) $(ASPEC_GITREV_FILE)
|
2018-02-19 03:49:17 +00:00
|
|
|
|
2020-03-27 03:28:19 +00:00
|
|
|
$(ASPEC_VERSION_FILE): $(SEL4_VERSION)
|
2018-01-26 00:03:59 +00:00
|
|
|
cp $< $@
|
|
|
|
|
2020-03-27 03:28:19 +00:00
|
|
|
$(GIT_ROOT_FILE):
|
|
|
|
git rev-parse --show-toplevel > $@
|
|
|
|
perl -p -i -e "s/\n//" $@
|
|
|
|
|
|
|
|
$(ASPEC_GITREV_FILE): .FORCE
|
2018-02-19 03:49:17 +00:00
|
|
|
git rev-parse --short=15 HEAD > $@ || echo unknown > $@
|
|
|
|
git diff --no-ext-diff --quiet || echo "*" >> $@
|
|
|
|
git diff --no-ext-diff --quiet --cached || echo "+" >> $@
|
|
|
|
perl -p -i -e "s/\n//" $@
|
|
|
|
|
2017-03-30 04:24:20 +00:00
|
|
|
# NOTE: the install_C_file in Kernel_C.thy invocation generates a spurious
|
|
|
|
# umm_types.txt file in this folder. This file is never used nor
|
|
|
|
# depended on.
|
|
|
|
|
2014-07-14 19:32:44 +00:00
|
|
|
# Preprocess the kernel's source code and bitfield theory files.
|
2017-07-20 06:30:05 +00:00
|
|
|
c-kernel: c-parser .FORCE
|
2017-09-13 02:18:31 +00:00
|
|
|
cd cspec/c && L4V_REPO_PATH=$(L4V_REPO_PATH) L4V_ARCH=$(L4V_ARCH) $(MAKE) cspec
|
2014-07-14 19:32:44 +00:00
|
|
|
.PHONY: c-kernel
|
|
|
|
|
2017-05-09 07:32:50 +00:00
|
|
|
# Run the haskell translator
|
|
|
|
design-spec: .FORCE
|
|
|
|
cd design/ && L4V_REPO_PATH=$(L4V_REPO_PATH) $(MAKE) design
|
|
|
|
.PHONY: design-spec
|
|
|
|
|
2017-07-20 06:30:05 +00:00
|
|
|
# Sets up the c-parser grammar files
|
|
|
|
c-parser: .FORCE
|
|
|
|
cd ../tools/c-parser && make c-parser-deps
|
|
|
|
.PHONY: c-parser
|
|
|
|
|
2014-07-14 19:32:44 +00:00
|
|
|
# Produce the input data for the binary verification problem at -O1
|
|
|
|
binary-verification-input: c-kernel
|
|
|
|
$(ISABELLE_TOOL) build -d .. -v SimplExport
|
|
|
|
echo 'Built CFunDump.txt, md5sums of relevance are:'
|
|
|
|
md5sum cspec/CFunDump.txt cspec/c/kernel_all.c_pp
|
|
|
|
|
|
|
|
# Clean
|
|
|
|
clean:
|
|
|
|
rm -rf abstract/generated
|
2017-09-13 02:18:31 +00:00
|
|
|
cd cspec/c && L4V_ARCH=$(L4V_ARCH) $(MAKE) clean SKIP_PATH_CHECKS=1
|
2014-07-14 19:32:44 +00:00
|
|
|
rm -f umm_types.txt
|
2015-12-10 07:22:22 +00:00
|
|
|
.PHONY: clean
|
2014-07-14 19:32:44 +00:00
|
|
|
|
|
|
|
include ../misc/isa-common.mk
|