#
#  Makefile for files in this directory.
#

compiler = tcc -c
options  = -O -d -Z -w

libman = tlib

all: screen.lib
        @echo Screen routines compiled.
        
screen.lib: drawscr.obj lowvideo.obj scrclip.obj screen.obj scrmask.obj drvmap.obj
        @..\..\..\..\bin\delete screen.lib
        @$(libman) screen.lib + drawscr.obj
        @$(libman) screen.lib + lowvideo.obj
        @$(libman) screen.lib + scrclip.obj
        @$(libman) screen.lib + screen.obj
        @$(libman) screen.lib + scrmask.obj
        @$(libman) screen.lib + drvmap.obj
        @..\..\..\..\bin\delete screen.bak

drawscr.obj: drawscr.c screen.h
        @$(compiler) $(options) drawscr.c

lowvideo.obj: lowvideo.c screen.h ..\mouse\mouse.h ..\c_repl\c-repl.h
        @$(compiler) $(options) lowvideo.c

scrclip.obj: scrclip.c ..\mouse\mouse.h
        @$(compiler) $(options) scrclip.c

screen.obj: screen.asm
        @nasm screen.asm -f obj -o screen.obj

scrmask.obj: scrmask.c screen.h
        @$(compiler) $(options) scrmask.c

drvmap.obj: drvmap.c screen.h
        @$(compiler) $(options) drvmap.c

clean:
        @..\..\..\..\bin\delete drawscr.obj
        @..\..\..\..\bin\delete lowvideo.obj
        @..\..\..\..\bin\delete scrclip.obj
        @..\..\..\..\bin\delete screen.obj
        @..\..\..\..\bin\delete scrmask.obj
        @..\..\..\..\bin\delete drvmap.obj
        @..\..\..\..\bin\delete screen.lib
