forked from ryancdotorg/brainflayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (49 loc) · 2.07 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
HEADERS = bloom.h crack.h hash160.h warpwallet.h
OBJ_MAIN = brainflayer.o hex2blf.o blfchk.o ecmtabgen.o hexln.o filehex.o
OBJ_UTIL = hex.o bloom.o mmapf.o hsearchf.o ec_pubkey_fast.o ripemd160_256.o dldummy.o
OBJ_ALGO = $(patsubst %.c,%.o,$(wildcard algo/*.c))
OBJECTS = $(OBJ_MAIN) $(OBJ_UTIL) $(OBJ_ALGO)
BINARIES = brainflayer hexln hex2blf blfchk ecmtabgen filehex
LIBS = -lssl -lrt -lcrypto -lz -lgmp
CFLAGS = -O3 \
-flto -funsigned-char -falign-functions=16 -falign-loops=16 -falign-jumps=16 \
-Wall -Wextra -Wno-pointer-sign -Wno-sign-compare \
-pedantic -std=gnu99
COMPILE = gcc $(CFLAGS)
all: $(BINARIES)
secp256k1/.libs/libsecp256k1.a:
git submodule init
git submodule update
cd secp256k1; make distclean || true
cd secp256k1; ./autogen.sh
cd secp256k1; ./configure
cd secp256k1; make
secp256k1/include/secp256k1.h: secp256k1/.libs/libsecp256k1.a
scrypt-jane/scrypt-jane.h:
git submodule init
git submodule update
scrypt-jane/scrypt-jane.o: scrypt-jane/scrypt-jane.h scrypt-jane/scrypt-jane.c
cd scrypt-jane; gcc -O3 -DSCRYPT_SALSA -DSCRYPT_SHA256 -c scrypt-jane.c -o scrypt-jane.o
brainflayer.o: brainflayer.c secp256k1/include/secp256k1.h
format/warpwallet.o: format/warpwallet.c scrypt-jane/scrypt-jane.h
format/brainwalletio.o: format/brainwalletio.c scrypt-jane/scrypt-jane.h
format/brainv2.o: format/brainv2.c scrypt-jane/scrypt-jane.h
ec_pubkey_fast.o: ec_pubkey_fast.c secp256k1/include/secp256k1.h
$(COMPILE) -Wno-unused-function -c $< -o $@
%.o: %.c
$(COMPILE) -c $< -o $@
hexln: hexln.o hex.o
$(COMPILE) -static $^ $(LIBS) -o $@
blfchk: blfchk.o hex.o bloom.o mmapf.o hsearchf.o
$(COMPILE) -static $^ $(LIBS) -o $@
hex2blf: hex2blf.o hex.o bloom.o mmapf.o
$(COMPILE) -static $^ $(LIBS) -lm -o $@
ecmtabgen: ecmtabgen.o mmapf.o ec_pubkey_fast.o
$(COMPILE) -static $^ $(LIBS) -o $@
filehex: filehex.o hex.o
$(COMPILE) -static $^ $(LIBS) -o $@
brainflayer: brainflayer.o $(OBJ_UTIL) $(OBJ_ALGO) \
secp256k1/.libs/libsecp256k1.a scrypt-jane/scrypt-jane.o
$(COMPILE) -static $^ $(LIBS) -o $@
clean:
rm -f $(BINARIES) $(OBJECTS)