#!/bin/bash

make apple
rm -rf sys
mkdir sys

cp rel/apple/MATCHFILES#FE1000    sys/matchfiles
cp rel/LZ4CAT#FE1000              sys/lz4cat
cp rel/ARGS#FE1000                sys/args
cp rel/FIBER#FE1000               sys/fiber
cp rel/LONGJMP#FE1000             sys/longjmp
cp rel/MEMMGR#FE1000              sys/memmgr
cp rel/LZ4#FE1000                 sys/lz4
cp rel/INT32#FE1000               sys/int32
cp rel/FPSTR#FE1000               sys/fpstr
cp rel/FPU#FE1000                 sys/fpu
cp rel/SANE#FE1000                sys/sane
cp ../sysfiles/FP6502.CODE#060000 sys/FP6502.CODE
cp ../sysfiles/ELEMS.CODE#060000  sys/ELEMS.CODE
cp rel/PLFORTH#FE1000             sys/plforth

mkdir sys/scripts
cp scripts/plasma.4th         sys/scripts/plasma.4th
cp scripts/machid.4th         sys/scripts/machid.4th
cp scripts/conio.4th          sys/scripts/conio.4th
cp scripts/fileio.4th         sys/scripts/fileio.4th
cp scripts/int32.4th          sys/scripts/int32.4th
cp scripts/fpu.4th            sys/scripts/fpu.4th

cp rel/PLASM#FE1000              sys/plasm
cp rel/CODEOPT#FE1000            sys/codeopt

mkdir prodos/bld/lisp
cp rel/SEXPR#FE1000       sys/sexpr
cp rel/SMATH#FE1000       sys/smath
cp rel/DRAWL#FE1000       sys/drawl

make -f dhgr.tk/makefile all

cp dhgr.tk/libs/DHGRLIB.REL   sys/dhgrlib
cp dhgr.tk/libs/DHGRUTILS.REL sys/dhgrutils
cp dhgr.tk/utils/DHGRRGB.REL  sys/dhgrrgb
