まず、基本。DOSプロンプトからbashを起動してその中でmakeを動かす。
> x:/path/to/cygwin/bin/bash.exe -c make
make用に環境変数を設定してからmakeする。
> x:/path/to/cygwin/bin/bash.exe
-c "export HOGE=/path/to/hoge; make"
(gccの) errorやwarning があるファイル名がCygwin path(/cygdrive/x/...) で出てくるのでvimのerrorformatにWindowsのpathで拾ってもらうために変換しておく
> x:/path/to/cygwin/bin/bash.exe
-c "export HOGE=/path/to/hoge; make 2>&1 |
sed -e 's#^/cygdrive/\([a-z]\)#\1:#'"
ファイル名じゃないのファイル名として解釈されてしまう部分を除外する
> x:/path/to/cygwin/bin/bash.exe
-c "export HOGE=/path/to/hoge; make 2>&1 |
sed -e 's#^/cygdrive/\([a-z]\)#\1:#' |
grep -v '^<hogehoge>'"
makeprgの書式に則って適切にエスケープさせる. ついでにmakeへの引数($*)も追加
:se makeprg=x:/path/to/cygwin/bin/bash.exe
\ -c\ \"export\ HOGE=/path/to/hoge;make\ $*\ 2>&1\ \\\|
\ sed\ -e's\\#^/cygdrive/\\([a-z]\\)\\#\\1:\\#'\ \\\|
\ grep\ -v\ '^<command\ line>'\"
詳しくは :he make_makeprg で




