What's the opposite of 'make install', i.e. how do you uninstall a library in Linux?

后端 未结 12 615
旧巷少年郎
旧巷少年郎 2020-11-28 17:08

While running

./configure --prefix=/mingw 

on a MinGW/MSYS system for a library I had previously run

\'./configure --pref         


        
12条回答
  •  鱼传尺愫
    2020-11-28 17:34

    Make can tell you what it knows and what it will do. Suppose you have an "install" target, which executes commands like:

    cp  /
    

    In your generic rules, add:

    uninstall :; MAKEFLAGS= ${MAKE} -j1 -spinf $(word 1,${MAKEFILE_LIST}) install \
                  | awk '/^cp /{dest=$NF; for (i=NF; --i>0;) {print dest"/"$i}}' \
                  | xargs rm -f
    

    A similar trick can do a generic make clean.

提交回复
热议问题