GNU bug report logs - #9578
make uninstall fails after make install-data in empty prefix.

Previous Next

Package: automake;

Reported by: Nick Bowler <nbowler <at> elliptictech.com>

Date: Thu, 22 Sep 2011 18:47:01 UTC

Severity: normal

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nick Bowler <nbowler <at> elliptictech.com>
To: bug-automake <at> gnu.org
Subject: make uninstall fails after make install-data in empty prefix.
Date: Thu, 22 Sep 2011 14:42:59 -0400
Hello,

I noticed a problem testing the uninstall target of my
automake-generated Makefiles.  If the install prefix does not exist
before installation, automake will create the necessary directories.
But if you run a plain "make install-data" (without make install-exec),
the directories for executables are (unsurprisingly) not created.  The
problem is that "make uninstall" fails in this case:

  % ./configure --prefix=/tmp/does_not_exist
  % make install-data
  % make uninstall
   ( cd '/tmp/does_not_exist/bin' && rm -f foo )
  /bin/sh: line 6: cd: /tmp/does_not_exist/bin: No such file or directory
  make: *** [uninstall-binPROGRAMS] Error 1

and the installed data files are not deleted.  For reference, here's the
generated uninstall-binPROGRAMS target:

  uninstall-binPROGRAMS:
  	@$(NORMAL_UNINSTALL)
  	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
  	files=`for p in $$list; do echo "$$p"; done | \
  	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
  	      -e 's/$$/$(EXEEXT)/' `; \
  	test -n "$$list" || exit 0; \
  	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
  	cd "$(DESTDIR)$(bindir)" && rm -f $$files

Manually adding a - before the second command corrects the issue and the
data is successfully uninstalled.

A similar problem occurs with "make install-exec" followed by "make
uninstall", although this is somewhat less severe because GNU make will
successfully uninstall the executables before failing when it gets to
the data.  I'm using autoconf-2.68 and automake-1.11.1; the problem also
occurs with latest git automake at the time of writing.  The above was
reproduced with the following:

% cat >Makefile.am <<'EOF'
bin_PROGRAMS = foo
data_DATA = bar
EOF

% cat >configure.ac <<'EOF'
AC_INIT([test], [1.0])

AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC

AC_CONFIG_FILES([Makefile])
AC_OUTPUT
EOF

% cat >foo.c <<'EOF'
int main(void) { return 0; }
EOF

% cat >bar <<'EOF'
baz
EOF

Cheers,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)




This bug report was last modified 13 years and 298 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.