2009-07-16 Vladimir Serbinenko <phcoder@gmail.com>

Fix libusb

	* Makefile.in (LIBUSB): new macro
	* genmk.rb (Utility/print_tail): new method
	(Utility/rule): use intermediary variable #{prefix}_OBJECTS
	(top level): call util.print_tail at the end.
This commit is contained in:
phcoder 2009-07-16 14:53:33 +00:00
parent 59ade63d27
commit 94414221cf
3 changed files with 19 additions and 3 deletions

View file

@ -220,6 +220,13 @@ class Utility
@dir = dir
@name = name
end
def print_tail()
prefix = @name.to_var
print "#{@name}: $(#{prefix}_DEPENDENCIES) $(#{prefix}_OBJECTS)
$(CC) -o $@ $(#{prefix}_OBJECTS) $(LDFLAGS) $(#{prefix}_LDFLAGS)
"
end
attr_reader :dir, :name
def rule(sources)
@ -234,9 +241,7 @@ class Utility
"CLEANFILES += #{@name}$(EXEEXT) #{objs_str}
MOSTLYCLEANFILES += #{deps_str}
#{@name}: $(#{prefix}_DEPENDENCIES) #{objs_str}
$(CC) -o $@ #{objs_str} $(LDFLAGS) $(#{prefix}_LDFLAGS)
#{prefix}_OBJECTS += #{objs_str}
" + objs.collect_with_index do |obj, i|
src = sources[i]
@ -395,4 +400,5 @@ while l = gets
end
end
utils.each {|util| util.print_tail()}