はじめに
MakefileをVSCodeで編集した後に、makeコマンドを実行すると以下のエラーが出ました。
Makefile:6: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
VSCode上でTab文字がスペースに置き換わっていることが原因です。
解決方法
- Windows:
Ctrl + Shif + P
,(Maccommand + shit + P
)でコマンドパレットを開きます -
Preferences: Open Settings(JSON)
を選択します
- settings.jsonを以下のように編集します
{
"[makefile]": {
"editor.insertSpaces": false,
"editor.detectIndentation": false
},
}
参考記事