You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. $(shell CC=$(CC) YASM=$(YASM) ./configure)
  2. include config.mk
  3. FILES := src/*.h src/impl/*.h
  4. JAVA_FILES := src/java/org_bitcoin_NativeSecp256k1.h src/java/org_bitcoin_NativeSecp256k1.c
  5. OBJS :=
  6. ifeq ($(USE_ASM), 1)
  7. OBJS := $(OBJS) obj/field_5x52_asm.o
  8. endif
  9. default: tests libsecp256k1.a libsecp256k1.so
  10. ./tests
  11. clean:
  12. rm -rf obj/*.o bench tests *.a *.so config.mk
  13. obj/field_5x52_asm.o: src/field_5x52_asm.asm
  14. $(YASM) -f elf64 -o obj/field_5x52_asm.o src/field_5x52_asm.asm
  15. obj/secp256k1.o: $(FILES) src/secp256k1.c include/secp256k1.h
  16. $(CC) -fPIC -std=c99 $(CFLAGS) $(CFLAGS_EXTRA) -DNDEBUG -O2 src/secp256k1.c -c -o obj/secp256k1.o
  17. bench: $(FILES) src/bench.c $(OBJS)
  18. $(CC) -fPIC -std=c99 $(CFLAGS) $(CFLAGS_EXTRA) -DNDEBUG -O2 src/bench.c $(OBJS) $(LDFLAGS_EXTRA) -o bench
  19. tests: $(FILES) src/tests.c $(OBJS)
  20. $(CC) -std=c99 $(CFLAGS) $(CFLAGS_EXTRA) -DVERIFY -O1 src/tests.c $(OBJS) $(LDFLAGS_EXTRA) -o tests
  21. libsecp256k1.a: obj/secp256k1.o $(OBJS)
  22. $(AR) -rs $@ $(OBJS) obj/secp256k1.o
  23. libsecp256k1.so: obj/secp256k1.o $(OBJS)
  24. $(CC) -std=c99 $(LDFLAGS_EXTRA) $(OBJS) obj/secp256k1.o -shared -o libsecp256k1.so
  25. libjavasecp256k1.so: $(OBJS) obj/secp256k1.o $(JAVA_FILES)
  26. $(CC) -fPIC -std=c99 $(CFLAGS) $(CFLAGS_EXTRA) -DNDEBUG -O2 -I. src/java/org_bitcoin_NativeSecp256k1.c $(LDFLAGS_EXTRA) $(OBJS) obj/secp256k1.o -shared -o libjavasecp256k1.so