diff --git a/Makefile b/Makefile index da46b3a0..5399faac 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,21 @@ default: $(STATIC_LIB) $(ARM64_STATIC_LIB) # Build all targets (static only) all: $(STATIC_LIB) $(ARM64_STATIC_LIB) examples +# Build secp256k1 for x86_64 +$(SECP256K1_LIB): secp256k1/configure + @echo "Building secp256k1 for x86_64..." + @cd secp256k1 && \ + if [ ! -f .libs/libsecp256k1.a ]; then \ + echo "Cleaning and configuring secp256k1..."; \ + make distclean >/dev/null 2>&1 || true; \ + ./configure --enable-module-schnorrsig --enable-module-ecdh --enable-experimental --disable-shared --enable-static --with-pic; \ + echo "Building secp256k1 library..."; \ + make -j$(shell nproc 2>/dev/null || echo 4); \ + else \ + echo "secp256k1 library already exists, skipping build"; \ + fi + @echo "x86_64 secp256k1 library built successfully" + # Static library - includes secp256k1 and OpenSSL objects for self-contained library $(STATIC_LIB): $(LIB_OBJECTS) $(SECP256K1_LIB) @echo "Creating self-contained static library: $@"