2022-04-14 10:52:29 -04:00
|
|
|
|
2022-08-08 18:31:38 -04:00
|
|
|
CFLAGS = -Wall -Og -Ideps/secp256k1/include
|
2022-04-14 15:35:26 -04:00
|
|
|
OBJS = sha256.o nostril.o aes.o base64.o
|
2022-08-08 18:31:38 -04:00
|
|
|
HEADERS = hex.h random.h config.h sha256.h deps/secp256k1/include/secp256k1.h
|
2022-07-13 13:33:54 -04:00
|
|
|
PREFIX ?= /usr/local
|
2022-08-08 18:31:38 -04:00
|
|
|
ARS = libsecp256k1.a
|
|
|
|
|
|
|
|
SUBMODULES = deps/secp256k1
|
2022-04-14 10:52:29 -04:00
|
|
|
|
|
|
|
all: nostril
|
|
|
|
|
2022-08-08 18:31:38 -04:00
|
|
|
deps/secp256k1/.git:
|
|
|
|
@devtools/refresh-submodules.sh $(SUBMODULES)
|
|
|
|
|
|
|
|
deps/secp256k1/include/secp256k1.h: deps/secp256k1/.git
|
|
|
|
|
|
|
|
deps/secp256k1/configure: deps/secp256k1/.git
|
|
|
|
cd deps/secp256k1; \
|
|
|
|
./autogen.sh
|
|
|
|
|
|
|
|
deps/secp256k1/config.log: deps/secp256k1/configure
|
|
|
|
cd deps/secp256k1; \
|
|
|
|
./configure --disable-shared --enable-module-ecdh --enable-module-schnorrsig --enable-module-extrakeys
|
|
|
|
|
|
|
|
deps/secp256k1/.libs/libsecp256k1.a: deps/secp256k1/config.log
|
|
|
|
cd deps/secp256k1; \
|
|
|
|
make -j libsecp256k1.la
|
|
|
|
|
|
|
|
libsecp256k1.a: deps/secp256k1/.libs/libsecp256k1.a
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
%.o: %.c $(HEADERS)
|
2022-04-14 11:14:13 -04:00
|
|
|
@echo "cc $<"
|
2022-04-14 11:17:10 -04:00
|
|
|
@$(CC) $(CFLAGS) -c $< -o $@
|
2022-04-14 11:14:13 -04:00
|
|
|
|
2022-08-08 18:31:38 -04:00
|
|
|
nostril: $(HEADERS) $(OBJS) $(ARS)
|
|
|
|
$(CC) $(CFLAGS) $(OBJS) $(ARS) -o $@
|
2022-04-14 10:52:29 -04:00
|
|
|
|
2022-04-20 20:15:25 -04:00
|
|
|
install: nostril
|
|
|
|
mkdir -p $(PREFIX)/bin
|
|
|
|
cp nostril $(PREFIX)/bin
|
|
|
|
|
2022-07-06 11:19:23 -04:00
|
|
|
config.h: configurator
|
|
|
|
./configurator > $@
|
2022-04-14 10:52:29 -04:00
|
|
|
|
2022-07-06 11:19:23 -04:00
|
|
|
configurator: configurator.c
|
2022-04-14 10:52:29 -04:00
|
|
|
$(CC) $< -o $@
|
|
|
|
|
|
|
|
clean:
|
2022-08-08 18:31:38 -04:00
|
|
|
rm -f nostril *.o *.a
|
|
|
|
rm -rf deps/secp256k1
|
2022-04-14 10:52:29 -04:00
|
|
|
|
|
|
|
tags: fake
|
|
|
|
ctags *.c *.h
|
|
|
|
|
|
|
|
.PHONY: fake
|