ROOT_DIR := $(notdir $(CURDIR))
ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)

HOST_MKIFS := mkifs

SUFFIXES := .build .ifs .bin .elf

.PHONY: all clean

all: cpc108 cpc502 ifs-cpc150.bin

clean: 
	$(RM_HOST) ifs-* ipl-*

ifs-cpc108.bin: cpc108.build
	$(HOST_MKIFS) -v -r../install $(MKIFSFLAGS) $^ $@

ifs-cpc502.bin: cpc502.build
	$(HOST_MKIFS) -v -r../install $(MKIFSFLAGS) $^ $@

ifs-cpc150.bin: cpc150.build
	$(HOST_MKIFS) -v -r../install $(MKIFSFLAGS) $^ $@

cpc108: ifs-cpc108.bin
	cat ../install/x86/boot/sys/ipl-fastwel ifs-cpc108.bin > ipl-ifs-cpc108.bin
	
cpc502: ifs-cpc502.bin
	cat ../install/x86/boot/sys/ipl-fastwel-pnp ifs-cpc502.bin > ipl-ifs-cpc502.bin