Question

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?

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top