问题
For a project, which historically uses make I would now like to generate a pkg-config file. However I cannot seem to prevent the substitution of the variables
mylib.pc:
echo 'prefix='$(PREFIX) > bzip2.pc
echo "exec_prefix=\${prefix}" >> mylib.pc
echo 'libdir=\${prefix}/lib' >> mylib.pc
install: mylib.pc
Afterwards I have a mylib.pc
with expanded variables, which is not what I want.
So how does one generate a pkg-config out of a Makefile or how do I prevent variable substitution?
回答1:
This will produce what I think you want:
mylib.pc:
echo 'prefix='$(PREFIX)
echo 'exec_prefix=$${prefix}' >> mylib.pc
echo 'libdir=$${prefix}/lib' >> mylib.pc
来源:https://stackoverflow.com/questions/16241474/generate-pkg-config-out-of-makefile