LoginSignup
7
2

More than 5 years have passed since last update.

Makefileには使用するshellを定義すると良さそう

Posted at

GNU Makeのお話です。
Makeを使用したことがある方を想定しているので、GNU Makeとは何かは書きません。

Makefileに使用するshellが定義できるの知らなかったよ

SHELL=/bin/bash

上記のように定義できます。bashを指定しました。

/bin/shを使う必要があるかという話

GNU Makeはデフォルトでは/bin/shが使用されます。

By default, /bin/sh is used for the shell

では、/bin/sh が問題がある場合はどのようなときでしょうか。
私の経験だと、/bin/sh が使用されたために、zshで成功してしていたsource ./conf.txtがエラーになりました。
ですので、どこの環境でも大体利用できる/bin/bashを指定しておくのが良いのではないかと。

参考

7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2