複数ディレクトリにまたがるomake
こんな風にソースコードが複数ディレクトリに分かれている場合のomakeの書き方。
+-project_name/ | +-main.ml | +-OMakefile | +-OMakeroot | +-test/ | +-OMakefile | +-OMakeroot | +-test_main.ml
OMakefileの書き方
まず各ディレクトリにOMakefileを用意する。
project_name/OMakefileではサブディレクトリを指定する。それ以外の部分は通常通り。
.SUBDIRS: test
ビルド
すると、project_name/で
# cd test; omake suiteと等価 $ omake test/suite # PHONYターゲットの場合は、test/がいらない $ omake test-run
といった感じでビルドできる。
参考: Rules