Makefile: Save a variable during execution time -


i'm using makefiles "make" lot of things starting / stopping / configuring services i've written. i'd read input user. ways know either make user pass input name=value when executing make, or putting command read -p "setting x: " var ; echo $$var makefile.

name=value has disadvantage user must manually set , can't "ask" him enter value. read has disadvantage read value can not (or don't know how) saved in variable , can't used multiple times.

is there way read user input variable during executing specific makefile target? (i don't want put file ?= 'read -p "value: " var ; echo $$var' in header because value needed 1 target, , when put line in target itself, error "/bin/bash: file: command not found. ".

i use intermediate files purpose.

input = dialog --inputbox 80 10 10  all: case1 case2  case1: read-input     echo $(shell cat read-input) in case 1  case2: read-input     echo $(shell cat read-input) in case 2   .intermediate: read-input read-input:     $(input) 2>$@ 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -