Skip to content

Commit

Permalink
build: add an "uninstall" target
Browse files Browse the repository at this point in the history
Use the cmake-generated install_manifest.txt to implement an uninstall
target that removes files installed by cmake.

Signed-off-by: David Aguilar <[email protected]>
  • Loading branch information
davvid committed Jun 19, 2018
1 parent 18c069b commit 7de57d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ default:: test

test:: all

clean:: uninstall

configure = $(build)/cmake.conf
$(configure):
$(QUIET)mkdir -p $(build)
Expand All @@ -63,3 +65,11 @@ cmake:
all clean doc install test:: $(configure)
+$(QUIET)cmake --build $(build) --target $@ $(FLAGS)

install::
$(QUIET)cp $(build)/install_manifest.txt $(build).manifest.txt

uninstall: $(configure)
$(QUIET)touch $(build).manifest.txt
$(QUIET)xargs rm -f <$(build).manifest.txt
$(QUIET)xargs dirname <$(build).manifest.txt 2>/dev/null | \
sort -u -r | xargs rmdir -p >/dev/null 2>&1 || true

0 comments on commit 7de57d3

Please sign in to comment.