aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-04-23 22:40:18 +0100
committerYann Herklotz <git@yannherklotz.com>2020-04-23 22:40:18 +0100
commit6557bd4ad48626d1c7f644f4134560d363786766 (patch)
tree9a5dadb5f24b631c34ee93a01f0fdef21795927d /Makefile
parentfdf5e7378715ba1bd8552e2f005c4a15c834a038 (diff)
downloadvericert-6557bd4ad48626d1c7f644f4134560d363786766.tar.gz
vericert-6557bd4ad48626d1c7f644f4134560d363786766.zip
Add OS detection to makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 13 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 1d328ec..42e6a45 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,23 @@
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Linux)
+ ARCH := x86_64-linux
+endif
+ifeq ($(UNAME_S),Darwin)
+ ARCH := x86_64-macosx
+endif
+
COMPCERTRECDIRS := lib common x86_64 x86 backend cfrontend driver flocq exportclight \
MenhirLib cparser
-COMPCERTCOQINCLUDES := $(foreach d, $(COMPCERTRECDIRS), -R lib/CompCert/$(d) compcert.$(d))
-
COQINCLUDES := -R src/common coqup.common -R src/verilog coqup.verilog \
-R src/extraction coqup.extraction -R src/translation coqup.translation \
- -R src coqup $(COMPCERTCOQINCLUDES)
+ -R src coqup \
+ $(foreach d, $(COMPCERTRECDIRS), -R lib/CompCert/$(d) compcert.$(d))
COQEXEC := $(COQBIN)coqtop $(COQINCLUDES) -batch -load-vernac-source
-COQMAKE := "$(COQBIN)coq_makefile"
+COQMAKE := $(COQBIN)coq_makefile
-COQUPDIRS := translation common verilog
-VSSUBDIR := $(foreach d, $(COQUPDIRS), src/$(d)/*.v)
-VS := src/Compiler.v src/Simulator.v $(VSSUBDIR)
+VS := src/Compiler.v src/Simulator.v $(foreach d, translation common verilog, src/$(d)/*.v)
PREFIX ?= .
@@ -23,7 +28,7 @@ all: lib/COMPCERTSTAMP
$(MAKE) compile
lib/COMPCERTSTAMP:
- (cd lib/CompCert && ./configure x86_64-linux)
+ (cd lib/CompCert && ./configure $(ARCH))
$(MAKE) -C lib/CompCert
touch $@