# Copyright 2013 Alexander Peslyak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.


CC = mpicc
LD = mpicc
RM = /bin/rm -f
CFLAGS = -g -O2 -DARCH_LITTLE_ENDIAN=1
#CFLAGS = -Wall -O2 -fomit-frame-pointer
LDFLAGS =  -L/usr/local/lib

PROJ = tests
OBJS_TESTS = crypto_scrypt-best.o crypto_scrypt-common.o sha256.o tests.o
OBJS_RM = crypto_scrypt-*.o

all: $(PROJ)

tests: $(OBJS_TESTS)
	$(LD) $(LDFLAGS) $(OBJS_TESTS) -o $@

check: tests
	./tests

.c.o:
	$(CC) -c $(CFLAGS) $*.c

crypto_scrypt-best.o: scrypt_platform.c \
    crypto_scrypt-sse.c crypto_scrypt-nosse.c
crypto_scrypt-sse.o: scrypt_platform.c
crypto_scrypt-nosse.o: scrypt_platform.c

clean:
	$(RM) $(PROJ) $(OBJS_TESTS) $(OBJS_RM)

distclean: clean
	$(RM) Makefile
