# explicit rules: .sphash -> .c
# Space separated list of .sphash input files
# Optional: aux data fileds:   $(PLUGDIR)/query/consts.sphash::long:int:val;
switch ?/local/rnd/mod/SPHASH
	case {^$} end
	default
		foreach /local/nn in /local/rnd/mod/SPHASH
			put /local/n  /local/nn
			sub {/local/n} {::.*$} {}
			put /local/bn /local/n
			sub {/local/bn} {.[^.]*$} {}
			put /local/pr /local/bn
			sub {/local/pr} {^.*/} {}
			switch /local/nn
				case {::}
					put /local/aux /local/nn
					sub {/local/aux} {^.*::} {}
					gsub {/local/aux} {:} { }
					sub {/local/aux} {^} {--aux "}
					append {/local/aux} {"}
					end
				default
					put /local/aux {}
					end
			end
			append /local/rnd/RULES [@
# sphash for @/local/rnd/mod@
@/local/bn@_sphash.c @/local/bn@_sphash.h: $(SPHASH) @/local/n@
	$(SPHASH) @/local/aux@ --prefix @/local/rnd/mod@_@/local/pr@ --out @/local/bn@_sphash @?/local/rnd/mod/SPHASH_ARGS@ < @/local/n@
@]
			append /local/rnd/CLEANFILES [@@/local/bn@_sphash.c@]
			append /local/rnd/CLEANFILES [@@/local/bn@_sphash.h@]
			append /local/rnd/DEPDEPS [@@/local/bn@_sphash.c@]
			append /local/rnd/DEPDEPS [@@/local/bn@_sphash.h@]
		end
	end
end

put /local/rnd/mod/SPHASH {}
