Answer the question
In order to leave comments, you need to log in
[SOLVED] Makefile + read variable value from console + dch - how to do it?
Due to established traditions, we actively use make-files at work. And for the normal assembly of DEB packages, and to simplify frequently used operations. And if everything is fine with simple recipes:
build: ##@build Build project to DEB Package
@echo Building project to DEB-package
export COMPOSER_HOME=/tmp/ && dpkg-buildpackage -rfakeroot --no-sign
dchv: ##@development Append release
export DEBEMAIL="[email protected]" && \
export DEBFULLNAME="Arris" && \
export VERSION=$(shell read -p "Version: ";echo $$REPLY) && \
dch -v $(VERSION)
Answer the question
In order to leave comments, you need to log in
dch -v $$VERSION
should work.
because
export VERSION=$(shell read -p "Version: ";echo $$REPLY)
exports a variable inside the shell, but $(VERSION)
refers to a make variable rather than a shell variable.Alternatively, `make dchv 1.3.4` will do, but teaching makefile how to do this is a pain in the ass :(
make dchv VERSION=1.3.4
and throw out the code for entering the VERSION variable from the dchv rule, i.e. leave onlydch -v $(VERSION)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question