# ***************************************************************************
# Makefile for watcom standard libs

# change comments to use the best suiting assembler/maker/libtool

# ***************************************************************************
# what maker to use
# -* Turbo Make *-
#OBJECTS = startup.obj system.obj memory.obj exit.obj dumbsym.obj  \
#          kbhit.obj printf.obj getch.obj
# -* Watcom Make *-
OBJECTS = startup.obj system.obj memory.obj exit.obj dumbsym.obj &
          kbhit.obj printf.obj getch.obj

# ***************************************************************************
# -* what assembler to use *-
#ASM=tasm $(tasmoptions)
ASM=wasm $(wasmoptions)

# ***************************************************************************
# -* what libutil to use *-
#  tlib doesn't work with wlink so we just use wlib
# Options:
#  -b , don't backup
#  -n , new lib
#  -q , don't print header ("quiet")
LIBOPTS=-b -n -q
LIBTOOL=wlib $(LIBOPTS) $(LIBFILE)

# ***************************************************************************
# Watcom C/C++ options
# -ms = model small, req for wext
# -zl = remove defaultlib infos, req for wext
# -zq = silent compile
CC=WCC386 -zq
CPP=WPP386 -zq

# ***************************************************************************
# Assembler options

# Options passed to Turbo assembler
# /t = silent compile
tasmoptions=/t
# Options passed to Watcom assembler
# -q = silent compile
wasmoptions=-q

# ***************************************************************************
# Misc
LIBFILE=..\..\..\lib\clib3r.lib

# ***************************************************************************
# Making

# what to make
ALL : $(LIBFILE)

# Libfile
$(LIBFILE) : $(OBJECTS)
  del $(LIBFILE)
  $(LIBTOOL) @linkfile.lnk
  del *.obj

# Objects
startup.obj : startup.asm
  $(ASM) startup

printf.obj : printf.asm
  $(ASM) printf.asm

getch.obj : getch.asm
  $(ASM) getch.asm

kbhit.obj : kbhit.asm
  $(ASM) kbhit.asm

system.obj : system.asm
  $(ASM) system.asm

memory.obj : memory.asm
  $(ASM) memory.asm

exit.obj : exit.asm
  $(ASM) exit.asm

dumbsym.obj : dumbsym.asm
  $(ASM) dumbsym.asm
