# Makefile for Smart BootManager 3.0
#
 
ASM=nasm

all: main.bin loader.bin theme-us.bin theme-zh.bin theme-fr.bin

main.bin: main.asm hd_io.asm ui.asm knl.asm utils.asm tempdata.asm hd_io.h ui.h knl.h sbm.h themes/theme-us.asm themes/theme-zh.asm themes/theme-fr.asm
	${ASM} -fbin -o main.bin main.asm

loader.bin: loader.asm sbm.h
	${ASM} -fbin -o loader.bin loader.asm

theme-us.bin: themes/theme-us.asm 
	${ASM} -fbin -o theme-us.bin themes/theme-us.asm

theme-zh.bin: themes/theme-zh.asm
	${ASM} -fbin -o theme-zh.bin themes/theme-zh.asm

theme-fr.bin: themes/theme-fr.asm
	${ASM} -fbin -o theme-fr.bin themes/theme-fr.asm

emulate: emu-us.com emu-zh.com

emu-us.com: main.asm hd_io.asm ui.asm knl.asm utils.asm tempdata.asm hd_io.h ui.h knl.h sbm.h themes/theme-us.asm
	${ASM} -DEMULATE_PROG -fbin -o emu-us.com main.asm

emu-zh.com: main.asm hd_io.asm ui.asm knl.asm utils.asm tempdata.asm hd_io.h ui.h knl.h sbm.h themes/theme-zh.asm
	${ASM} -DEMULATE_PROG -DTHEME_ZH -fbin -o emu-zh.com main.asm


.PHONY: clean
clean:
	@rm -f *~ *.bin core *.out *.o *.bak *.bkp *.com themes/core themes/*.bak themes/*.bkp themes/*~
