# Makefile for Novaterm 10

ASM=$(HOME)/asm64
BAS=$(HOME)/token64

all:		base mod

base:		prgmgr.64 prgmgr.128 boot.64 boot.128 start inet

mod:		dev.ml api.ml

start:		start.txt
		$(BAS) start.txt
		mv start.bas start
		echo api/start >> file-list

inet:		inet.txt
		$(BAS) inet.txt
		mv inet.bas inet
		echo api/inet >> file-list

boot.64:	boot.src nova10.hdr
		$(ASM) -x 64 boot.src
		echo api/boot64 >> file-list

boot.128:	boot.src nova10.hdr
		$(ASM) -x 128 -D C128 boot.src
		echo api/boot128 >> file-list

# API libraries

prgmgr.64:	memmgr.src prgmgr.src nova10.hdr
		$(ASM) -x 64 -p2 memmgr.src
		$(ASM) -x 64 prgmgr.src
		echo api/lib.core64 >> file-list

prgmgr.128:	memmgr.src prgmgr.src nova10.hdr
		$(ASM) -x 128 -D C128 -p2 memmgr.src
		$(ASM) -x 128 -D C128 prgmgr.src
		echo api/lib.core128 >> file-list

dev.ml:		dev.src nova10.hdr
		$(ASM) dev.src
		echo api/lib.device >> file-list

api.ml:		api.src head.src buffer.src disk.src input.src int.src list.src \
		math.src output.src serial.src string.src sys.src init.src \
		nova10.hdr dev.lib mem.lib prg.lib
		$(ASM) api.src
		echo api/lib.api >> file-list

# Header files

nova10.hdr:	label.src vector.lab $(ASM)
		$(ASM) label.src

vector.lab:	vector.src
		$(ASM) vector.src


clean:
		rm nova10.hdr
