1. first sample

updated at Sat Jan 10 10:13:58 JST 2009

1.1. prepare for first sample

Please prepare a directory and a source file for test.

> mkdir first_sample
> cd first_sample
> vim hello.c
(I love vim. But please use your favorite editor:-))
> cat hello.c
#include <stdio.h>

int
main (int argc, char *argv[])
{
  printf( "Hello, world!\n" );
  return 0;
 }

1.2. write Hakefile and run hake

Hakefile is haskell source code.

> vim Hakefile
> cat Hakefile

import Development.Hake
import Development.Hake.FunSet

main = hake [

 file [ "hello" ] [ "hello.c" ] $ const2 [ "cc -o hello hello.c" ]
                                  -- use 'const' for old version

 ]
> hake hello
cc -o hello hello.c
>./hello
Hello, world!