Makefile tweaks

This commit is contained in:
Pieter Wuille 2013-04-01 12:49:54 +02:00
parent ff29b85510
commit da09a2d426
1 changed files with 16 additions and 16 deletions

View File

@ -3,7 +3,7 @@ FLAGS_PROD:=-DNDEBUG -O2 -march=native
FLAGS_DEBUG:=-DVERIFY -ggdb3 -O1
FLAGS_TEST:=-DVERIFY -ggdb3 -O2 -march=native
SECP256K1_FILES := src/num.h src/field.h src/field_5x52.h src/group.h src/ecmult.h src/ecdsa.h \
SECP256K1_FILES := src/num.h src/field.h src/field_5x52.h src/group.h src/ecmult.h src/ecdsa.h \
src/num.c src/field.c src/field_5x52.c src/group.c src/ecmult.c src/ecdsa.c
JAVA_FILES := src/java/org_bitcoin_NativeSecp256k1.h src/java/org_bitcoin_NativeSecp256k1.c
@ -12,24 +12,24 @@ ifndef CONF
CONF := gmp
endif
OBJS := obj/secp256k1-$(CONF).o
OBJS :=
default: all
ifeq ($(CONF), openssl)
FLAGS_CONF:=-DUSE_NUM_OPENSSL -DUSE_FIELD_INV_BUILTIN
LIBS:=-lcrypto
FLAGS_COMMON := $(FLAGS_COMMON) -DUSE_NUM_OPENSSL -DUSE_FIELD_INV_BUILTIN
LIBS := -lcrypto
SECP256K1_FILES := $(SECP256K1_FILES) src/num_openssl.h src/num_openssl.c src/field_5x52_int128.c
else
ifeq ($(CONF), gmp)
FLAGS_CONF:=-DUSE_NUM_GMP
LIBS:=-lgmp
FLAGS_COMMON := $(FLAGS_COMMON) -DUSE_NUM_GMP
LIBS := -lgmp
SECP256K1_FILES := $(SECP256K1_FILES) src/num_gmp.h src/num_gmp.c src/field_5x52_int128.c
else
ifeq ($(CONF), gmpasm)
FLAGS_CONF:=-DUSE_NUM_GMP -DUSE_FIELD_5X52_ASM
LIBS:=-lgmp obj/field_5x52_asm.o
OBJS:=$(OBJS) obj/field_5x52_asm.o
FLAGS_COMMON := $(FLAGS_COMMON) -DUSE_NUM_GMP -DUSE_FIELD_5X52_ASM
LIBS := -lgmp
OBJS := $(OBJS) obj/field_5x52_asm.o
SECP256K1_FILES := $(SECP256K1_FILES) src/num_gmp.h src/num_gmp.c src/field_5x52_asm.c
obj/field_5x52_asm.o: src/field_5x52_asm.asm
@ -60,18 +60,18 @@ clean-$(CONF):
rm -f bench-$(CONF) tests-$(CONF) libsecp256k1-$(CONF).a libjavasecp256k1-$(CONF).so obj/*
obj/secp256k1-$(CONF).o: $(SECP256K1_FILES) src/secp256k1.c include/secp256k1.h
$(CC) $(FLAGS_COMMON) $(FLAGS_PROD) $(FLAGS_CONF) src/secp256k1.c -c -o obj/secp256k1-$(CONF).o
$(CC) $(FLAGS_COMMON) $(FLAGS_PROD) src/secp256k1.c -c -o obj/secp256k1-$(CONF).o
bench-$(CONF): $(OBJS) src/bench.c
$(CC) $(FLAGS_COMMON) $(FLAGS_PROD) $(FLAGS_CONF) src/bench.c $(LIBS) -o bench-$(CONF)
$(CC) $(FLAGS_COMMON) $(FLAGS_PROD) src/bench.c $(LIBS) $(OBJS) -o bench-$(CONF)
tests-$(CONF): $(OBJS) src/tests.c
$(CC) $(FLAGS_COMMON) $(FLAGS_TEST) $(FLAGS_CONF) src/tests.c $(LIBS) -o tests-$(CONF)
$(CC) $(FLAGS_COMMON) $(FLAGS_TEST) src/tests.c $(LIBS) $(OBJS) -o tests-$(CONF)
libsecp256k1-$(CONF).a: $(OBJS)
$(AR) -rs $@ $(OBJS)
libsecp256k1-$(CONF).a: $(OBJS) obj/secp256k1-$(CONF).o
$(AR) -rs $@ $(OBJS) obj/secp256k1-$(CONF).o
libjavasecp256k1-$(CONF).so: $(OBJS) $(JAVA_FILES)
$(CC) $(FLAGS_COMMON) $(FLAGS_PROD) $(FLAGS_CONF) -I. src/java/org_bitcoin_NativeSecp256k1.c $(LIBS) $(OBJS) -shared -o libjavasecp256k1-$(CONF).so
libjavasecp256k1-$(CONF).so: $(OBJS) obj/secp256k1-$(CONF).o $(JAVA_FILES)
$(CC) $(FLAGS_COMMON) $(FLAGS_PROD) -I. src/java/org_bitcoin_NativeSecp256k1.c $(LIBS) $(OBJS) obj/secp256k1-$(CONF).o -shared -o libjavasecp256k1-$(CONF).so
java: libjavasecp256k1-$(CONF).so