sim: build: add uninstall support
authorMike Frysinger <vapier@gentoo.org>
Sat, 5 Nov 2022 07:44:15 +0000 (14:44 +0700)
committerMike Frysinger <vapier@gentoo.org>
Sat, 5 Nov 2022 09:26:15 +0000 (16:26 +0700)
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
sim/Makefile.in
sim/common/Make-common.in
sim/erc32/local.mk
sim/ppc/Makefile.in

index 523d8f8dec96f82b60a1ef7eff2a43ea3905cf6b..4e4068a3539ff5f950dbdbff6132c2be5867fbc9 100644 (file)
@@ -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
index 7591aaa40b4a5373efe67b60c0c72a4e6141f32c..e9ba210c2bbdb655b2ecdc16ebeba63f2edf2d2d 100644 (file)
@@ -136,34 +136,35 @@ TESTS = testsuite/common/bits32m0$(EXEEXT) \
 @SIM_ENABLE_ARCH_d10v_TRUE@am__append_15 = d10v/gencode
 @SIM_ENABLE_ARCH_d10v_TRUE@am__append_16 = $(d10v_BUILD_OUTPUTS)
 @SIM_ENABLE_ARCH_erc32_TRUE@am__append_17 = sim-%D-install-exec-local
-@SIM_ENABLE_ARCH_frv_TRUE@am__append_18 = $(frv_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_erc32_TRUE@am__append_18 = sim-erc32-uninstall-local
 @SIM_ENABLE_ARCH_frv_TRUE@am__append_19 = $(frv_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_iq2000_TRUE@am__append_20 = $(iq2000_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_frv_TRUE@am__append_20 = $(frv_BUILD_OUTPUTS)
 @SIM_ENABLE_ARCH_iq2000_TRUE@am__append_21 = $(iq2000_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_lm32_TRUE@am__append_22 = $(lm32_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_iq2000_TRUE@am__append_22 = $(iq2000_BUILD_OUTPUTS)
 @SIM_ENABLE_ARCH_lm32_TRUE@am__append_23 = $(lm32_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_m32c_TRUE@am__append_24 = $(m32c_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_m32c_TRUE@am__append_25 = m32c/opc2c
-@SIM_ENABLE_ARCH_m32c_TRUE@am__append_26 = \
+@SIM_ENABLE_ARCH_lm32_TRUE@am__append_24 = $(lm32_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_25 = $(m32c_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_26 = m32c/opc2c
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_27 = \
 @SIM_ENABLE_ARCH_m32c_TRUE@    $(m32c_BUILD_OUTPUTS) \
 @SIM_ENABLE_ARCH_m32c_TRUE@    m32c/m32c.c.log \
 @SIM_ENABLE_ARCH_m32c_TRUE@    m32c/r8c.c.log
 
-@SIM_ENABLE_ARCH_m32r_TRUE@am__append_27 = $(m32r_BUILD_OUTPUTS)
 @SIM_ENABLE_ARCH_m32r_TRUE@am__append_28 = $(m32r_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_29 = $(m68hc11_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_30 = m68hc11/gencode
-@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_31 = $(m68hc11_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_32 = $(mn10300_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m32r_TRUE@am__append_29 = $(m32r_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_30 = $(m68hc11_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_31 = m68hc11/gencode
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_32 = $(m68hc11_BUILD_OUTPUTS)
 @SIM_ENABLE_ARCH_mn10300_TRUE@am__append_33 = $(mn10300_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_moxie_TRUE@am__append_34 = moxie/$(am__dirstamp)
-@SIM_ENABLE_ARCH_or1k_TRUE@am__append_35 = $(or1k_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_34 = $(mn10300_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_moxie_TRUE@am__append_35 = moxie/$(am__dirstamp)
 @SIM_ENABLE_ARCH_or1k_TRUE@am__append_36 = $(or1k_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_sh_TRUE@am__append_37 = $(sh_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_sh_TRUE@am__append_38 = sh/gencode
-@SIM_ENABLE_ARCH_sh_TRUE@am__append_39 = $(sh_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_v850_TRUE@am__append_40 = $(v850_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_or1k_TRUE@am__append_37 = $(or1k_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_38 = $(sh_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_39 = sh/gencode
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_40 = $(sh_BUILD_OUTPUTS)
 @SIM_ENABLE_ARCH_v850_TRUE@am__append_41 = $(v850_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_v850_TRUE@am__append_42 = $(v850_BUILD_OUTPUTS)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
@@ -922,13 +923,13 @@ CLEANFILES = common/version.c common/version.c-stamp \
        testsuite/common/bits-gen testsuite/common/bits32m0.c \
        testsuite/common/bits32m31.c testsuite/common/bits64m0.c \
        testsuite/common/bits64m63.c
-DISTCLEANFILES = $(am__append_34)
+DISTCLEANFILES = $(am__append_35)
 MOSTLYCLEANFILES = core $(am__append_5) site-sim-config.exp \
        testrun.log testrun.sum $(am__append_7) $(am__append_10) \
-       $(am__append_13) $(am__append_16) $(am__append_19) \
-       $(am__append_21) $(am__append_23) $(am__append_26) \
-       $(am__append_28) $(am__append_31) $(am__append_33) \
-       $(am__append_36) $(am__append_39) $(am__append_41)
+       $(am__append_13) $(am__append_16) $(am__append_20) \
+       $(am__append_22) $(am__append_24) $(am__append_27) \
+       $(am__append_29) $(am__append_32) $(am__append_34) \
+       $(am__append_37) $(am__append_40) $(am__append_42)
 AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
 AM_CPPFLAGS = $(INCGNU) -I$(srcroot)/include -I../bfd -I.. \
        $(SIM_HW_CFLAGS) $(SIM_INLINE) -I$(srcdir)/common \
@@ -939,12 +940,13 @@ COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUIL
 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
 SIM_ALL_RECURSIVE_DEPS = common/libcommon.a $(am__append_2) \
        $(am__append_6) $(am__append_8) $(am__append_12) \
-       $(am__append_14) $(am__append_18) $(am__append_20) \
-       $(am__append_22) $(am__append_24) $(am__append_27) \
-       $(am__append_29) $(am__append_32) $(am__append_35) \
-       $(am__append_37) $(am__append_40)
+       $(am__append_14) $(am__append_19) $(am__append_21) \
+       $(am__append_23) $(am__append_25) $(am__append_28) \
+       $(am__append_30) $(am__append_33) $(am__append_36) \
+       $(am__append_38) $(am__append_41)
 SIM_INSTALL_DATA_LOCAL_DEPS = 
 SIM_INSTALL_EXEC_LOCAL_DEPS = $(am__append_17)
+SIM_UNINSTALL_LOCAL_DEPS = $(am__append_18)
 common_libcommon_a_SOURCES = \
        common/callback.c \
        common/portability.c \
@@ -2268,7 +2270,7 @@ ps: ps-recursive
 ps-am:
 
 uninstall-am: uninstall-armdocDATA uninstall-dtbDATA \
-       uninstall-erc32docDATA uninstall-frvdocDATA \
+       uninstall-erc32docDATA uninstall-frvdocDATA uninstall-local \
        uninstall-or1kdocDATA uninstall-pkgincludeHEADERS \
        uninstall-ppcdocDATA uninstall-rxdocDATA
 
@@ -2294,7 +2296,7 @@ uninstall-am: uninstall-armdocDATA uninstall-dtbDATA \
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        recheck tags tags-am uninstall uninstall-am \
        uninstall-armdocDATA uninstall-dtbDATA uninstall-erc32docDATA \
-       uninstall-frvdocDATA uninstall-or1kdocDATA \
+       uninstall-frvdocDATA uninstall-local uninstall-or1kdocDATA \
        uninstall-pkgincludeHEADERS uninstall-ppcdocDATA \
        uninstall-rxdocDATA
 
@@ -2504,6 +2506,8 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen$(EXEEXT) testsuite/commo
 @SIM_ENABLE_ARCH_erc32_TRUE@   $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
 @SIM_ENABLE_ARCH_erc32_TRUE@   n=`echo sis | sed '$(program_transform_name)'`; \
 @SIM_ENABLE_ARCH_erc32_TRUE@   $(INSTALL_PROGRAM) erc32/sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
+@SIM_ENABLE_ARCH_erc32_TRUE@sim-erc32-uninstall-local:
+@SIM_ENABLE_ARCH_erc32_TRUE@   rm -f $(DESTDIR)$(bindir)/sis
 
 @SIM_ENABLE_ARCH_frv_TRUE@frv/mloop.c frv/eng.h: frv/stamp-mloop ; @true
 @SIM_ENABLE_ARCH_frv_TRUE@frv/stamp-mloop: $(srccom)/genmloop.sh frv/mloop.in
@@ -2749,6 +2753,12 @@ install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS)
                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
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index c424fe7054ba41a8ff8fb383718deb7c5468039c..2cdf357d8818304ed40961e8612b9055d8d80a38 100644 (file)
@@ -307,6 +307,7 @@ stamp-modules: Makefile $(SIM_OBJS:.o=.c)
 
 install:
 installdirs:
+uninstall:
 
 check:
 
index 3b858a671d801530b34a83a906fa362a0e7d3bdb..36baeb96614c2fe2605bb46b12f23181c1ee1905 100644 (file)
@@ -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
index 4fe4fd9597c0ac22b440c8cfdc8c742cf092d5f6..d7b9df0819f4259ec75e0f2c30ada2ff5a516cea 100644 (file)
@@ -845,3 +845,4 @@ install-pdf:
 
 install:
 installdirs:
+uninstall: