[MPLAB X IDE]「make[2]: *** No rule to make target …」の解決方法

次のようなPICアセンブリコードのコンパイルエラーの解決方法です。

"C:¥Program Files (x86)¥Microchip¥xc8¥v1.38¥bin¥xc8.exe" --pass1 …
make[2]: *** No rule to make target 'build/default/production/xyz.obj', needed by 'dist/default/production/lcd.X.production.hex'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory 'C:/Users/sTea/Documents/MPLABXProjects/lcd.X'
nbproject/Makefile-default.mk:84: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/sTea/Documents/MPLABXProjects/lcd.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 3s)

それは、、、

ファイル拡張子を”.s”から”.asm”に変える、です。

どうも、”.s”はxc16とxc32用で、xc8では”.asm”を使うようです。

手順は、

  1. [Projects]ウィンドウから”xyz.s”を右クリックメニュー[Remove From Project]で削除。
  2. [Files]ウィンドウで”xyz.s”から右メニュー[Properties]を開き、[Extension]を”s”から”asm”に変更。
  3. [Projects]ウィンドウに戻り、[Source Files]を右クリックし、[Add Existing Item…]から”xyz.asm”を選択。
  4. 念のため[Clean And Build Main Project]を実行。

原因は[Source Files]の右メニュー[New][pic_8b_func.asm…]で開くNew File Wizardの初期値が”.s”に成っていることであろう。
New Wizard の初期値

デフォルトとして設定できるようなので設定して置くべきか?(xc16とxc32でも”.asm”が使えるなら)
New Wizard の推奨設定

eid=950642

投稿者: うつる? 猫目

猫の目はタマゴ!下界は何と映るか?