Autoconf uninstall target incompletely undoing installation
Warren Young <[email protected]> Fri, 22 Aug 2008 13:38:58 -0600
| Newsgroups | gmane.comp.sysutils.bakefile.devel |
|---|---|
| Message-ID | <[email protected]> |
If we have this Bakefile fragment:
<set var="HEADER_DIR">$(PREFIX)/include/some_subdir</set>
<data-files>
<files>lib/*.h</files>
<install-to>$(HEADER_DIR)</install-to>
</data-files>
You get something like this for autoconf output:
install: all install_someproject
$(INSTALL_DIR) $(DESTDIR)$(prefix)/include/some_subdir
(cd $(srcdir) ; $(INSTALL_DATA) lib/*.h \
$(DESTDIR)$(prefix)/include/some_subdir
uninstall: uninstall_someproject
(cd $(DESTDIR)$(prefix)/include/some_subdir ; rm -f *.h)
Notice that it doesn't remove the directory it created.
I tried this to fix it:
<modify-target target="uninstall">
<command>rmdir $(HEADER_DIR)</command>
</modify-target>
but that gets inserted before the Bakefile-generated commands, which
means it can't work because the header files are still there. And, I
can't just rm -r $(HEADER_DIR), because that makes Bakefile's cd-and-rm
command fail.
Obviously one fix is to make uninstall symmetric with regard to install.
Another, which would make Bakefile more flexible, is to add an
attribute (when="after"?) to <modify-target> that would override the
default of inserting the custom commands before the Bakefile ones.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/