From fd627b134c686e7c9afb646dc37c573c5d36fd4a Mon Sep 17 00:00:00 2001 From: bitflash-maintainer Date: Wed, 2 Sep 2026 05:22:36 +0000 Subject: build: stop rm -rf'ing a RandomX tree the build did not create deps-randomx built into $(HOME)/RandomX and deleted that path whenever the library was missing, taking out hand-managed checkouts the build never owned. Default the build to the in-tree $(ROOT)/randomx-build, like secp256k1-build, overridable via RANDOMX_DIR and exported so src/Makefile's own fallback resolves to the same tree. As a backstop, the recipe writes a .bitflash-built marker after a successful build and refuses to delete any directory that lacks it, so a user-supplied RANDOMX_DIR pointing at a pre-existing tree is never removed. Closes #27 --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 1bc3ae8..2c6d304 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,7 +6,9 @@ FUZZ_CXX ?= clang++ SECP_INC ?= /usr/local/include SECP_LIB ?= /usr/local/lib -RANDOMX_DIR ?= $(HOME)/RandomX +# The root Makefile exports RANDOMX_DIR (default: /randomx-build, built +# by deps-randomx). This fallback only applies when src/ is built standalone. +RANDOMX_DIR ?= $(abspath $(CURDIR)/..)/randomx-build IMGUI_DIR = imgui -- cgit v1.2.3