default:
	make hash
	make test_dh
	make hack
	make md5
	make md5.exe

all:
	make clean 
	make hash
	make test_dh
	make hack
	make md5
	make md5.exe

lock:lock.o
	c++ lock.o -o lock md5.o -lcrypto

lock.o:lock.cpp
	c++ lock.cpp -c 

test_dh:test_dh.o detect_hacking.o md5.o lock
	c++ detect_hacking.o md5.o test_dh.o -o test_dh -lcrypto

test_dh.o:test_dh.cpp
	c++ test_dh.cpp -c -DUNIX_OS

detect_hacking.o:detect_hacking.cpp detect_hacking.h
	c++ detect_hacking.cpp -c -DUNIX_OS

test:hack test_dh 
	./md5 test_dh > test_dh.md5
	./test_dh
	./hack test_dh
	./test_dh

clear:
	rm -f test_dh test_dh.o detect_hacking.o md5.o

hack:hack.o
	c++ hack.o -o hack 

hack.o:hack.cpp
	c++ hack.cpp -c

hash:detect_hacking.o hash.o md5.o 
	c++ detect_hacking.o md5.o hash.o -o hash -lcrypto

hash.o:hash.cpp
	c++ hash.cpp -c -DUNIX_OS

md5.o:md5.cpp md5.h 
	c++ md5.cpp -c -DUNIX_OS

md5.exe:
	mingw32-c++ -static md5.cpp md5_main.cpp -o md5.exe -DWINDOWS_OS

test3:
	mingw32-c++ -static md5.cpp detect_hacking.cpp test_dh.cpp -o test_dh.exe -DWINDOWS_OS
	./md5 test_dh.exe > test_dh.exe.md5
	wine test_dh.exe
	./hack test_dh.exe
	wine test_dh.exe

md5:
	c++ md5.cpp md5_main.cpp -o md5 -DUNIX_OS -lcrypto

test2:
	./md5 "filename.txt"
	wine md5.exe "filename.txt"

clean:
	rm -f core *.core *.o test_dh hack hash lock md5 md5.exe

