
all: ../crypto.a testcip speed test_blowfish digesttest

../crypto.a:
	@if [ ! -f ../crypto.a ]; then	\
		echo "You need to compile the kernel first"; fi

%.o : %.c
	gcc -O2 -Wall -g -c -I../../include $(CFLAGS) $(CPPFLAGS) $< -o $@

speed: ../crypto.a stubs.o speed.o misc.o
	gcc -g -o speed speed.c -I../../include/ ../crypto.a stubs.o misc.o

test_blowfish: ../crypto.a stubs.o test_blowfish.o misc.o
	gcc -g -o test_blowfish test_blowfish.c -I../../include/ ../crypto.a stubs.o misc.o

stubs.o: stubs.c
	gcc -O2 -g -Wall -D__KERNEL__ -c -o stubs.o -I../../include/ stubs.c

testcip: testcip.c stubs.o misc.o
	gcc -O2 -g -Wall -o testcip testcip.c -I../../include/ ../crypto.a stubs.o misc.o

testapi: testapi.c stubs.o misc.o
	gcc -O2 -g -Wall -o testapi testapi.c -I../../include/ ../crypto.a stubs.o misc.o

digesttest: ../crypto.a stubs.o digesttest.o
	gcc -g -o digesttest digesttest.c -I../../include/ ../crypto.a stubs.o misc.o

clean:
	rm -f speed test_blowfish testcip digesttest *.o
