Sha256: 83384b63c69b57984b45634150b1032709e786c7a45420bef15bdc4f686f5169

Contents?: true

Size: 946 Bytes

Versions: 6

Compression:

Stored size: 946 Bytes

Contents

# -*- mode: ruby; coding: utf-8 -*-
%w[../../../rucy/lib ../../../rays/lib ../../lib].each do |path|
  $: << File.expand_path(File.join File.dirname(__FILE__), *path.split('/'))
end
require 'rubygems'
require 'reflex/reflex'


OUT = 'hello'
SRCS = Dir.glob('*.cpp')

REFLEX    = Reflex.name.downcase
LIBREFLEX = File.join(Reflex.library_dirs[0], "lib#{REFLEX}.a")

INCDIRS = %w[/opt/local/include /opt/include] + Reflex.include_dirs
LIBDIRS = %w[] + Reflex.library_dirs

LIBS       = %w[stdc++ objc] + [REFLEX]
FRAMEWORKS = %w[Cocoa]

CFLAGS  = INCDIRS.map{|s| "-I#{s}"}.join(' ')
LDFLAGS = (
  LIBDIRS.map    {|s| "-L#{s}"} +
  LIBS.map       {|s| "-l#{s}"} +
  FRAMEWORKS.map {|s| "-framework #{s}"}
).join(' ')


task :default => :run

task :run => OUT do
  sh %( ./#{OUT} )
end

file OUT => [LIBREFLEX] + SRCS do
  sh %( gcc -o #{OUT} #{CFLAGS} #{LDFLAGS} #{SRCS.join ' '} )
end

task LIBREFLEX do
  sh %( cd #{Reflex.root_dir} && rake )
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reflexion-0.1.6 examples/hello/Rakefile
reflexion-0.1.5 examples/hello/Rakefile
reflexion-0.1.4 examples/hello/Rakefile
reflexion-0.1.3 examples/hello/Rakefile
reflexion-0.1.2 examples/hello/Rakefile
reflexion-0.1.1 examples/hello/Rakefile