diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-11-05 14:35:00 +0700 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-11-05 16:26:08 +0700 |
commit | 63bf33ff90b1bf1e2278259648173bfebaac2e9c (patch) | |
tree | a5844e430999ddf4bc12c61da51a9afafb5ec843 /sim/Makefile.am | |
parent | cb9bdc02fdf1650341276861f6ca7e7a215a1ce6 (diff) | |
download | gdb-63bf33ff90b1bf1e2278259648173bfebaac2e9c.zip gdb-63bf33ff90b1bf1e2278259648173bfebaac2e9c.tar.gz gdb-63bf33ff90b1bf1e2278259648173bfebaac2e9c.tar.bz2 |
sim: build: move install steps to the top-level
We still have to maintain custom install rules due to how we rename
arch-specific files with an arch prefix in their name, but we can at
least unify the logic in the common dir.
Diffstat (limited to 'sim/Makefile.am')
-rw-r--r-- | sim/Makefile.am | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sim/Makefile.am b/sim/Makefile.am index 7ea013a..523d8f8 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -59,6 +59,10 @@ LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ ## Deps to add to the all-recursive target. These are built before descending ## into any subdirs. SIM_ALL_RECURSIVE_DEPS = +## Deps to add to the install-data-local target. +SIM_INSTALL_DATA_LOCAL_DEPS = +## Deps to add to the install-exec-local target. +SIM_INSTALL_EXEC_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. @@ -138,3 +142,26 @@ include v850/local.mk endif all-recursive: $(SIM_ALL_RECURSIVE_DEPS) + +install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS) + $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(libdir) + lib=`echo sim | sed '$(program_transform_name)'`; \ + for d in $(SUBDIRS); do \ + if [ -e $$d/run$(EXEEXT) ]; then \ + n="$$lib"; \ + [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ + n="lib$$n.a"; \ + $(INSTALL_DATA) $$d/libsim.a $(DESTDIR)$(libdir)/$$n || exit 1; \ + fi; \ + done + +install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS) + $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir) + run=`echo run | sed '$(program_transform_name)'`; \ + for d in $(SUBDIRS); do \ + if [ -e $$d/run$(EXEEXT) ]; then \ + n="$$run"; \ + [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ + $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \ + fi; \ + done |