Reorganize scrypt function implementations.
[novacoin.git] / src / makefile.osx
index 937a825..7c37722 100644 (file)
@@ -93,8 +93,7 @@ OBJS= \
     obj/wallet.o \
     obj/walletdb.o \
     obj/noui.o \
-    obj/kernel.o \
-    obj/scrypt.o
+    obj/kernel.o
 
 ifndef USE_UPNP
        override USE_UPNP = -
@@ -130,26 +129,36 @@ OBJS += obj/txdb-bdb.o
 endif
 
 ifeq (${USE_ASM}, 1)
-OBJS += 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 $@ $<
-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/scrypt-arm.o: scrypt-asm/scrypt-arm.S
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
 
-ifneq (${USE_SSE2}, 1) and eq (${USE_ASM}, 1)
+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
 
-obj/scrypt-sse2.o: scrypt-sse2.cpp
-       $(CXX) -c  $(CFLAGS) -MMD -o $@ $<
+scrypt-intrin/obj/scrypt-sse2.o: scrypt-intrin/scrypt-sse2.cpp
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+else
+ifneq (${USE_ASM}, 1)
+# Generic implementation
+OBJS += obj/scrypt-generic.o
+
+obj/scrypt-generic.o: scrypt-generic.cpp
+       $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
+endif
 endif
 endif
 
@@ -176,6 +185,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: