Generate pkg-config out of Makefile

不打扰是莪最后的温柔 提交于 2021-01-28 19:25:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!