# UDP port which server listens on (clients listen on arbitrary port)
PORT=2001
# maximum number of clients (theoretically should handle several thousand)
JOBS=256
# size of a block farmed out to a client (increase for large number of clients)
CHUNK=750521
# assume that client is dead after this many iterations without reply
TIMEOUT=42

VERSION=0.1

all: dcc dcs

dcc: dcc.c
	gcc -DPORT=$(PORT) -O6 -s -static -fomit-frame-pointer dcc.c -o dcc -lcrypt
dcs: dcs.c
	gcc -DPORT=$(PORT) -DJOBS=$(JOBS) -DCHUNK=$(CHUNK) -DTIMEOUT=$(TIMEOUT) -O6 -s -static -fomit-frame-pointer dcs.c -o dcs -lcrypt

clean:
	rm -f dcs dcc

package:
	rm -f dc-$(VERSION)
	ln -s . dc-$(VERSION)
	tar czvf dc-$(VERSION).tar.gz dc-$(VERSION)/{Makefile,dcc.c,dcs.c,README,mklsm}
	./mklsm dc $(VERSION) "Distributed brute force password cracker suitable for creating vanity password hashes." "password, cracker"
	rm -f dc-$(VERSION)
