include ../../../../make-defs

RELEASE = 5
FILES   = thx-play.m thx-play_020.m thxplay.library thxplay.library.020 \
          thxplay.guide thxplay_lib.i thxplay.m
SRCS    = thxplay.asm init.asm song.asm volume.asm multisong.asm note.asm \
          misc.asm
LIBSRCS = $(SRCS) library.asm thxplay.library_rev.i

all: $(FILES) thxplay_lib.fd 
install: $(FILES) thxplay_lib.fd; $(CP) $^ ..
clean:; $(RM) $(FILES) *.m
dist: all install; $(RM) $(FILES)

#-----------

thxplay.guide: $(SRCS)
	mkdoc thxplay $@ $^

thxplay_lib.i: thxplay_lib.fd
	assign FD: . add
	lvo thxplay equates >$@

thxplay.m: thxplay_lib.fd
	fdtom thxplay

#-----------

thx-play.m: $(SRCS)
	$(ASM) NOEXE $< TO thx-play.o
	$(O2M) thx-play
	$(FLUSH) thx-play
	$(RM) thx-play.o

thx-play_020.m: $(SRCS)
	$(ASM) NOEXE $< set _USE020_ TO thx-play_020.o
	$(O2M) thx-play_020
	$(FLUSH) thx-play_020
	$(RM) thx-play_020.o

#-----------

thxplay.library: thxplay.asm $(LIBSRCS)
	$(ASM) EXE $< set _LIBRARY_ TO $@

thxplay.library.020: $(LIBSRCS)
	$(ASM) EXE $< set _LIBRARY_,_USE020_ TO $@

thxplay.library_rev.i:
	$(BUMP) $(RELEASE) thxplay.library
	$(RM) thxplay.library_rev.h
