#
# makefile for k/os mp3player
#
#   Copyright (c)1995-1999 by Thomas Kindler aka cc/kreaPC.
#   All rights reserved.
#

# config macros -----
#
temporary_dir = \tmp

compiler = sdcc
compile_options = -c --stack-after-data

linker   = sdcc
linker_options  = --stack-after-data

bmpfont = ..\source.pc\bmpfont\bmpfont

header_files = mpplayer.h display.h serial.h font.h
object_files = mpplayer.rel display.rel serial.rel cdlogo.rel fnt7x8p.rel fnt5x8p.rel

# rules -----
#
mpplayer.ihx : $(object_files)
    $(linker) $(object_files) $(linker_options)

display.rel : display.c $(header_files)
    $(compiler) display.c $(compile_options)

serial.rel : serial.c $(header_files)
    $(compiler) serial.c $(compile_options)

mpplayer.rel : mpplayer.c $(header_files)
    $(compiler) mpplayer.c $(compile_options)

cdlogo.rel  : cdlogo.c
    $(compiler) cdlogo.c $(compile_options)

fnt7x8p.rel : fnt7x8p.c
    $(compiler) fnt7x8p.c $(compile_options)

fnt5x8p.rel : fnt5x8p.c
    $(compiler) fnt5x8p.c $(compile_options)


# symbolic rules -----
#
fonts   : .SYMBOLIC
    $(bmpfont) fnt5x8p.bmp fnt5x8p.c
    $(bmpfont) fnt7x8p.bmp fnt7x8p.c

reset   : .SYMBOLIC
    spi r

upload  : .SYMBOLIC
    spi u mpplayer.ihx

cleanup : .SYMBOLIC
    del $(temporary_dir) *.lst *.sym *.rel *.bak *.rst *.map *.cdb /y
