From 5f03e28394fcf2963eb17b6c6b3153b93fa25d4f Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Fri, 22 Sep 2023 00:45:56 +0300 Subject: [PATCH] all: introduce and document G and H variables --- Makefile | 9 +++++++-- README.md | 5 ++++- arch.mk | 16 ++++++++++++++++ caveat/Makefile | 6 +++++- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 arch.mk diff --git a/Makefile b/Makefile index f0dc9a1..647e929 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,17 @@ +include arch.mk + + .PHONY: nothing clean install nothing: - echo "clean, tarball, install?" + @echo "clean, tarball, install?" + @echo "G: allowed values: riscv64, ppc, ppc64" + @echo "H: allowed values: amd64" clean: rm -f $(HOME)/lib/libcava.a $(HOME)/lib/softfloat.a *~ ./#*# ( cd softfloat/build/Linux-x86_64-GCC; rm -f softfloat.a *.o ) - make -C caveat clean + make -C caveat clean G=$G H=$H make -C cachesim clean make -C pipesim clean make -C traceinfo clean diff --git a/README.md b/README.md index b63220a..b877951 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,12 @@ Make install expects ~/bin, ~/lib, ~/include to exit. To build Cavatools: ``` $ cd cavatools - $ make install + $ make install G=$GUEST H=$HOST ``` +Allowed GUEST values: riscv64, ppc or ppc64. +Allowed HOST values: amd64. + will create the following files: ``` ~/bin/caveat - instruction set interpreter diff --git a/arch.mk b/arch.mk new file mode 100644 index 0000000..f07bf60 --- /dev/null +++ b/arch.mk @@ -0,0 +1,16 @@ +G ?= riscv64 +H ?= amd64 + + +ifneq ($G,riscv64) +ifneq ($G,ppc) +ifneq ($G,ppc64) +$(error G: allowed values: riscv64, ppc, ppc64, not '$G') +endif +endif +endif + + +ifneq ($H,amd64) +$(error H: allowed values: amd64, not '$H') +endif diff --git a/caveat/Makefile b/caveat/Makefile index 0a36d83..f014d38 100644 --- a/caveat/Makefile +++ b/caveat/Makefile @@ -1,6 +1,10 @@ +include ../arch.mk + # Path where things should be installed R = $(HOME) B = build +G ?= riscv64 +H ?= amd64 _dummy := $(shell mkdir -p $B) _dummy := $(shell mkdir -p $R/include/cava) @@ -90,4 +94,4 @@ ecall.h: opcodes.h insn.h core.h echo '#include "opcodes.h"' >> $@ echo '#include "insn.h"' >> $@ echo '#include "core.h"' >> $@ - python3 -m openpower.syscalls ecall riscv64 amd64 >> $@ + python3 -m openpower.syscalls ecall $G $H >> $@ -- 2.30.2