#YOU MUST CHOOSE YOUR COMPILER
CC=cc
BFLAG='-Xt'

all: warning extra.o bcrypt bchat bpass blogin bkey bhide bpassdel bmore block\
 bunlock

extra.o: extra.c
	$(CC) $(BFLAG) -c extra.c

bcrypt: bcrypt.c 
	$(CC) $(BFLAG) -o bcrypt bcrypt.c extra.o ../lib/unix/bugscrypt.a -lc

bchat: bchat.c
	$(CC) $(BFLAG) -o bchat bchat.c extra.o ../lib/unix/bugscrypt.a -lc -lxnet

bpass: bpass.c
	$(CC) $(BFLAG) -o bpass bpass.c extra.o ../lib/unix/bugscrypt.a -lc

blogin: blogin.c 
	$(CC) $(BFLAG) -o blogin blogin.c extra.o ../lib/unix/bugscrypt.a -lc

bkey: bkey.c
	$(CC) $(BFLAG) -o bkey bkey.c extra.o ../lib/unix/bugscrypt.a -lc

bhide: bhide.c
	$(CC) $(BFLAG) -o bhide bhide.c ../lib/unix/bugscrypt.a -lc

bpassdel: bpassdel.c
	$(CC) $(BFLAG) -o bpassdel bpassdel.c extra.o ../lib/unix/bugscrypt.a -lc

bmore: bmore.c
	$(CC) $(BFLAG) -o bmore bmore.c extra.o ../lib/unix/bugscrypt.a -lc

block: block.c
	$(CC) $(BFLAG) -o block block.c extra.o ../lib/unix/bugscrypt.a -lc

bunlock: bunlock.c
	$(CC) $(BFLAG) -o bunlock bunlock.c extra.o ../lib/unix/bugscrypt.a -lc

shell: warningn.c
	$(CC) $(BFLAG) -o shell blogin.c extra.o ../lib/unix/bugscrypt.a -lc


testfpost: testfpos_t
	$(CC) $(BFLAG) -o testfpos_t testfpos_t.c

clean:
	rm -f bcrypt.o
	rm -f bchat.o
	rm -f bpass.o
	rm -f blogin.o
	rm -f bkey.o
	rm -f bhide.o
	rm -f bpassdel.o
	rm -f bmore.o
	rm -f block.o
	rm -f bunlock.o
	rm -f extra.o
	rm -f bcrypt
	rm -f bchat
	rm -f bpass
	rm -f blogin
	rm -f bkey
	rm -f bhide
	rm -f bpassdel
	rm -f bmore
	rm -f block
	rm -f bunlock
	rm -f shell
	rm -f testfpos_t
         

warning:
	@echo -----------------------------------------------
	@echo WARNING :
	@echo You need bugscrypt.a to compile the applications 
	@echo You must have done before :  make lib
	@echo -----------------------------------------------
	@echo Creating applications ...

