0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Makefile] shellコマンドの実行結果をmake変数として使う

Last updated at Posted at 2024-04-04

ちょっと詰まったのでメモ。

TL;DR

# 定義。:= は即時実行。 = は参照のたびに遅延実行。
make変数名 := $(shell 実行コマンド)

# 参照
$(make変数名)


ORIGINAL_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)

.PHONY: dev-deploy
dev-deploy:
	git checkout development
	git reset --hard $(ORIGINAL_BRANCH)
	git push -f
	git checkout $(ORIGINAL_BRANCH)
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?