Skip to content

Commit

Permalink
Merge branch 'release/0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Jul 18, 2013
2 parents 7d4a4f6 + 22072ae commit 7de0939
Show file tree
Hide file tree
Showing 66 changed files with 862 additions and 305 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ branches:
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq llvm-gcc-4.6

11 changes: 10 additions & 1 deletion Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ guard 'rspec', :cli => "--color --drb -r rspec/instafail -f RSpec::Instafail", :
end


guard 'cucumber', :rvm => [ "1.8.7", "1.9.3", "2.0.0" ], :all_on_start => false do
require "paper-house/platform"

cli_opts = %w(--format progress --strict --profile)
if PaperHouse::Platform::MAC
cli_opts << "mac"
else
cli_opts << "linux"
end

guard 'cucumber', :cli => cli_opts.join( " " ), :rvm => [ "1.8.7", "1.9.3", "2.0.0" ], :all_on_start => false do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { 'features' }
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Paper House
===========
[![Gem Version](https://badge.fury.io/rb/paper-house.png)](http://badge.fury.io/rb/paper-house)
[![Build Status](https://travis-ci.org/trema/paper-house.png?branch=master)](https://travis-ci.org/trema/paper-house)
[![Build Status](https://travis-ci.org/trema/paper-house.png?branch=develop)](https://travis-ci.org/trema/paper-house)
[![Code Climate](https://codeclimate.com/github/trema/paper-house.png)](https://codeclimate.com/github/trema/paper-house)
[![Coverage Status](https://coveralls.io/repos/trema/paper-house/badge.png?branch=master)](https://coveralls.io/r/trema/paper-house)
[![Coverage Status](https://coveralls.io/repos/trema/paper-house/badge.png?branch=develop)](https://coveralls.io/r/trema/paper-house)
[![Dependency Status](https://gemnasium.com/trema/paper-house.png)](https://gemnasium.com/trema/paper-house)

<a href="http://www.flickr.com/photos/studiobeerhorst/8221979536/" title="paper houses - 3d woodcut prints by Rick&Brenda Beerhorst, on Flickr"><img src="http://farm9.staticflickr.com/8202/8221979536_60404c309d_n.jpg" width="320" height="240" alt="paper houses - 3d woodcut prints" align="right"></a>
Expand Down Expand Up @@ -56,7 +56,7 @@ PaperHouse::ExecutableTask.new :hello do | task |
task.sources = "sources"
task.cflags = [ "-Werror", "-Wall", "-Wextra" ]
task.ldflags = "-L/some/path"
task.library_dependencies = [ "mylib", "m" ]
task.library_dependencies = "m"
end
```

Expand Down
11 changes: 9 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2013 NEC Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# it under the terms of the GNU General Public License, version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
Expand Down Expand Up @@ -47,7 +47,14 @@ end

require "cucumber/rake/task"
Cucumber::Rake::Task.new do | t |
t.cucumber_opts = "--tags ~@wip"
profile = %w(--profile)
require "paper-house/platform"
if PaperHouse::Platform::MAC
profile << "mac"
else
profile << "linux"
end
t.cucumber_opts = profile.join( " " )
end


Expand Down
3 changes: 3 additions & 0 deletions cucumber.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linux: --tags ~@wip --tags ~@mac
mac: --tags ~@wip --tags ~@linux

5 changes: 5 additions & 0 deletions examples/c_extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.hello.depends
hello.bundle
hello.o
hello.so

13 changes: 0 additions & 13 deletions examples/c_extension/Rakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
require "paper-house"

PaperHouse::CExtensionTask.new :hello


################################################################################
#
# If you want to use non-default compiler like llvm-gcc,
# please specify the cc= property or pass the CC= option to rake command.
#
################################################################################

PaperHouse::CExtensionTask.new :llvm_hello do | task |
task.library_name = "hello"
task.cc = "llvm-gcc"
end
5 changes: 5 additions & 0 deletions examples/c_extension/Rakefile.llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require "paper-house"

PaperHouse::CExtensionTask.new :hello do | task |
task.cc = "llvm-gcc"
end
2 changes: 1 addition & 1 deletion examples/c_extension/hello.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

void
Init_hello() {
VALUE cHello = rb_define_class( "Hello", rb_cObject );
VALUE cHelloPaperHouse = rb_define_class( "HelloPaperHouse", rb_cObject );
}
4 changes: 4 additions & 0 deletions examples/executable/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.hello.depends
hello
hello.o

12 changes: 0 additions & 12 deletions examples/executable/Rakefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
require "paper-house"

PaperHouse::ExecutableTask.new :hello


################################################################################
#
# If you want to use non-default compiler like llvm-gcc, please
# specify the cc= property or pass the CC= option to rake command.
#
################################################################################

PaperHouse::ExecutableTask.new :llvm_hello do | task |
task.cc = "llvm-gcc"
end
5 changes: 5 additions & 0 deletions examples/executable/Rakefile.llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require "paper-house"

PaperHouse::ExecutableTask.new :hello do | task |
task.cc = "llvm-gcc"
end
4 changes: 4 additions & 0 deletions examples/executable_subdirs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.hello.depends
hello
hello.o
main.o
5 changes: 2 additions & 3 deletions examples/executable_subdirs/Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
require "paper-house"

PaperHouse::ExecutableTask.new :sqrt do | task |
task.executable_name = "print_sqrt"
PaperHouse::ExecutableTask.new :hello do | task |
task.executable_name = "hello"
task.target_directory = "objects"
task.sources = "sources/*.c"
task.includes = "includes"
task.cflags = [ "-Wall", "-Wextra" ]
task.library_dependencies = "m"
end
1 change: 1 addition & 0 deletions examples/executable_subdirs/includes/hello.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void print_hello();
1 change: 0 additions & 1 deletion examples/executable_subdirs/includes/sqrt.h

This file was deleted.

6 changes: 6 additions & 0 deletions examples/executable_subdirs/sources/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

void
print_hello() {
printf( "Hello, PaperHouse!\n");
}
6 changes: 3 additions & 3 deletions examples/executable_subdirs/sources/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <stdlib.h>
#include "sqrt.h"
#include "hello.h"

int
main( int argc, char *argv[] ) {
print_sqrt( atof( argv[ 1 ] ) );
main() {
print_hello();
return 0;
}
7 changes: 0 additions & 7 deletions examples/executable_subdirs/sources/sqrt.c

This file was deleted.

8 changes: 8 additions & 0 deletions examples/shared_library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.hello.depends
.libhello.depends
hello
hello.o
libhello.so
libhello.so.0
libhello.so.0.1.0
main.o
29 changes: 3 additions & 26 deletions examples/shared_library/Rakefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,16 @@
require "paper-house"

libhello = PaperHouse::SharedLibraryTask.new :libhello do | task |
$libhello = PaperHouse::SharedLibraryTask.new :libhello do | task |
task.version = "0.1.0"
task.sources = "hello.c"
end

task :hello => [ libhello.linker_name, libhello.soname ]

file libhello.linker_name => :libhello do | task |
symlink libhello.target_file_name, task.name
end

file libhello.soname => :libhello do | task |
symlink libhello.target_file_name, task.name
end
task :hello => [ :libhello, $libhello.linker_name, $libhello.soname ]

PaperHouse::ExecutableTask.new :hello do | task |
task.sources = "main.c"
task.ldflags = "-L."
task.library_dependencies = "hello"
end


################################################################################
#
# If you want to use non-default compiler like llvm-gcc,
# please specify the cc= property or pass the CC= option to rake command.
#
################################################################################

task :llvm_hello => [ libhello.linker_name, libhello.soname ]

PaperHouse::ExecutableTask.new :llvm_hello do | task |
task.sources = "main.c"
task.cc = "llvm-gcc"
task.ldflags = "-L."
task.library_dependencies = "hello"
end
load "symlinks.rake"
18 changes: 18 additions & 0 deletions examples/shared_library/Rakefile.llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require "paper-house"

$libhello = PaperHouse::SharedLibraryTask.new :libhello do | task |
task.version = "0.1.0"
task.sources = "hello.c"
task.cc = "llvm-gcc"
end


task :hello => [ :libhello, $libhello.linker_name, $libhello.soname ]

PaperHouse::ExecutableTask.new :hello do | task |
task.sources = "main.c"
task.cc = "llvm-gcc"
task.ldflags = "-L."
end

load "symlinks.rake"
7 changes: 7 additions & 0 deletions examples/shared_library/symlinks.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ $libhello.linker_name, $libhello.soname ].each do | each |
file each do | task |
symlink $libhello.target_file_name, task.name
end

CLOBBER.include each if FileTest.exists?( each )
end
8 changes: 8 additions & 0 deletions examples/shared_library_subdirs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.hello.depends
.libhello.depends
hello
hello.o
libhello.so
libhello.so.0
libhello.so.0.1.0
main.o
28 changes: 13 additions & 15 deletions examples/shared_library_subdirs/Rakefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
require "paper-house"

task :sqrt => :libsqrt

libsqrt = PaperHouse::SharedLibraryTask.new :libsqrt do | task |
task.library_name = "printsqrt"
libhello = PaperHouse::SharedLibraryTask.new :libhello do | task |
task.library_name = "hello"
task.version = "0.1.0"
task.target_directory = "objects"
task.sources = "sources/sqrt.c"
task.sources = "sources/hello.c"
task.includes = "includes"
task.cflags = [ "-Werror", "-Wall", "-Wextra" ]
end

task :sqrt => [ libsqrt.linker_name, libsqrt.soname ]

file libsqrt.linker_name => :libsqrt do | task |
symlink File.join( "objects", libsqrt.target_file_name ), task.name
end

file libsqrt.soname => :libsqrt do | task |
symlink File.join( "objects", libsqrt.target_file_name ), task.name
end
task :hello => [ :libhello, libhello.linker_name, libhello.soname ]

PaperHouse::ExecutableTask.new :sqrt do | task |
PaperHouse::ExecutableTask.new :hello do | task |
task.sources = "sources/main.c"
task.includes = "includes"
task.ldflags = "-L."
task.library_dependencies = [ "printsqrt", "m" ]
end

[ libhello.linker_name, libhello.soname ].each do | each |
file each do | task |
symlink File.join( "objects", libhello.target_file_name ), task.name
end

CLOBBER.include each if FileTest.exists?( each )
end
1 change: 1 addition & 0 deletions examples/shared_library_subdirs/includes/hello.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void print_hello();
1 change: 0 additions & 1 deletion examples/shared_library_subdirs/includes/sqrt.h

This file was deleted.

6 changes: 6 additions & 0 deletions examples/shared_library_subdirs/sources/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

void
print_hello() {
printf( "Hello, PaperHouse!\n" );
}
8 changes: 3 additions & 5 deletions examples/shared_library_subdirs/sources/main.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include <stdlib.h>
#include "sqrt.h"
#include "hello.h"

int
main( int argc, char *argv[] ) {
if ( argc > 1 ) {
print_sqrt( atof( argv[ 1 ] ) );
}
main() {
print_hello();
return 0;
}
7 changes: 0 additions & 7 deletions examples/shared_library_subdirs/sources/sqrt.c

This file was deleted.

7 changes: 7 additions & 0 deletions examples/static_library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.hello.depends
.libhello.depends
hello
hello.o
libhello.a
main.o

19 changes: 1 addition & 18 deletions examples/static_library/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,8 @@ PaperHouse::StaticLibraryTask.new :libhello do | task |
task.sources = "hello.c"
end

PaperHouse::ExecutableTask.new :hello do | task |
task.ldflags = "-L."
task.sources = "main.c"
task.library_dependencies = "hello"
end


################################################################################
#
# If you want to use non-default compiler like llvm-gcc,
# please specify the cc= property or pass the CC= option to rake command.
#
################################################################################

task :llvm_hello => :libhello

PaperHouse::ExecutableTask.new :llvm_hello do | task |
task.cc = "llvm-gcc"
PaperHouse::ExecutableTask.new :hello do | task |
task.ldflags = "-L."
task.sources = "main.c"
task.library_dependencies = "hello"
end
14 changes: 14 additions & 0 deletions examples/static_library/Rakefile.llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "paper-house"

task :hello => :libhello

PaperHouse::StaticLibraryTask.new :libhello do | task |
task.cc = "llvm-gcc"
task.sources = "hello.c"
end

PaperHouse::ExecutableTask.new :hello do | task |
task.cc = "llvm-gcc"
task.ldflags = "-L."
task.sources = "main.c"
end

0 comments on commit 7de0939

Please sign in to comment.