Replaced the autotools setup with a Rakefile.
[ruby-ecore.git] / library.rb
diff --git a/library.rb b/library.rb
new file mode 100644 (file)
index 0000000..bf6bd9e
--- /dev/null
@@ -0,0 +1,29 @@
+# $Id: library.rb 318 2005-04-26 11:11:48Z tilman $
+
+require "rbconfig"
+
+class Library
+       PREFIX = ENV["ECORE_PREFIX"] || "/usr/local/"
+
+       def initialize(name)
+               @name = name
+       end
+
+       def ldflags
+               "#{ENV["LDFLAGS"]} -L #{PREFIX}/lib -l#{@name}"
+       end
+
+       def cflags
+               "#{ENV["CFLAGS"]} -I #{PREFIX}/include " +
+               "-I #{Config::CONFIG['archdir']} " +
+               "-I #{Config::CONFIG['sitearchdir']}"
+       end
+
+       def so
+               "src/#{@name}/#{@name}.so"
+       end
+
+       def objects
+               Dir["src/#{@name}/*.c"].map { |f| f.sub(/\.[^.]+$/, ".o") }
+       end
+end