SubDir HAIKU_TOP src libs icu source data sprep ;

# this file has been converted to Jamfile format from sprepbrkfiles.mk

ICU_SPREP_SOURCE = rfc3491.txt rfc3530cs.txt rfc3530csci.txt rfc3530mixp.txt
	rfc3722.txt rfc3920node.txt rfc3920res.txt rfc4011.txt rfc4013.txt
	rfc4505.txt rfc4518.txt rfc4518ci.txt
	;

NotFile ICU_StringPreps ;

# -----------------------------------------------------------------------------
# string-prep files (*.spp)
# -----------------------------------------------------------------------------

rule GenerateStringPrep target : source
{
	MakeLocateICUData $(target) ;
	Depends $(target) : <build>gensprep $(source) ;
	LocalClean clean : $(target) ;
	local unidataDir
		= [ FDirName $(HAIKU_TOP) src libs icu source data unidata ] ;
	NotFile $(unidataDir) ;
	GenerateStringPrep1 $(target) : <build>gensprep $(source) $(unidataDir) ;
}

actions GenerateStringPrep1
{
	$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
	$(2[1]) -d $(1:D) -i $(ICU_DATA_DIR) -s $(2[2]:D) -b $(2[2]:B) -m $(2[3]) -u 3.2.0 $(2[2]:D=)
}

local sprepSources = [ FGristFiles $(ICU_SPREP_SOURCE) ] ;
for source in $(sprepSources) {
	SEARCH on $(source) = $(SUBDIR) ;
	local target = $(source:D=:S=.spp) ;
	Depends ICU_StringPreps : $(target) ;
	GenerateStringPrep $(target) : $(source) ;
}
