# Set up internal embedde dconfig
# Input: /local/pcb/mod/CONFFILE is the file name of the conf file (without path)
#        /local/pcb/mod/CONFVAR is the variable name to use in conf_internal.c

switch ?/local/pcb/mod/CONFFILE
case {...}

put /local/pcb/mod/is_hidlib  [@/local/pcb/@/local/pcb/mod@/hidlib@]
resolve /local/pcb/mod/is_hidlib ?/local/pcb/mod/is_hidlib
if ?/local/pcb/mod/is_hidlib
then
	put /local/pcb/MCFG [@$(LIBRND_PLUGDIR)/@/local/pcb/mod@/@/local/pcb/mod/CONFFILE@@]
	put /local/pcb/ICFG [@$(LIBRND_PLUGDIR)/@/local/pcb/mod@/conf_internal.c@]
else
	put /local/pcb/MCFG [@$(PLUGDIR)/@/local/pcb/mod@/@/local/pcb/mod/CONFFILE@@]
	put /local/pcb/ICFG [@$(PLUGDIR)/@/local/pcb/mod@/conf_internal.c@]
end

append /local/pcb/DEPDEPS [@ @/local/pcb/ICFG@ @]
append /local/pcb/DISTCLEANFILES [@ @/local/pcb/ICFG@ @]
append /local/pcb/RULES [@
@/local/pcb/ICFG@: @/local/pcb/MCFG@ $(CQUOTE)
	$(CQUOTE) -n @/local/pcb/mod/CONFVAR@ < @/local/pcb/MCFG@ > @/local/pcb/ICFG@
@]


switch /local/pcb/mod/enabled
	case {1}
		append /local/pcb/rules/install_ [@
	$(SCCBOX) $(HOW) "@/local/pcb/MCFG@" "$(CONFDIR)/@/local/pcb/mod/CONFFILE@"@]
	end
	default end;
end

end
default
end
end

