forked from HalosGhost/bulletproof-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (28 loc) · 833 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
INCDIR = secp256k1-zkp/include
LIBDIR = secp256k1-zkp/.libs
CFLAGS = -Og -ggdb -g
LDFLAGS = -L $(LIBDIR) -I $(INCDIR) -lsecp256k1
SECPCONFFLAGS = --enable-module-bulletproofs --enable-experimental --enable-module-generator --enable-module-extrakeys --enable-module-recovery
RM = rm -rf --
.PHONY: all run lib clean debug
all: run
secp256k1-zkp:
git clone "https://github.com/apoelstra/secp256k1-zkp"
(cd "$@"; git checkout -b bulletproofs 'origin/2020-11--bulletproofs1-uncompressed')
lib: secp256k1-zkp
(cd secp256k1-zkp; \
git restore .; \
git apply ../helper.patch; \
./autogen.sh; \
./configure $(SECPCONFFLAGS); \
make -j \
)
bin: main.c
gcc $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
$(RM) bin
debug: bin
LD_LIBRARY_PATH=$(LIBDIR) gdb --tui ./$<
run: bin lib
LD_LIBRARY_PATH=$(LIBDIR) ./$<
$(V).SILENT: