-
Notifications
You must be signed in to change notification settings - Fork 6
/
variables.mk
77 lines (62 loc) · 1.82 KB
/
variables.mk
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Path and directory of this Makefile
# (which may be included from subdirectories)
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
SRC_DIR=src
VELUSMAIN=velusmain
VELUS=velus
MAKEFILEAUTO=$(MKFILE_DIR)/Makefile.auto
MAKEFILECONFIG=$(MKFILE_DIR)/Makefile.config
COQPROJECT=$(MKFILE_DIR)/_CoqProject
ifeq ($(filter clean realclean, $(MAKECMDGOALS)),)
ifeq ($(wildcard $(MAKEFILECONFIG)),)
$(error Please run ./configure first)
endif
include $(MAKEFILECONFIG)
endif
# CompCert flags
ifeq ($(COMPCERTDIR),)
COMPCERTFLAGS=$(SILENT) -C $(MKFILE_DIR)/CompCert
else
COMPCERTFLAGS=$(SILENT) -C $(COMPCERTDIR)
endif
COMPCERT_INCLUDES=lib cfrontend backend common driver cparser debug $(ARCH)
PARSERDIR=$(SRC_DIR)/Lustre/Parser
PARSERFLAGS=$(SILENT) -C $(PARSERDIR)
TOOLSDIR=tools
AUTOMAKE=automake
EXTRACTION=extraction
EXTRACTED=$(EXTRACTION)/extracted
$(shell mkdir -p $(EXTRACTED) >/dev/null)
EXAMPLESDIR=examples
EXAMPLESFLAGS=$(SILENT) -C $(EXAMPLESDIR)
# Menhir includes from CompCert
ifeq ($(filter clean realclean, $(MAKECMDGOALS)),)
include $(COMPCERTDIR)/Makefile.menhir
endif
export MENHIR
comma:= ,
empty:=
space:= $(empty) $(empty)
MENHIR_INCLUDES:= $(subst $(space),$(comma),$(MENHIR_INCLUDES))
# ocamlbuild flags
VERBOSITY=-verbose 1
FLAGS=-Is $(SRC_DIR),$(EXTRACTED) -use-ocamlfind -use-menhir \
-pkgs str,unix,menhirLib -no-hygiene $(VERBOSITY)
#-cflags $(MENHIR_INCLUDES)$(WARNINGS)
TARGET=native
BUILDDIR=_build
# flag to prevent coqc from taking CompCert directories into account (see Makefile.auto)
export OTHERFLAGS=-exclude-dir CompCert
bold=$(shell tput bold)
blue=$(shell tput setaf 4)
red=$(shell tput setaf 9)
green=$(shell tput setaf 10)
normal=$(shell tput sgr0)
ifndef VERBOSE
SILENT=-s
#WARNINGS=,-w,-3-20
WARNINGS=
VERBOSITY=
.SILENT:
endif