CC = gcc
LD = $(CC)
RM = rm -f
CFLAGS = -std=c99 -D_BSD_SOURCE -Iopenbsd -D__BSD_VISIBLE -O2 -Wall
LDFLAGS = -s
PROJ = bcrypt-tester crypt_blowfish
OBJS = bcrypt-tester.o openbsd/bcrypt.o openbsd/blowfish.o openbsd/strlcpy.o openbsd/strtonum.o crypt_blowfish/crypt_blowfish.o crypt_blowfish/crypt_gensalt.o crypt_blowfish/wrapper.o crypt_blowfish/x86.o

check: $(PROJ)
	./bcrypt-tester

bcrypt-tester: $(OBJS)
	$(LD) $(LDFLAGS) $(OBJS) -o $@

crypt_blowfish:
	$(MAKE) -C $@

clean:
	$(RM) bcrypt-tester $(OBJS)
	$(MAKE) -C crypt_blowfish clean
