define make_one
$(MAKE) $1 PSX_TV_FORMAT=PAL CUSTOM_CONFIG=$2
$(MAKE) $1 PSX_TV_FORMAT=NTSC CUSTOM_CONFIG=$2
endef

define make_all
$(call make_one,$1,)
$(foreach config,$2,$(call make_one,$1,$(config)))
endef

config_files = $(shell cd ../../config && ls -d */)

jabyengine_%:
	$(call make_one,$*,$(CUSTOM_CONFIG))

all_jabyengine_%:
	$(call make_all,$*,$(config_files))

all:
	$(call make_all,all,$(config_files))
	
clean:
	$(call make_all,clean,$(config_files))

rebuild:
	$(call make_all,rebuild,$(config_files))