-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.in
More file actions
46 lines (34 loc) · 1.29 KB
/
Copy pathMakefile.in
File metadata and controls
46 lines (34 loc) · 1.29 KB
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
include config.mk
SECP = deps/secp256k1
DEFS = -DENABLE_MODULE_SCHNORRSIG -DENABLE_MODULE_EXTRAKEYS \
-DENABLE_MODULE_ECDH -DUSE_TCL_STUBS $(EXTRA_DEFS)
CFLAGS = -O2 -Wall
CPPFLAGS = -I$(SECP)/include -Ivendor $(TCL_INCLUDE_SPEC) $(DEFS)
VPATH = vendor:$(SECP)/src
SRCS = tclnostr.c rand.c nip44.c chacha20.c hmac_sha256.c base64.c \
sha256.c bech32.c \
secp256k1.c precomputed_ecmult.c precomputed_ecmult_gen.c
OBJS = $(SRCS:%.c=build/s/%.o)
POBJS = $(SRCS:%.c=build/p/%.o)
# The vendored secp256k1 is compiled outside its build system, so its
# shared headers declare statics that the precomputed-table TUs never
# define or use; not ours to fix, silence just that class just there.
SECPOBJS = build/s/secp256k1.o build/p/secp256k1.o \
build/s/precomputed_ecmult.o build/p/precomputed_ecmult.o \
build/s/precomputed_ecmult_gen.o build/p/precomputed_ecmult_gen.o
$(SECPOBJS): CFLAGS += -Wno-unused-function
all: libnostr.a $(SHARED)
libnostr.a: $(OBJS)
$(AR) cr $@ $(OBJS)
$(RANLIB) $@
libnostr.so: $(POBJS)
$(CC) -shared -o $@ $(POBJS) $(TCL_STUB_LIB_SPEC)
build/s/%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
build/p/%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
test: $(SHARED)
$(TCLSH) tests/all.tcl
clean:
rm -rf build/s/*.o build/p/*.o libnostr.a libnostr.so
.PHONY: all test clean