Skip to content

Instantly share code, notes, and snippets.

@ryosuke-endo
Last active November 24, 2015 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryosuke-endo/0b0eb1573ca71c885fc7 to your computer and use it in GitHub Desktop.
Save ryosuke-endo/0b0eb1573ca71c885fc7 to your computer and use it in GitHub Desktop.
forcing make hello
#include <stdio.h>
int main(int argc, char *args[])
{
printf("Hello, world!\n");
return 0;
}
require 'rake/clean'
CLOBBER.include('hello')
SRC_DISTDIR = './helloworld'
directory SRC_DISTDIR
CC = 'gcc'
str = <<EOS
#{CC} -o hello hello.c
./hello
EOS
desc 'compile C langueage'
task 'default' => 'hello'
task 'hello' => 'hello.c' do
sh str
end
desc 'Create hello world in your directory'
task 'make_hello_package' => [SRC_DISTDIR, 'hello.c'] do
cp ['hello.c'], SRC_DISTDIR
cd SRC_DISTDIR
sh str
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment