# makefile for smblib
#
CC = gcc

#CFLAGS = -g -DDEBUG 
# Uncomment the above if you want debugging output ...
# comment the below out if you want debugging
CFLAGS = -g

INCLUDES = smblib.h smblib-priv.h

RFCNB = ../rfcnb/session.o ../rfcnb/rfcnb-util.o ../rfcnb/rfcnb-io.o

OBJS = smblib.o smblib-util.o file.o smb-errors.o exper.o smblib-api.o

.SUFFIXES: .c .o .h

all: test_smblib test_chained test_perf test_password test_chgpwd find_password

.c.o:	$(INCLUDES)
	@echo Compiling $*.c
	$(CC) $(CFLAGS) -c $*.c

test_smblib:	test_smblib.o $(OBJS) $(RFCNB)
	$(CC) $(CFLAGS) -o test_smblib test_smblib.o $(OBJS) $(RFCNB)

test_chained:	test_chained.o $(OBJS) $(RFCNB)
	$(CC) $(CFLAGS) -o test_chained test_chained.o $(OBJS) $(RFCNB)

test_perf: 	test_perf.o $(OBJS) $(RFCNB)
	$(CC) $(CFLAGS) -o test_perf test_perf.o $(OBJS) $(RFCNB)

test_password: test_password.o $(OBJS) $(RFCNB)
	$(CC) $(CFLAGS) -o test_password test_password.o $(OBJS) $(RFCNB)

test_chgpwd: test_chgpwd.o $(OBJS) $(RFCNB)
	$(CC) $(CFLAGS) -o test_chgpwd test_chgpwd.o $(OBJS) $(RFCNB)

find_password: find_password.o $(OBJS) $(RFCNB)
	$(CC) $(CFLAGS) -o find_password find_password.o $(OBJS) $(RFCNB)

$(RFCNB):
	cd ../rfcnb; make

clean:
	rm *.o test_smblib test_chained test_perf
