diff options
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/Makefile.in b/Makefile.in index 03fa832..f908f59 100644 --- a/Makefile.in +++ b/Makefile.in @@ -10,12 +10,10 @@ MUSL_SRCDIR := @with_musl_src@ LINUX_HEADERS_SRCDIR := @with_linux_headers_src@ GDB_SRCDIR := @with_gdb_src@ QEMU_SRCDIR := @with_qemu_src@ +SPIKE_SRCDIR := @with_spike_src@ +PK_SRCDIR := @with_pk_src@ -SIM:=qemu - -# Default branch for proxy kernel and spike -SPIKE_BRANCH:=master -PK_BRANCH:=master +SIM ?= @WITH_SIM@ ifeq ($(srcdir)/riscv-gcc,$(GCC_SRCDIR)) # We need a relative source dir for the gcc configure, to make msys2 mingw64 @@ -180,7 +178,7 @@ else ifeq ($(SIM),spike) # Using spike simulator. SIM_PATH:=$(srcdir)/scripts/wrapper/spike -SIM_PREPARE:=PATH="$(SIM_PATH):$(INSTALL_DIR)/bin:$(PATH)" PK_PATH="$(INSTALL_DIR)/$(NEWLIB_TUPLE)/bin/" +SIM_PREPARE:=PATH="$(SIM_PATH):$(INSTALL_DIR)/bin:$(PATH)" PK_PATH="$(INSTALL_DIR)/$(NEWLIB_TUPLE)/bin/" ARCH_STR="$(WITH_ARCH)" SIM_STAMP:= stamps/build-spike ifneq (,$(findstring rv32,$(NEWLIB_MULTILIB_NAMES))) SIM_STAMP+= stamps/build-pk32 @@ -259,6 +257,12 @@ else QEMU_SRC_GIT := endif +ifeq ($(findstring $(srcdir),$(SPIKE_SRCDIR)),$(srcdir)) +SPIKE_SRC_GIT := $(SPIKE_SRCDIR)/.git +else +SPIKE_SRC_GIT := +endif + ifneq ("$(wildcard $(GCC_SRCDIR)/.git)","") GCCPKGVER := g$(shell git -C $(GCC_SRCDIR) describe --always --dirty --exclude '*') else @@ -804,26 +808,20 @@ stamps/build-gcc-musl-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-musl-lin cp -a $(INSTALL_DIR)/$(MUSL_TUPLE)/lib* $(SYSROOT) mkdir -p $(dir $@) && touch $@ -spike-src: - git clone https://github.com/riscv/riscv-isa-sim.git -b $(SPIKE_BRANCH) $@ - -pk-src: - git clone https://github.com/riscv/riscv-pk.git -b $(PK_BRANCH) $@ - -stamps/build-spike: spike-src +stamps/build-spike: $(SPIKE_SRCDIR) $(SPIKE_SRC_GIT) rm -rf $@ $(notdir $@) mkdir $(notdir $@) - cd $(notdir $@) && ../$</configure \ + cd $(notdir $@) && $</configure \ --prefix=$(INSTALL_DIR) $(MAKE) -C $(notdir $@) $(MAKE) -C $(notdir $@) install mkdir -p $(dir $@) date > $@ -stamps/build-pk32: pk-src stamps/build-gcc-newlib-stage2 +stamps/build-pk32: $(PK_SRCDIR) stamps/build-gcc-newlib-stage2 rm -rf $@ $(notdir $@) mkdir $(notdir $@) - cd $(notdir $@) && ../$</configure \ + cd $(notdir $@) && $</configure \ --prefix=$(INSTALL_DIR) \ --host=$(NEWLIB_TUPLE) \ --with-arch=rv32gc @@ -832,10 +830,10 @@ stamps/build-pk32: pk-src stamps/build-gcc-newlib-stage2 mkdir -p $(dir $@) date > $@ -stamps/build-pk64: pk-src stamps/build-gcc-newlib-stage2 +stamps/build-pk64: $(PK_SRCDIR) stamps/build-gcc-newlib-stage2 rm -rf $@ $(notdir $@) mkdir $(notdir $@) - cd $(notdir $@) && ../$</configure \ + cd $(notdir $@) && $</configure \ --prefix=$(INSTALL_DIR) \ --host=$(NEWLIB_TUPLE) \ --with-arch=rv64gc |