[前][次][番号順一覧][スレッド一覧]

ruby-changes:37071

From: nobu <ko1@a...>
Date: Tue, 6 Jan 2015 00:14:57 +0900 (JST)
Subject: [ruby-changes:37071] nobu:r49152 (trunk): ext/-test-/win32/dln: add depend file

nobu	2015-01-06 00:14:48 +0900 (Tue, 06 Jan 2015)

  New Revision: 49152

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49152

  Log:
    ext/-test-/win32/dln: add depend file

  Added files:
    trunk/ext/-test-/win32/dln/depend
  Modified files:
    trunk/ext/-test-/win32/dln/extconf.rb
Index: ext/-test-/win32/dln/depend
===================================================================
--- ext/-test-/win32/dln/depend	(revision 0)
+++ ext/-test-/win32/dln/depend	(revision 49152)
@@ -0,0 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ext/-test-/win32/dln/depend#L1
+$(TARGET_SO): $(DLNTESTLIB)
+
+$(DLNTESTLIB): $(topdir)/dlntest.dll
+
+$(topdir)/dlntest.dll: libdlntest.o libdlntest.def
+	$(ECHO) linking shared-object $(@F)
+	-$(Q)$(RM) $@
+	-$(Q)$(MAKEDIRS) $(@D)
+	$(Q) $(DLNTEST_LDSHARED)

Property changes on: ext/-test-/win32/dln/depend
___________________________________________________________________
Added: svn:eol-style
   + LF

Index: ext/-test-/win32/dln/extconf.rb
===================================================================
--- ext/-test-/win32/dln/extconf.rb	(revision 49151)
+++ ext/-test-/win32/dln/extconf.rb	(revision 49152)
@@ -1,37 +1,32 @@ https://github.com/ruby/ruby/blob/trunk/ext/-test-/win32/dln/extconf.rb#L1
 if $mingw or $mswin
+  dlntestlib = "dlntest.#{$LIBEXT}"
+  $LOCAL_LIBS << " #{dlntestlib}"
+  $srcs = ["dlntest.c"]
   $objs = ["dlntest.o"]
   testdll = "$(topdir)/dlntest.dll"
   $cleanfiles << testdll
   $cleanfiles << "dlntest.#{$LIBEXT}"
   config_string('cleanobjs') {|t| $cleanfiles.concat(t.gsub(/\$\*/, 'dlntest').split)}
 
-  create_makefile("-test-/win32/dln")
-  m = File.read("Makefile")
-  dlntestlib = "dlntest.#{$LIBEXT}"
-  m.sub!(/^OBJS =.*/) {"#{$&} #{dlntestlib}"}
-  FileUtils.rm_f(RbConfig.expand(testdll.dup))
-  open("Makefile", "wb") do |mf|
-    mf.puts m, "\n"
-    sodir = $extout ? "$(RUBYARCHDIR)/" : ''
-    mf.print "#{sodir}$(DLLIB): #{dlntestlib}"
-    mf.puts
-    mf.puts "#{dlntestlib}: $(topdir)/dlntest.dll"
-    mf.puts
+  create_makefile("-test-/win32/dln") do |m|
+    m << "\n""DLNTESTLIB = #{dlntestlib}\n"
     if $mingw
-      mf.puts "$(topdir)/dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def"
-      mf.puts "$(topdir)/dlntest.dll: DLDFLAGS += -Wl,--out-implib,#{dlntestlib}"
+      m << "\n"
+      m << "$(topdir)/dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def\n"
+      m << "$(topdir)/dlntest.dll: DLDFLAGS += -Wl,--out-implib,$(DLNTESTLIB)\n"
     end
-    mf.puts depend_rules("$(topdir)/dlntest.dll: libdlntest.o libdlntest.def")
-    mf.puts "\t$(ECHO) linking shared-object $(@F)\n"
-    mf.print "\t-$(Q)$(RM) $@\n"
-    mf.print "\t-$(Q)$(MAKEDIRS) $(@D)\n" if $extout
-    link_so = LINK_SO.gsub(/^/, "\t$(Q) ")
+    m
+  end
+  m = File.read("Makefile")
+  m.sub!(/(.*)\$\(DLNTEST_LDSHARED\)$/) do
+    pre = $1
+    link_so = LINK_SO.gsub(/^/) {pre}
     link_so.sub!(/\$\(LOCAL_LIBS\)/, '')
     link_so.gsub!(/-\$\(arch\)/, '')
     link_so.gsub!(/:.so=/, ':.dll=')
     link_so.sub!(/\$\(OBJS\)/, "libdlntest.#{$OBJEXT}")
     link_so.sub!(/\$\(DEFFILE\)/, "$(srcdir)/libdlntest.def")
-    mf.puts link_so
-    mf.puts
-  end
+    link_so
+  end and File.binwrite("Makefile", m)
+  FileUtils.rm_f(RbConfig.expand(testdll.dup))
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]