CD_OUTPUT  ?= $(REGION)/$(ARTIFACT).bin
PKG_OUTPUT ?= $(REGION)/$(ARTIFACT).pkg

$(CD_OUTPUT): always
	@mkdir -p $(REGION)
	psxcdgen_ex --list $(REGION)/$(ARTIFACT).lba -o $(REGION)/$(ARTIFACT) bin-cue Config.xml

$(PKG_OUTPUT): always
	@mkdir -p $(REGION)
	@echo "!!PKG generation is experimentel!!"
	run_pop_fe.sh $(ARTIFACT) $(PWD)/assets/pkg $(PWD)/iso/$(REGION)/$(ARTIFACT).cue

all: $(CD_OUTPUT)
clean: pkg_clean
	rm -fr $(REGION)/*.bin
	rm -fr $(REGION)/*.cue
	rm -fr $(REGION)/*.lba

pkg_all: $(PKG_OUTPUT)
pkg_clean:
	rm -fr $(REGION)/*.pkg

always: ;