diff --git a/.gitignore b/.gitignore index 153e7275..77b9eb6c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ env-riscv-tools.sh env-esp-tools.sh .bloop/ .bsp/ +*_TIMESTAMP diff --git a/common.mk b/common.mk index 4f632a26..f149d1ae 100644 --- a/common.mk +++ b/common.mk @@ -69,9 +69,20 @@ SBT_SOURCES = $(call lookup_srcs,$(SBT_SOURCE_DIRS),sbt) $(base_dir)/build.sbt $ # Bloop Project Definitions ######################################################################################### $(BLOOP_CONFIG_DIR)/TIMESTAMP: $(SBT_SOURCES) - cd $(base_dir) && $(SBT) "project chipyardRoot" "bloopInstall" + cd $(base_dir) && $(SBT) ";project chipyardRoot; bloopInstall" touch $@ +######################################################################################### +# SBT Server Setup (needed to rebuild project correctly) +######################################################################################### +$(SBT_THIN_CLIENT_TIMESTAMP): $(SBT_SOURCES) +ifneq (,$(wildcard $(SBT_THIN_CLIENT_TIMESTAMP))) + cd $(base_dir) && $(SBT) "reload" + touch $@ +else + touch $@ +endif + ######################################################################################### # create list of simulation file inputs ######################################################################################### @@ -226,9 +237,10 @@ $(dramsim_lib): launch-sbt: cd $(base_dir) && $(SBT) -.PHONY: launch-sbt +.PHONY: shutdown-sbt shutdown-sbt: - cd $(base_dir) && $(SBT) shutdown + cd $(base_dir) && $(SBT) "shutdown" + rm -rf $(SBT_THIN_CLIENT_TIMESTAMP) ######################################################################################### # print help text diff --git a/variables.mk b/variables.mk index 73918376..731b7e1e 100644 --- a/variables.mk +++ b/variables.mk @@ -154,7 +154,12 @@ JAVA_OPTS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -XX:MaxPermSize=256M # by default build chisel3/firrtl and other subprojects from source override SBT_OPTS += -Dsbt.sourcemode=true -Dsbt.workspace=$(base_dir)/tools +SCALA_BUILDTOOL_DEPS = $(SBT_SOURCES) + +SBT_THIN_CLIENT_TIMESTAMP = $(base_dir)/SBT_TIMESTAMP + ifdef ENABLE_SBT_THIN_CLIENT +override SCALA_BUILDTOOL_DEPS += $(SBT_THIN_CLIENT_TIMESTAMP) # enabling speeds up sbt loading # however if build.sbt changes are done you need to # "shutdown" the server (shutdown-sbt target) to reload build.sbt changes @@ -168,8 +173,6 @@ BLOOP_CONFIG_DIR ?= $(base_dir)/.bloop # This mirrors the bloop default. Set to a system-unique port in a multi-user environment BLOOP_NAILGUN_PORT ?= 8212 -SCALA_BUILDTOOL_DEPS = $(SBT_SOURCES) - ifdef ENABLE_BLOOP override SCALA_BUILDTOOL_DEPS += $(BLOOP_CONFIG_DIR)/TIMESTAMP # Two notes about the bloop invocation: