prefix=/usr/local/cifs_bm
exec_prefix=${prefix}
mandir=${prefix}/man

LIBS= @LIBS@
CC=gcc
SHLD=${CC}
#CFLAGS=-O -g
CFLAGS= -g
CPPFLAGS=
LDFLAGS=
AWK=awk
DYNEXP=

TERMLDFLAGS=
TERMLIBS=-lreadline -lncurses

LINK=$(CC) $(FLAGS) $(LDFLAGS)

INSTALLCMD=/usr/bin/install -c

srcdir=.
SHELL=/bin/sh

# XXX: Perhaps this should be /bin/sh instead -- apparently autoconf
# will search for a POSIX-compliant shell, and that might not be
# /bin/sh on some platforms.  I guess it's not a big problem -- mbp

# See the autoconf manual "Installation Directory Variables" for a
# discussion of thesubtle use of these variables.

BASEDIR= /usr/local/cifs_bm
BINDIR = ${exec_prefix}/bin
SBINDIR = ${exec_prefix}/sbin
LIBDIR = ${exec_prefix}/lib
VARDIR = ${prefix}/var
MANDIR = ${prefix}/man

# The permissions to give the executables
INSTALLPERMS = 0755

# set these to where to find various files

# man pages language(s)
man_langs = "en"

FLAGS = $(CFLAGS) -Iinclude -I$(srcdir)/include -I. $(CPPFLAGS) -I$(srcdir)

WINBIND_PROGS = 
WINBIND_SPROGS = 
WINBIND_PAM_PROGS = 
WINBIND_LPROGS = 

BM_PROGS = bin/cifs_bm

BM_OBJ = torture/cifs_bm.o torture/nbio.o torture/clifile.o torture/nmblib.o \
	 torture/clientgen.o torture/cliconnect.o torture/clierror.o \
	 torture/clireadwrite.o torture/clilist.o torture/clistr.o \
	 torture/clitrans.o torture/clirap.o torture/system.o \
	 torture/util.o torture/time.o torture/nterr.o \
	 torture/util_str.o torture/util_sock.o torture/debug.o \
	 torture/clioplock.o torture/smbencrypt.o torture/talloc.o \
	 torture/smberr.o torture/errormap.o torture/hmacmd5.o \
	 torture/smbdes.o torture/md4.o torture/md5.o torture/genrand.o \
	 torture/util_unistr.o torture/charcnv.o torture/iconv.o

all : SHOWFLAGS include/proto.h $(BM_PROGS)

cifs_bm : SHOWFLAGS bin/cifs_bm

.SUFFIXES:
.SUFFIXES: .c .o .po .po32 .lo

SHOWFLAGS:
	@echo "Using FLAGS = $(FLAGS)"
	@echo "      FLAGS32 = $(FLAGS32)"
	@echo "      LIBS = $(LIBS)"
	@echo "      LDSHFLAGS = $(LDSHFLAGS)"
	@echo "      LDFLAGS = $(LDFLAGS)"

.c.o:
	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
	 dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
	@echo Compiling $*.c
	@$(CC) -I. -I$(srcdir) $(FLAGS) -c $< \
	  -o $@ 
#	-mv `echo $@ | sed 's%^.*/%%g'` $@

bin/.dummy:
	@if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \
	  dir=bin $(MAKEDIR); fi
	@: >> $@ || : > $@ # what a fancy emoticon!

bin/cifs_bm: $(BM_OBJ) bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(BM_OBJ) $(LDFLAGS) $(LIBS)

clean:
	rm -f bin/cifs_bm torture/*.o config.cache
