Skip to content

Commit 9d984bf

Browse files
authored
Merge pull request bitcoinfuzz#88 from brunoerg/lightning
ldk: improve Makefile
2 parents 51595ea + 716b567 commit 9d984bf

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Note this project is a WIP and might be not stable.
55

66
# Installation
77

8-
## BitcoinFuzz start modules:
8+
## Bitcoin modules:
99

1010
### rust-bitcoin
1111

@@ -50,15 +50,13 @@ export CXXFLAGS="$CXXFLAGS -DBITCOIN_CORE"
5050
export BOOST_LIB_DIR="path/to/boost/"
5151
```
5252

53-
## LightningFuzz start modules:
53+
## Lightning modules:
5454

5555
### LDK
5656

5757
```bash
58-
export RUST_TARGET="aarch64-apple-darwin"
5958
cd modules/ldk
60-
cd ldk_lib && cargo build --release --target=$RUST_TARGET
61-
cd .. && make
59+
make cargo && make
6260
export CXXFLAGS="$CXXFLAGS -DLDK"
6361
```
6462

modules/ldk/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
all: module.a
22

3-
CXXFLAGS += -Wall -Wextra -std=c++20 -I ../../include
4-
# MacOS: ./ldk_lib/target/aarch64-apple-darwin/release/libldk_lib.a
5-
LDK_LIB_PATH := ./ldk_lib/target/$(RUST_TARGET)/release/libldk_lib.a
6-
LDK_LIB_NAME := libldk_lib.a
3+
CXXFLAGS += -Wall -Wextra -fsanitize=address,fuzzer -std=c++20 -I ../../include
4+
LDK_LIB_PATH := ./ldk_lib/target/release/libldk_lib.a
5+
6+
cargo:
7+
cd ldk_lib && RUSTFLAGS="-Z sanitizer=address" cargo build --release
78

89
module.a: module.o $(LDK_LIB_PATH)
910
bash ../../merge.sh module.a $(LDK_LIB_PATH) module.o
@@ -13,4 +14,4 @@ module.o: module.cpp module.h
1314
$(CXX) $(CXXFLAGS) -I . -fPIC -c module.cpp -o module.o
1415

1516
clean:
16-
rm -rf *.o module.a
17+
rm -rf *.o module.a

0 commit comments

Comments
 (0)