LoginSignup
2
0

Makefile - make コマンドに環境変数を利用し、値がない場合には初期値を代入する

Posted at

Makefileの例

?= で環境変数に値がない場合に代入できるようだ

SOME_ENV ?= foo

echo:
	@echo $(SOME_ENV)

実行例

$ make echo
foo
$ SOME_ENV=bar make echo
bar

参考

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

プロフィール・経歴

2
0
1

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
2
0