COGEN=<%= "ruby #{__dir__}/gen/cogen.rb -l" %>
GENDEPS=<%= "#{__dir__}/gen/*.rb #{__dir__}/tmpl/*.c" %>

<%
srcs = %w[s d c z].map{|c| [c, "blas_#{c}.c"]}
srcs.each do |c,s|
%>
<%=s%>: $(GENDEPS)
	$(COGEN) -o $@ <%=c%>
<% end %>

GENSRC=<%= srcs.map{|x| x[1]}.join(" ") %>

src : blas.c $(GENSRC)

doc : $(GENSRC)
	yard doc -m markdown $(GENSRC)

clean: cleansrc cleandoc
cleansrc:
	-$(Q)$(RM) $(GENSRC)
cleandoc:
	-$(Q)$(RM_RF) doc .yardoc
