# Makefile for the replacement C library

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

libman = tlib

all: c_repl.lib
        @echo C library replacements assembled.

c_repl.lib: strings.obj time.obj gdscreen.obj higdscrn.obj inttostr.obj
        @$(libman) c_repl.lib + strings.obj
        @$(libman) c_repl.lib + time.obj
        @$(libman) c_repl.lib + gdscreen.obj
        @$(libman) c_repl.lib + higdscrn.obj
        @$(libman) c_repl.lib + inttostr.obj
        @del c_repl.bak

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

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

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

higdscrn.obj: higdscrn.c gdscreen.h
        @$(compiler) $(options) higdscrn.c

inttostr.obj: inttostr.c c-repl.h
        @$(compiler) $(options) inttostr.c

clean:
        @del strings.obj
        @del time.obj
        @del gdscreen.obj
        @del higdscrn.obj
        @del inttostr.obj
        @del c_repl.lib
