forked from LedgerHQ/btchip-c-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.hidapi
134 lines (94 loc) · 7.44 KB
/
Makefile.hidapi
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
HIDAPI = hidapi-hidraw
CC = gcc
CFLAGS = -Wall -Werror -Os -DHAVE_HIDAPI -DEXTRA_DEBUG -DDEBUG_COMM -I. -I/usr/local/include
LIBS = -L/usr/local/lib
OBJS = hexUtils.o btchipUtils.o bitcoinVarint.o bitcoinTransaction.o bitcoinAmount.o btchipArgs.o
OBJS_COMM = $(OBJS) dongleCommHidHidapi.o dongleComm.o ledgerLayer.o
all: btchip_setup btchip_setup_forward btchip_setup_kiosk btchip_setup_143 btchip_verifyPin \
btchip_getWalletPublicKey btchip_getOperationMode btchip_setOperationMode btchip_setAlt2FA \
btchip_getTrustedInput btchip_startUntrustedTransaction btchip_finalizeInput \
btchip_finalizeInputFull btchip_untrustedHashSign btchip_signMessagePrepare \
btchip_signMessageSign btchip_composeMofNStart btchip_composeMofNContinue \
btchip_importPrivateKey btchip_getPublicKey btchip_deriveBip32Key btchip_signImmediate \
btchip_verifyImmediate btchip_getRandom btchip_getFirmwareVersion btchip_getPosSeed \
btchip_setTransportWinUSB btchip_setTransportHID \
btchip_util_runScript btchip_util_parseRawTransaction btchip_util_compressPublicKey \
btchip_util_getRegularInputScript btchip_util_getP2SHRedeemScript \
btchip_util_getP2SHInputScript btchip_util_formatTransaction btchip_util_formatOutput
%.o: %.c %.h
mkdir -p bin
$(CC) $(CFLAGS) -o $@ -c $<
btchip_setup: commands/btchip_setup.o $(OBJS_COMM)
gcc commands/btchip_setup.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setup -l $(HIDAPI)
btchip_setup_forward: commands/btchip_setup_forward.o $(OBJS_COMM)
gcc commands/btchip_setup_forward.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setup_forward -l $(HIDAPI)
btchip_setup_kiosk: commands/btchip_setup_kiosk.o $(OBJS_COMM)
gcc commands/btchip_setup_kiosk.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setup_kiosk -l $(HIDAPI)
btchip_setup_143: commands/btchip_setup_143.o $(OBJS_COMM)
gcc commands/btchip_setup_143.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setup_143 -l $(HIDAPI)
btchip_verifyPin: commands/btchip_verifyPin.o $(OBJS_COMM)
gcc commands/btchip_verifyPin.o $(LIBS) $(OBJS_COMM) -o bin/btchip_verifyPin -l $(HIDAPI)
btchip_getOperationMode: commands/btchip_getOperationMode.o $(OBJS_COMM)
gcc commands/btchip_getOperationMode.o $(LIBS) $(OBJS_COMM) -o bin/btchip_getOperationMode -l $(HIDAPI)
btchip_setOperationMode: commands/btchip_setOperationMode.o $(OBJS_COMM)
gcc commands/btchip_setOperationMode.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setOperationMode -l $(HIDAPI)
btchip_setAlt2FA: commands/btchip_setAlt2FA.o $(OBJS_COMM)
gcc commands/btchip_setAlt2FA.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setAlt2FA -l $(HIDAPI)
btchip_getWalletPublicKey: commands/btchip_getWalletPublicKey.o $(OBJS_COMM)
gcc commands/btchip_getWalletPublicKey.o $(LIBS) $(OBJS_COMM) -o bin/btchip_getWalletPublicKey -l $(HIDAPI)
btchip_getTrustedInput: commands/btchip_getTrustedInput.o btchipTrustedInput.o $(OBJS_COMM)
gcc commands/btchip_getTrustedInput.o btchipTrustedInput.o $(LIBS) $(OBJS_COMM) -o bin/btchip_getTrustedInput -l $(HIDAPI)
btchip_startUntrustedTransaction: commands/btchip_startUntrustedTransaction.o btchipTrustedInput.o $(OBJS_COMM)
gcc commands/btchip_startUntrustedTransaction.o btchipTrustedInput.o $(LIBS) $(OBJS_COMM) -o bin/btchip_startUntrustedTransaction -l $(HIDAPI)
btchip_finalizeInput: commands/btchip_finalizeInput.o $(OBJS_COMM)
gcc commands/btchip_finalizeInput.o $(LIBS) $(OBJS_COMM) -o bin/btchip_finalizeInput -l $(HIDAPI)
btchip_finalizeInputFull: commands/btchip_finalizeInputFull.o $(OBJS_COMM)
gcc commands/btchip_finalizeInputFull.o $(LIBS) $(OBJS_COMM) -o bin/btchip_finalizeInputFull -l $(HIDAPI)
btchip_untrustedHashSign: commands/btchip_untrustedHashSign.o $(OBJS_COMM)
gcc commands/btchip_untrustedHashSign.o $(LIBS) $(OBJS_COMM) -o bin/btchip_untrustedHashSign -l $(HIDAPI)
btchip_signMessagePrepare: commands/btchip_signMessagePrepare.o $(OBJS_COMM)
gcc commands/btchip_signMessagePrepare.o $(LIBS) $(OBJS_COMM) -o bin/btchip_signMessagePrepare -l $(HIDAPI)
btchip_signMessageSign: commands/btchip_signMessageSign.o $(OBJS_COMM)
gcc commands/btchip_signMessageSign.o $(LIBS) $(OBJS_COMM) -o bin/btchip_signMessageSign -l $(HIDAPI)
btchip_composeMofNStart: commands/btchip_composeMofNStart.o $(OBJS_COMM)
gcc commands/btchip_composeMofNStart.o $(LIBS) $(OBJS_COMM) -o bin/btchip_composeMofNStart -l $(HIDAPI)
btchip_composeMofNContinue: commands/btchip_composeMofNContinue.o $(OBJS_COMM)
gcc commands/btchip_composeMofNContinue.o $(LIBS) $(OBJS_COMM) -o bin/btchip_composeMofNContinue -l $(HIDAPI)
btchip_importPrivateKey: commands/btchip_importPrivateKey.o $(OBJS_COMM)
gcc commands/btchip_importPrivateKey.o $(LIBS) $(OBJS_COMM) -o bin/btchip_importPrivateKey -l $(HIDAPI)
btchip_getPublicKey: commands/btchip_getPublicKey.o $(OBJS_COMM)
gcc commands/btchip_getPublicKey.o $(LIBS) $(OBJS_COMM) -o bin/btchip_getPublicKey -l $(HIDAPI)
btchip_deriveBip32Key: commands/btchip_deriveBip32Key.o $(OBJS_COMM)
gcc commands/btchip_deriveBip32Key.o $(LIBS) $(OBJS_COMM) -o bin/btchip_deriveBip32Key -l $(HIDAPI)
btchip_signImmediate: commands/btchip_signImmediate.o $(OBJS_COMM)
gcc commands/btchip_signImmediate.o $(LIBS) $(OBJS_COMM) -o bin/btchip_signImmediate -l $(HIDAPI)
btchip_verifyImmediate: commands/btchip_verifyImmediate.o $(OBJS_COMM)
gcc commands/btchip_verifyImmediate.o $(LIBS) $(OBJS_COMM) -o bin/btchip_verifyImmediate -l $(HIDAPI)
btchip_getRandom: commands/btchip_getRandom.o $(OBJS_COMM)
gcc commands/btchip_getRandom.o $(LIBS) $(OBJS_COMM) -o bin/btchip_getRandom -l $(HIDAPI)
btchip_getFirmwareVersion: commands/btchip_getFirmwareVersion.o $(OBJS_COMM)
gcc commands/btchip_getFirmwareVersion.o $(LIBS) $(OBJS_COMM) -o bin/btchip_getFirmwareVersion -l $(HIDAPI)
btchip_getPosSeed: commands/btchip_getPosSeed.o $(OBJS_COMM)
gcc commands/btchip_getPosSeed.o $(LIBS) $(OBJS_COMM) -o bin/btchip_getPosSeed -l $(HIDAPI)
btchip_setTransportWinUSB: commands/btchip_setTransportWinUSB.o $(OBJS_COMM)
gcc commands/btchip_setTransportWinUSB.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setTransportWinUSB -l $(HIDAPI)
btchip_setTransportHID: commands/btchip_setTransportHID.o $(OBJS_COMM)
gcc commands/btchip_setTransportHID.o $(LIBS) $(OBJS_COMM) -o bin/btchip_setTransportHID -l $(HIDAPI)
btchip_util_runScript: utils/btchip_util_runScript.o $(OBJS_COMM)
gcc utils/btchip_util_runScript.o $(LIBS) $(OBJS_COMM) -o bin/btchip_util_runScript -l $(HIDAPI)
btchip_util_parseRawTransaction: utils/btchip_util_parseRawTransaction.o
gcc utils/btchip_util_parseRawTransaction.o $(LIBS) $(OBJS) -o bin/btchip_util_parseRawTransaction
btchip_util_compressPublicKey: utils/btchip_util_compressPublicKey.o
gcc utils/btchip_util_compressPublicKey.o $(LIBS) $(OBJS) -o bin/btchip_util_compressPublicKey
btchip_util_getRegularInputScript: utils/btchip_util_getRegularInputScript.o
gcc utils/btchip_util_getRegularInputScript.o $(LIBS) $(OBJS) -o bin/btchip_util_getRegularInputScript
btchip_util_getP2SHRedeemScript: utils/btchip_util_getP2SHRedeemScript.o
gcc utils/btchip_util_getP2SHRedeemScript.o $(LIBS) $(OBJS) -o bin/btchip_util_getP2SHRedeemScript
btchip_util_getP2SHInputScript: utils/btchip_util_getP2SHInputScript.o
gcc utils/btchip_util_getP2SHInputScript.o $(LIBS) $(OBJS) -o bin/btchip_util_getP2SHInputScript
btchip_util_formatTransaction: utils/btchip_util_formatTransaction.o
gcc utils/btchip_util_formatTransaction.o $(LIBS) $(OBJS) -o bin/btchip_util_formatTransaction
btchip_util_formatOutput: utils/btchip_util_formatOutput.o
gcc utils/btchip_util_formatOutput.o $(LIBS) $(OBJS) -o bin/btchip_util_formatOutput
clean:
rm -rf *.o bin commands/*.o utils/*.o