From: Hugh Sasse Staff Elec Eng Date: 2002-02-07T19:22:28+09:00 Subject: Re: mkmf, extconf.rb On Thu, 7 Feb 2002 nobu.nokada@softhome.net wrote: > Hi, > > At Thu, 7 Feb 2002 01:11:49 +0900, > Hugh Sasse Staff Elec Eng wrote: > > Further to my suggestions in Ruby-Talk:31391, about adding methods to > > mkmf so that rules can be added to makefiles, I have "lashed together" > > the following patch. It works with an array of dependencies, but before > > I test all the combinations of arguments permitted, has anyone any > > comments? > > I guess you can do it with `depend' file. I have found that bit of code in mkmf: depend = File.join(srcdir, "depend") if File.exist?(depend) dfile = open(depend, "r") mfile.printf "###\n" while line = dfile.gets() mfile.printf "%s", line.gsub(/\.o\b/, ".#{$OBJEXT}") end dfile.close end I don't think you can use this for adding more make rules, because it is not completely transparent. Suppose your action includes ruby code which does 'gsub(/\.o\b/, ".#{$OBJEXT}")'. This will get rendered as "gsub(/\.#{$OBJEXT}\b/" etc. Maybe this could be extracted to a method, and have the substitution optional? > > -- > Nobu Nakada > Hugh