RPC scaninput: replace Intel implementation of sha256 with the one from cpuminer.
[novacoin.git] / src / makefile.bsd
index 29c497e..ea44263 100644 (file)
@@ -88,9 +88,14 @@ LIBS+= \
 
 DEBUGFLAGS=-g
 
+xOPT_LEVEL=-O2
+ifeq (${USE_O3}, 1)
+    xOPT_LEVEL=-O3
+endif
+
 # CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only
 # adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work.
-xCXXFLAGS=-O0 -msse2 -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter \
+xCXXFLAGS=$(xOPT_LEVEL) -msse2 -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter \
     $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
 
 # LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only
@@ -151,6 +156,7 @@ endif
 ifeq (${USE_ASM}, 1)
 # Assembler implementation
 OBJS += crypto/scrypt/asm/obj/scrypt-arm.o crypto/scrypt/asm/obj/scrypt-x86.o crypto/scrypt/asm/obj/scrypt-x86_64.o crypto/scrypt/asm/obj/asm-wrapper.o
+OBJS += crypto/sha2/asm/obj/sha2-arm.o crypto/sha2/asm/obj/sha2-x86.o crypto/sha2/asm/obj/sha2-x86_64.o
 
 crypto/scrypt/asm/obj/scrypt-x86.o: crypto/scrypt/asm/scrypt-x86.S
        $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
@@ -163,6 +169,17 @@ crypto/scrypt/asm/obj/scrypt-arm.o: crypto/scrypt/asm/scrypt-arm.S
 
 crypto/scrypt/asm/obj/asm-wrapper.o: crypto/scrypt/asm/asm-wrapper.cpp
        $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+
+crypto/sha2/asm/obj/sha2-x86.o: crypto/sha2/asm/sha2-x86.S
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+
+crypto/sha2/asm/obj/sha2-x86_64.o: crypto/sha2/asm/sha2-x86_64.S
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+
+crypto/sha2/asm/obj/sha2-arm.o: crypto/sha2/asm/sha2-arm.S
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+
+DEFS += -DUSE_ASM
 else
 ifeq  (${USE_SSE2}, 1)
 # Intrinsic implementation