#
#       Makefile for SMBPD
#
# You may wish to change the following four parameters
#

WATINCLUDE=.            # path to WATTCP include files
WATLIB=.                # path to WATTCP lib files
DEBUG= D                # set to D for disable, E for enable symbolic debugging

#
MODEL= C                # set to L for large, C for compact, S for small
#
#
#
# auto configure section
#
#

!if '$(DEBUG)'=='E'
IDEBUG=-v
TEXTDEBUG=enabled
!elif '$(DEBUG)'=='D'
IDEBUG=-v-
TEXTDEBUG=disabled
#!else
#!error  DEBUG must be set to either E or D
!endif

!if '$(MODEL)'=='L'
CMODEL=-ml
CLIB=$(WATLIB)\wattcplg.lib
TEXTMODEL=large
!elif '$(MODEL)'=='C'
CMODEL=-mc
CLIB=$(WATLIB)\wattcpcp.lib
TEXTMODEL=compact
!elif '$(MODEL)'=='S'
CMODEL=-ms
CLIB=$(WATLIB)\wattcpsm.lib
TEXTMODEL=small
!else
!error  MODEL must be set to either S, C or L
!endif

CFLAGS= -DDEBUG -DDOS -O $(CMODEL) $(IDEBUG) -I$(WATINCLUDE) -I\tc\incl31
CC= tcc
DOBJS = smbpd.obj cmd.obj trans.obj nameserv.obj netio.obj lpt.obj util.obj getopt.obj
OBJS = *.obj

#
#
#  list of executables
#
#

smbpd.exe: 	$(DOBJS)
		$(CC) -ls -M $(CFLAGS) -L\tc\lib31 -esmbpd.exe $(OBJS) $(CLIB)

smbpd.obj:	smbpd.c smbpd.h smbpd.h cmd.h nameserv.h netio.h lpt.h util.h
		$(CC) $(CFLAGS) -c smbpd.c

cmd.obj:	cmd.c cmd.h smbpd.h smbhdr.h trans.h netio.h lpt.h util.h
		$(CC) $(CFLAGS) -c cmd.c

trans.obj:	trans.c trans.h smbpd.h smbhdr.h util.h
		$(CC) $(CFLAGS) -c trans.c

nameserv.obj:	nameserv.c nameserv.h smbpd.h smbhdr.h netio.h
		$(CC) $(CFLAGS) -c nameserv.c

netio.obj:	netio.c netio.h smbpd.h smbhdr.h lpt.h util.h
		$(CC) $(CFLAGS) -c netio.c

lpt.obj:	lpt.c lpt.h smbpd.h smbhdr.h util.h
		$(CC) $(CFLAGS) -c lpt.c

util.obj:	util.c util.h
		$(CC) $(CFLAGS) -c util.c

getopt.obj:	getopt.c
		$(CC) $(CFLAGS) -c getopt.c
