###########################################################################
# Makefile for netbios client/server for unix
# Copyright Andrew Tridgell 1992,1993
###########################################################################

FLAGS1 = -g
LIBS1 = 

# If you have the gcc compiler then use it, otherwise any ansi-C compiler
CC = gcc

# set these to where to find various files
FLAGS2 = -DDEBUGFILE=\"/home/nimbus/tridge/server/log\"
FLAGS3 = -DSERVICES=\"/home/nimbus/tridge/server/services\"

# set this to the name of the default account, which is the one
# to use when no username or password is specified 
FLAGS4 = -DGUEST_ACCOUNT=\"pcuser\"

# what mode mask to use when creating files and directories
FLAGS5 = -DCREATE_MODE=0755


#####################################
# WHICH OPERATING SYSTEM?
# UNCOMMENT ONE OF THE SECTIONS BELOW
#####################################

# Use this for Linux with shadow passwords
# FLAGSM = -DLINUX -DSHADOW_PWD
# LIBSM = -lshadow

# Use this for Linux without shadow passwords
# FLAGSM = -DLINUX
# LIBSM = 

# This is for SUNOS
FLAGSM = -DSUN -DPWDAUTH -DHAVE_LOCKF
LIBSM =   

# This is for SOLARIS
# FLAGSM = -DSOLARIS -DHAVE_LOCKF
# LIBSM = -lsocket -lnsl

# This is for ULTRIX
# FLAGSM = -DULTRIX -DUSE_DIRECT -DHAVE_LOCKF
# LIBSM =   

# This is for AIX
# FLAGSM = -DAIX -DHAVE_LOCKF
# LIBSM =   

# This is for BSDI
# FLAGSM = -DBSDI -DPWDAUTH -DUSE_DIRECT -DHAVE_LOCKF
# LIBSM =   

# This is for SEQUENT. Can someone test this please?
# FLAGSM = -DSEQUENT -DPWDAUTH -DUSE_DIRECT -DHAVE_LOCKF
# LIBSM =   

# This is for SGI. Can someone test this please?
# FLAGSM = -DSGI -DPWDAUTH -DUSE_DIRECT -DHAVE_LOCKF
# LIBSM =   


CFLAGS = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) $(FLAGS5) $(FLAGSM)
LIBS = $(LIBS1) $(LIBSM)

all: smbserver smbclient nmbserver

INCLUDES = local.h includes.h smb.h 

smbserver: server.o util.o
	$(CC) $(CFLAGS) -o smbserver server.o util.o $(LIBS)

nmbserver: nameserv.o util.o
	$(CC) $(CFLAGS) -o nmbserver nameserv.o util.o $(LIBS)

smbclient: client.o util.o
	$(CC) $(CFLAGS) -o smbclient client.o util.o $(LIBS)

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

clean:
	rm -f *.o *~ smbserver smbclient
