Reorganize scrypt function implementations.
[novacoin.git] / src / makefile.unix
index 9bc4067..dfbb6ec 100644 (file)
@@ -134,8 +134,7 @@ OBJS= \
     obj/wallet.o \
     obj/walletdb.o \
     obj/noui.o \
-    obj/kernel.o \
-    obj/scrypt.o
+    obj/kernel.o
 
 all: novacoind
 
@@ -156,28 +155,33 @@ OBJS += obj/txdb-bdb.o
 endif
 
 ifeq (${USE_ASM}, 1)
-OBJS += obj/scrypt-arm.o obj/scrypt-x86.o obj/scrypt-x86_64.o
+# Assembler implementation
+OBJS += scrypt-asm/obj/scrypt-arm.o scrypt-asm/obj/scrypt-x86.o scrypt-asm/obj/scrypt-x86_64.o scrypt-asm/obj/asm-wrapper.o
 
-obj/scrypt-x86.o: scrypt-x86.S
+scrypt-asm/obj/scrypt-x86.o: scrypt-asm/scrypt-x86.S
        $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
 
-obj/scrypt-x86_64.o: scrypt-x86_64.S
+scrypt-asm/obj/scrypt-x86_64.o: scrypt-asm/scrypt-x86_64.S
        $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
 
-obj/scrypt-arm.o: scrypt-arm.S
+scrypt-asm/obj/scrypt-arm.o: scrypt-asm/scrypt-arm.S
        $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
-endif
-ifneq (${USE_ASM}, 1)
-OBJS += obj/scrypt-generic.o
-
-obj/scrypt-generic.o: scrypt-generic.c
-       $(CC) -c $(xCXXFLAGS) -MMD -o $@ $<
 
+scrypt-asm/obj/asm-wrapper.o: scrypt-asm/asm-wrapper.cpp
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+else
 ifeq  (${USE_SSE2}, 1)
+# Intrinsic implementation
 DEFS += -DUSE_SSE2
-OBJS += obj/scrypt-sse2.o
+OBJS += scrypt-intrin/obj/scrypt-sse2.o
+
+scrypt-intrin/obj/scrypt-sse2.o: scrypt-intrin/scrypt-sse2.cpp
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+else
+# Generic implementation
+OBJS += obj/scrypt-generic.o
 
-obj/scrypt-sse2.o: scrypt-sse2.cpp
+obj/scrypt-generic.o: scrypt-generic.cpp
        $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
 endif
 endif
@@ -206,6 +210,13 @@ clean:
        -rm -f novacoind
        -rm -f obj/*.o
        -rm -f obj/*.P
+       -rm -f obj/*.d
+       -rm -f scrypt-asm/obj/*.o
+       -rm -f scrypt-asm/obj/*.P
+       -rm -f scrypt-asm/obj/*.d
+       -rm -f scrypt-intrin/obj/*.o
+       -rm -f scrypt-intrin/obj/*.P
+       -rm -f scrypt-intrin/obj/*.d
        -rm -f obj/build.h
 
 FORCE: