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?

Était-ce utile?

La 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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top