トラブル:rake build が動かない

rake git:update して rake build すると、なんかエラーになってビルドできない。

$ cd rubinius.code
$ rake git:update
$ rake build
(in /var/tmp/rubinius.code)
make vm
cd shotgun; make rubinius
cd lib; make library; 
Makefile:59: Extraneous text after `else' directive
Makefile:61: *** only one `else' per conditional.  Stop.
make[1]: *** [lib/librubinius-0.8.0.dylib] Error 2
make: *** [vm] Error 2
rake aborted!
Command failed with status (2): [make vm...]
/var/tmp/rubinius.code.bkup/rakefile:97
(See full trace by running task with --trace)


どうも shotgun/lib/Makefile の 59 行目が原因みたいなんだが。

  ....
57: ifdef PROF
58:         OPTIMIZATIONS=-O2
59: else ifdef DEV
60:   OPTIMIZATIONS=
61: else
  ....


エラーメッセージは「only one `else' per conditional」だから、57 行目の ifdef に対して 59 行目と 61 行目で else が 2 つあるのが原因なんだろう。

よくわからんが、Ruby でいうところの elsif が GNU Make にはないみたいだから、ブサイクだけど if 文を入れ子にして書いてみる。

  ....
ifdef PROF
        OPTIMIZATIONS=-O2
else
ifdef DEV
  OPTIMIZATIONS=
else
  ....
endif
endif


これでエラーが直った。とりあえず ticket #318 で登録。

しかしこんな syntax error が入るなんて、Rubinius 大丈夫だろうか。