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

put /local/pcb/mod/SPHASH {}
