#
# Makefile
#

default: all

options:
	(for i in 1 2 3 4 5 6; do read; done; cat) \
	< options.default > options

include Rules.make
include options

### Variables ###


### Build Rules ###

.PHONY: all util kernel floppy disk lang clean

all: util kernel lang


floppy: all
	$(MAKE)  -C kernel  floppy

bootfloppy: all
	$(MAKE)  -C kernel  bootfloppy

rawfloppy: all
	$(MAKE)  -C kernel  rawfloppy

kernel:
	$(MAKE)  -C kernel

util:
ifndef DOS
	$(MAKE)  -C util
endif

lang:
	$(MAKE)  -C lang


clean:
	rm -f *~
	$(MAKE)  -C kernel  clean
	$(MAKE)  -C util  clean
	$(MAKE)  -C lang  clean


### Archive/Distribution ###

.PHONY: zip tgz

JUNK = *~ *.rdf

zip: clean
	( cd .. ; zip -r retro.zip retro )

tgz: clean
	( cd .. ; tar zcvf retro.tgz retro )

# Used by bespin:~tunes/bin/junk.script update_retro
archive:
	zsh -fc 'source ~tunes/tunes/build.zsh make_archive retro'
