Add uninstall target to Makefile#327
Conversation
`make uninstall` can be used to uninstall the libraries, utf8proc header, and pkg-config file.
|
Thanks! It would be good to add a test for this — i.e. do a |
|
Sure, let me know if something like this is what you had in mind, if so I'll add it to the tests dir and to #!/usr/bin/env bash
install_dir=$(mktemp -d)
if ! make install DESTDIR="$install_dir" ||
[ ! -f "$install_dir/usr/local/include/utf8proc.h" ] ||
[ ! -f "$install_dir/usr/local/lib/libutf8proc.a" ] ||
[ ! -f "$install_dir/usr/local/lib/pkgconfig/libutf8proc.pc" ]; then
echo "FAILED: make install" >&2
rm -rf "$install_dir"
exit 1
fi
if ! make uninstall DESTDIR="$install_dir" ||
[ -n "$(find "$install_dir/usr/local/include" -type f )" ]; then
echo "FAILED: make uninstall" >&2
rm -rf "$install_dir"
exit 1
fi |
|
Overall that looks good. For the I would also probably just rely on |
|
A minor issue with using the manifest as-is is that it doesn't take into account platform differences in the shared library name, so This seems like a reasonable solution to me so I'll push a new commit with these changes, but let me know if you know of a better way to do this. |
Adds a script which validates the install and ensures that uninstall removes all installed files based on the generated manifest file. This is called as part of `make check`. On macOS, generating the manifest requires use of GNU find, so this is now set conditionally in the Makefile.
|
The branch has been updated with the above changes. |
This was based on the contents of the generated MANIFEST, but this is generated by running `make install` itself, so this test was circuitous.
|
@stevengj let me know if there's anything else to do here. |
Hi, thanks for the awesome library.
This adds a
make uninstalltarget that can be used to uninstall the libraries, utf8proc header, and pkg-config file.An uninstall target would be useful for hfsfuse which bundles utf8proc as a subtree and offers the ability to uninstall bundled libraries in its own Makefile.