.AUTODEPEND

# WWIVMail/QWK Source Makefile

!if !$d(BC40)
!if !$d(BC31)
!if !$d(BC30)
!error You Must Use -DBC40, -DBC31 or -DBC30
!endif
!endif
!endif

!if $d(BC40)
BCROOT  = d:\bc4
!endif
!if $d(BC31)
BCROOT  = d:\bc31
!endif
!if $d(BC30)
BCROOT  = d:\bc30
!endif

#
CC      = $(BCROOT)\bin\bcc    
INCLUDE = $(BCROOT)\include;.;
TLIB    = $(BCROOT)\bin\tlib
TLINK   = $(BCROOT)\bin\tlink  
LIBPATH = $(BCROOT)\lib;
QWKLIB  = .
HEADERS = userrec.h vardec.h instmsg.h net.h share.h subxtr.h

#       *Implicit Rules*
!if $d(BC40)

.cpp.obj:
  $(CC) -I$(INCLUDE) -c -ml -P -RT- {$< }

.c.obj:
  $(CC) -I$(INCLUDE) -c -ml -RT- {$< }

!else

.cpp.obj:
  $(CC) -I$(INCLUDE) -c -ml -P {$< }

.c.obj:
  $(CC) -I$(INCLUDE) -c -ml -P {$< }

!endif

#       *List Macros*


LIB_dependencies =  \
  bbsdata.obj  \
  confutil.obj \
  email.obj    \
  help.obj     \
  msgbase.obj  \
  netpost.obj  \
  qwk.obj      \
  regcode.obj  \ 
  rs232.obj    \
  share.obj    \
  subshift.obj \
  subxtr.obj   \ 
  upload.obj   \
  user_opt.obj \
  util.obj     \
  wwivmail.obj 
  

#       *Explicit Rules*
wwivqwk.exe: userrec.obj $(QWKLIB)\qwk.lib
 $(TLINK) /x/c/n/L$(LIBPATH) @&&|
 c0l.obj     +
 userrec.obj 
 wwivqwk

!if $d(BC40)
 noehl.lib   + 
!endif
 qwk.lib     +
 emu.lib     +
 cl.lib      +
 mathl.lib   
|

qwk.lib: $(LIB_dependencies)
   $(TLIB) qwk.lib @&&| 
+-bbsdata  +-confutil +-email   +-help     +-msgbase &
+-netpost  +-qwk     +-regcode  +-rs232    +-share   &
+-subshift +-subxtr   +-upload  +-user_opt +-util    &
+-wwivmail
|
   del *.bak

#       *Individual File Dependencies*
bbsdata.obj:  bbsdata.cpp 

confutil.obj: confutil.cpp

email.obj: email.cpp 

help.obj: help.cpp 

msgbase.obj: msgbase.cpp 

netpost.obj: netpost.cpp 

qwk.obj: qwk.cpp 

!if $d(REGCODE)
regcode.obj: regcode.cpp 
!endif

rs232.obj: rs232.c  

share.obj: share.c 

subshift.obj: subshift.cpp 

subxtr.obj: subxtr.c 

upload.obj: upload.cpp 

user_opt.obj: user_opt.cpp 

util.obj: util.cpp 

wwivmail.obj: wwivmail.cpp 

userrec.obj: userrec.cpp $(HEADERS) 
