[2/3] sim: build: add uninstall support
Commit Message
This never worked before, but adding it to the common top-level dir
is pretty easy to do now that we're unified.
---
sim/Makefile.am | 8 +++++
sim/Makefile.in | 66 ++++++++++++++++++++++-----------------
sim/common/Make-common.in | 1 +
sim/erc32/local.mk | 4 +++
sim/ppc/Makefile.in | 1 +
5 files changed, 52 insertions(+), 28 deletions(-)
@@ -63,6 +63,8 @@ SIM_ALL_RECURSIVE_DEPS =
SIM_INSTALL_DATA_LOCAL_DEPS =
## Deps to add to the install-exec-local target.
SIM_INSTALL_EXEC_LOCAL_DEPS =
+## Deps to add to the uninstall-local target.
+SIM_UNINSTALL_LOCAL_DEPS =
# Generate target constants for newlib/libgloss from its source tree.
# This file is shipped with distributions so we build in the source dir.
@@ -165,3 +167,9 @@ install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS)
$(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \
fi; \
done
+
+uninstall-local: $(SIM_UNINSTALL_LOCAL_DEPS)
+ rm -f $(DESTDIR)$(bindir)/run $(DESTDIR)$(libdir)/libsim.a
+ for d in $(SUBDIRS); do \
+ rm -f $(DESTDIR)$(bindir)/run-$$d $(DESTDIR)$(libdir)/libsim-$$d.a; \
+ done
@@ -322,6 +322,7 @@ stamp-modules: Makefile $(SIM_OBJS:.o=.c)
install:
installdirs:
+uninstall:
check:
@@ -23,3 +23,7 @@ sim-%D-install-exec-local: installdirs
$(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
n=`echo sis | sed '$(program_transform_name)'`; \
$(INSTALL_PROGRAM) %D%/sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
+
+SIM_UNINSTALL_LOCAL_DEPS += sim-%D%-uninstall-local
+sim-%D%-uninstall-local:
+ rm -f $(DESTDIR)$(bindir)/sis
@@ -845,3 +845,4 @@ install-pdf:
install:
installdirs:
+uninstall: