summaryrefslogtreecommitdiffhomepage
path: root/tasks/toolchains/gcc.rake
diff options
context:
space:
mode:
authorYuichiro MASUI <[email protected]>2013-01-20 22:48:42 +0900
committerYuichiro MASUI <[email protected]>2013-01-20 22:48:42 +0900
commitced80d2b4b1ed4ef0752a8bbaf0dbfe7aa6c6a95 (patch)
treed49c0d0f0b6139ad4c79c3e4b417d65941e97a4f /tasks/toolchains/gcc.rake
parent583983385b81c21f82704b116eab52d606a609f4 (diff)
downloadmruby-ced80d2b4b1ed4ef0752a8bbaf0dbfe7aa6c6a95.tar.gz
mruby-ced80d2b4b1ed4ef0752a8bbaf0dbfe7aa6c6a95.zip
Improved build scripts and config files
Diffstat (limited to 'tasks/toolchains/gcc.rake')
-rw-r--r--tasks/toolchains/gcc.rake21
1 files changed, 21 insertions, 0 deletions
diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake
new file mode 100644
index 000000000..c624c8fc9
--- /dev/null
+++ b/tasks/toolchains/gcc.rake
@@ -0,0 +1,21 @@
+MRuby::Toolchain.new(:gcc) do |conf|
+ conf.cc do |cc|
+ cc.command = ENV['CC'] || 'gcc'
+ cc.flags = [ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)]
+ cc.include_paths = ["#{root}/include"]
+ cc.defines = %w(DISABLE_GEMS)
+ cc.option_include_path = '-I%s'
+ cc.option_define = '-D%s'
+ cc.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}'
+ end
+
+ conf.linker do |linker|
+ linker.command = ENV['LD'] || 'gcc'
+ linker.flags = [ENV['LDFLAGS'] || %w()]
+ linker.libraries = %w(m)
+ linker.library_paths = []
+ linker.option_library = '-l%s'
+ linker.option_library_path = '-L%s'
+ linker.link_options = '%{flags} -o %{outfile} %{objs} %{libs}'
+ end
+end