module Rscons class CC < Builder VARIABLE_DEFAULTS = { 'CC' => 'gcc', 'CFLAGS' => [], 'CPPFLAGS' => [], 'OBJSUFFIX' => '.o', 'CEXTS' => ['.c'], 'CCCOM' => ['$CC', '-c', '-o', '$TARGET', '$CPPFLAGS', '$CFLAGS', '$SOURCES'] } def self.produces?(env, suffix) suffix == env['OBJSUFFIX'] end def run(env, target, source) raise "String expected, not #{source.inspect}" unless source.is_a?(String) unless Cache.open.up_to_date?(target, [source]) vars = { 'TARGET' => target, 'SOURCES' => source, } env.execute("CC #{target}", env['CCCOM'], vars) Cache.open.register_build(target, [source]) end target end end end