From 78095b0a2e3dce011a93031fee7ee8d2fcab92a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 23 Oct 2019 12:36:27 +0200 Subject: [PATCH] avoid spawning too many Nix shells MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Achieved by: - using := the 'git rev-parse' will be called after the shell is up - adding the SHELL setting to the _startdev-% target Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ccafc53335..3f53a510b8 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ HOST_OS := $(shell uname | tr '[:upper:]' '[:lower:]') # This can come from Jenkins ifndef BUILD_TAG -export BUILD_TAG = $(shell git rev-parse --short HEAD) +export BUILD_TAG := $(shell git rev-parse --short HEAD) endif # Defines which variables will be kept for Nix pure shell, use semicolon as divider @@ -322,6 +322,7 @@ _unknown-startdev-target-%: ${MAKE} _list | grep "watch-" | sed s/watch-/startdev-/; \ exit 1 +_startdev-%: SHELL := /bin/sh _startdev-%: $(eval SYSTEM := $(word 2, $(subst -, , $@))) $(eval DEVICE := $(word 3, $(subst -, , $@)))