#2101 make uninstall ignores --program-suffix

open
nobody
5
2014-07-23
2012-10-19
George Oikonomou
No

I was trying to get two separate SDCC installations on the same box, each of a different revision.

What I tried to do was:
- Libraries, headers etc in /usr/local/share/sdcc-r<rev>
- User executables in /usr/local/bin/, each with a -r<rev> suffix, e.g. sdcc-r8160

This is on an Ubuntu box, with rev 8160 from svn and GNU Make 3.81

To get rid of the sdcc subdir within /usr/local/share/sdcc-r<rev>:
export include_dir_suffix="include"
export non_free_include_dir_suffix="non-free/include"
export lib_dir_suffix="lib"
export non_free_lib_dir_suffix="non-free/lib"

And then to configure:
./configure --program-suffix=-r8160 --datarootdir=/usr/local/share/sdcc-r8160

make
make install

This is what I found in /usr/local/bin

geo@ubox:~/sdcc$ l /usr/local/bin/*-r8160
-rwxr-xr-x 1 root root 6531 Oct 19 12:42 /usr/local/bin/as2gbmap-r8160
-rwxr-xr-x 1 root root 9676 Oct 19 12:42 /usr/local/bin/makebin-r8160
-rwxr-xr-x 1 root root 9664 Oct 19 12:42 /usr/local/bin/packihx-r8160
-rwxr-xr-x 1 root root 3198122 Oct 19 12:42 /usr/local/bin/sdar-r8160
-rwxr-xr-x 1 root root 68204 Oct 19 12:42 /usr/local/bin/sdas6808-r8160
-rwxr-xr-x 1 root root 71692 Oct 19 12:42 /usr/local/bin/sdas8051-r8160
-rwxr-xr-x 1 root root 65804 Oct 19 12:42 /usr/local/bin/sdasgb-r8160
-rwxr-xr-x 1 root root 75180 Oct 19 12:42 /usr/local/bin/sdasrab-r8160
-rwxr-xr-x 1 root root 74316 Oct 19 12:42 /usr/local/bin/sdasz80-r8160
-rwxr-xr-x 1 root root 14232 Oct 19 12:42 /usr/local/bin/sdcclib-r8160
-rwxr-xr-x 1 root root 2935044 Oct 19 12:42 /usr/local/bin/sdcc-r8160
-rwxr-xr-x 1 root root 186036 Oct 19 12:42 /usr/local/bin/sdcpp-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdld6808-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdldgb-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdld-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdldz80-r8160
-rwxr-xr-x 1 root root 3096013 Oct 19 12:42 /usr/local/bin/sdnm-r8160
-rwxr-xr-x 1 root root 3198117 Oct 19 12:42 /usr/local/bin/sdranlib-r8160

1. So far so good. However, notice how some executables e.g. s51, sz80 and shc08 didn't get a revision suffix. Intentional?

make uninstall (Part of the output below with a bunch of lines removed for clarity)

make[1]: Entering directory `/home/geo/sdcc/debugger/mcs51'
rm -f /usr/local/bin/sdcdb
rm -f /usr/local/bin/sdcdb.el
rm -f /usr/local/bin/sdcdbsrc.el
make[2]: Entering directory `/home/geo/sdcc/sim/ucsim'
rm -f /usr/local/bin/s51
rm -f /usr/local/bin/savr
rm -f /usr/local/bin/serialview
rm -f /usr/local/bin/portmon
make[2]: Entering directory `/home/geo/sdcc/sim/ucsim/s51.src'
rm -f /usr/local/bin/s51
make[2]: Entering directory `/home/geo/sdcc/sim/ucsim/avr.src'
rm -f /usr/local/bin/savr
make[2]: Entering directory `/home/geo/sdcc/sim/ucsim/z80.src'
rm -f /usr/local/bin/sz80
make[2]: Entering directory `/home/geo/sdcc/sim/ucsim/hc08.src'
rm -f /usr/local/bin/shc08
make[1]: Entering directory `/home/geo/sdcc/support/packihx'
rm -f /usr/local/bin/packihx
make[1]: Entering directory `/home/geo/sdcc/support/makebin'
rm -f /usr/local/bin/makebin
make[1]: Entering directory `/home/geo/sdcc/support/cpp'
rm -f /usr/local/bin/sdcpp
make[1]: Entering directory `/home/geo/sdcc/src'
rm -f /usr/local/bin/sdcc
make[1]: Entering directory `/home/geo/sdcc/sdas/as6808'
rm -f /usr/local/bin/sdas6808
make[1]: Entering directory `/home/geo/sdcc/sdas/as8051'
rm -f /usr/local/bin/sdas8051
make[1]: Entering directory `/home/geo/sdcc/sdas/asz80'
rm -f /usr/local/bin/sdasz80
make[1]: Entering directory `/home/geo/sdcc/sdas/asrab'
rm -f /usr/local/bin/sdasrab
make[1]: Entering directory `/home/geo/sdcc/sdas/asgb'
rm -f /usr/local/bin/sdasgb
make[1]: Entering directory `/home/geo/sdcc/support/librarian'
rm -f /usr/local/bin/sdcclib

2. uninstall does not remove its own user executables. Things get left behind.

geo@ubox:~/sdcc$ l /usr/local/bin/*-r8160
-rwxr-xr-x 1 root root 9676 Oct 19 12:42 /usr/local/bin/makebin-r8160
-rwxr-xr-x 1 root root 9664 Oct 19 12:42 /usr/local/bin/packihx-r8160
-rwxr-xr-x 1 root root 3198122 Oct 19 12:42 /usr/local/bin/sdar-r8160
-rwxr-xr-x 1 root root 68204 Oct 19 12:42 /usr/local/bin/sdas6808-r8160
-rwxr-xr-x 1 root root 71692 Oct 19 12:42 /usr/local/bin/sdas8051-r8160
-rwxr-xr-x 1 root root 65804 Oct 19 12:42 /usr/local/bin/sdasgb-r8160
-rwxr-xr-x 1 root root 75180 Oct 19 12:42 /usr/local/bin/sdasrab-r8160
-rwxr-xr-x 1 root root 74316 Oct 19 12:42 /usr/local/bin/sdasz80-r8160
-rwxr-xr-x 1 root root 14232 Oct 19 12:42 /usr/local/bin/sdcclib-r8160
-rwxr-xr-x 1 root root 2935044 Oct 19 12:42 /usr/local/bin/sdcc-r8160
-rwxr-xr-x 1 root root 186036 Oct 19 12:42 /usr/local/bin/sdcpp-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdld6808-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdldgb-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdld-r8160
-rwxr-xr-x 1 root root 199348 Oct 19 12:42 /usr/local/bin/sdldz80-r8160
-rwxr-xr-x 1 root root 3096013 Oct 19 12:42 /usr/local/bin/sdnm-r8160
-rwxr-xr-x 1 root root 3198117 Oct 19 12:42 /usr/local/bin/sdranlib-r8160

3. Leaving stuff behind can be a minor PITA if all our installations are suffixed. But more crucially, if we have a standard installation without a suffix, uninstall will mess it all up.

In Makefile.common:
EXEEXT =

I went and changed this to
EXEEXT = -r8160

and ran uninstall again

geo@ubox:~/sdcc$ l /usr/local/bin/*-r8160
-rwxr-xr-x 1 root root 3198122 Oct 19 12:42 /usr/local/bin/sdar-r8160
-rwxr-xr-x 1 root root 186036 Oct 19 12:42 /usr/local/bin/sdcpp-r8160
-rwxr-xr-x 1 root root 3096013 Oct 19 12:42 /usr/local/bin/sdnm-r8160
-rwxr-xr-x 1 root root 3198117 Oct 19 12:42 /usr/local/bin/sdranlib-r8160

A bit better but still some bits and bobs left behind.

Discussion