TAGSRC = \ ../../ruby/include/ruby/*.h \ ../../ruby/*.c \ narray/*.h \ narray/types/*.h \ narray/*.c \ narray/types/*.c \ narray/types/*.cu tags : TAGS TAGS : $(TAGSRC) etags $(TAGSRC) C_TMPL = <%=Dir.glob("narray/gen/tmpl*/*.c").join(" ")%> CU_TMPL = <%=Dir.glob("narray/gen/tmpl*/*.cu").join(" ")%> C_COGEN = narray/gen/cogen.rb CU_COGEN = narray/gen/cogen_kernel.rb C_DEPENDS = $(C_TMPL) narray/gen/*.rb CU_DEPENDS = $(CU_TMPL) narray/gen/*.rb <% list_type_c = [] list_type_rb = Dir.glob("narray/gen/def/*.rb") list_type_rb.each do |type_rb| type_name = File.basename(type_rb, ".rb") next if ENV['DTYPE'] and !type_name.downcase.include?(ENV['DTYPE'].downcase) list_type_c << type_c = "narray/types/" + type_name + ".c" %> <%=type_c%>: <%=type_rb%> $(C_DEPENDS) $(MAKEDIRS) $(@D) types ruby $(C_COGEN) -l -o $@ <%=type_rb%> <% end %> <% list_type_cu = [] list_type_rb = Dir.glob("narray/gen/def/*.rb") list_type_rb.each do |type_rb| type_name = File.basename(type_rb, ".rb") next if ENV['DTYPE'] and !type_name.downcase.include?(ENV['DTYPE'].downcase) list_type_cu << type_cu = "narray/types/" + type_name + "_kernel.cu" %> <%=type_cu%>: <%=type_rb%> $(CU_DEPENDS) $(MAKEDIRS) $(@D) types ruby $(CU_COGEN) -l -o $@ <%=type_rb%> <% end %> src : <%= list_type_cu.join(" ") %> <%= list_type_c.join(" ") %> build-ctest : cuda/memory_pool_impl_test.exe run-ctest : cuda/memory_pool_impl_test.exe ./$< cuda/memory_pool_impl_test.exe: cuda/memory_pool_impl_test.cpp cuda/memory_pool_impl.cpp cuda/memory_pool_impl.hpp nvcc -std=c++14 <%= ENV['DEBUG'] ? '-g -O0 --compiler-options -Wall' : '' %> -L. -L$(libdir) -I. $(INCFLAGS) -o $@ $< cuda/memory_pool_impl.cpp CLEANOBJS = *.o */*.o */*/*.o *.bak narray/types/*.c narray/types/*_kernel.cu *.exe */*.exe