Automatic makefile dependencies for generated ld/e*.c
authorAlan Modra <amodra@gmail.com>
Fri, 12 Apr 2019 11:02:57 +0000 (20:32 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 13 Apr 2019 02:43:22 +0000 (12:13 +0930)
commitc40e31a1217f6ec9dd47e2e6806c2562096e31fe
tree1d05c38dd02cfbeca8f7706a112067e3cba052ab
parent50ff67e6cf65dbe1b8fbbdb7a6c2e43919af95f4
makefile dependencies for generated ld/e*.c

This patch modifies genscripts.sh to emit dependency info along with
the generated emulation e*.c files.  This is done by a new source_sh
function that records its arg to a file (.deps/e*.Tc), using the
function whenever a shell script is sourced.  Entries in the file are
made unique and written to .deps/e*.Pc.  These files are then
included by the Makefile.

* Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter.  Add
DEPDIR parameter.
(ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete.
(ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on
$GEN_DEPENDS.
(e*.c): Delete all dependencies, instead include dependencies
from $DEPDIR/*.Pc.
* Makefile.in: Regenerate.
* configure.ac (source_sh): Define and use function.
* configure: Regenerate.
* emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh,
* emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh,
* emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh,
* emulparams/arcelf.sh, * emulparams/arcelf_prof.sh,
* emulparams/arclinux.sh, * emulparams/arclinux_nps.sh,
* emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh,
* emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh,
* emulparams/armelf_linux_eabi.sh,
* emulparams/armelf_linux_fdpiceabi.sh,
* emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh,
* emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh,
* emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh,
* emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh,
* emulparams/armelfb_linux_fdpiceabi.sh,
* emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh,
* emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh,
* emulparams/elf32_sparc_sol2.sh,
* emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh,
* emulparams/elf32_tic6x_elf_be.sh,
* emulparams/elf32_tic6x_elf_le.sh,
* emulparams/elf32_tic6x_linux_be.sh,
* emulparams/elf32_tic6x_linux_le.sh,
* emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh,
* emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh,
* emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh,
* emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh,
* emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh,
* emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh,
* emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh,
* emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh,
* emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh,
* emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh,
* emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh,
* emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh,
* emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh,
* emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh,
* emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh,
* emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh,
* emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh,
* emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh,
* emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh,
* emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh,
* emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh,
* emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh,
* emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh,
* emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh,
* emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh,
* emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh,
* emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh,
* emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh,
* emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh,
* emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh,
* emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh,
* emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh,
* emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh,
* emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh,
* emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh,
* emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh,
* emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh,
* emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh,
* emulparams/elf_x86_64_cloudabi.sh,
* emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh,
* emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh,
* emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh,
* emulparams/h8300self.sh, * emulparams/h8300self_linux.sh,
* emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh,
* emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh,
* emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh,
* emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh,
* emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh,
* emulparams/msp430X.sh, * emulparams/nds32belf.sh,
* emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh,
* emulparams/pjlelf.sh, * emulparams/ppclynx.sh,
* emulparams/score7_elf.sh, * emulparams/shelf_fd.sh,
* emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh,
* emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh,
* emulparams/shl.sh, * emulparams/shlelf.sh,
* emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh,
* emulparams/shlelf_vxworks.sh: Use source_sh.
* genscripts.sh: Adjust for changed parameters.  Emit dependencies
for e*.c to .deps/*.Pc.
(source_sh): New function, use it throughout to source scripts.
* genscrba.sh (source_em): Use source_sh.
155 files changed:
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/configure
ld/configure.ac
ld/emulparams/aarch64cloudabib.sh
ld/emulparams/aarch64elf32b.sh
ld/emulparams/aarch64elfb.sh
ld/emulparams/aarch64fbsdb.sh
ld/emulparams/aarch64linux32b.sh
ld/emulparams/aarch64linuxb.sh
ld/emulparams/arcelf.sh
ld/emulparams/arcelf_prof.sh
ld/emulparams/arclinux.sh
ld/emulparams/arclinux_nps.sh
ld/emulparams/arclinux_prof.sh
ld/emulparams/arcv2elf.sh
ld/emulparams/arcv2elfx.sh
ld/emulparams/armelf_fbsd.sh
ld/emulparams/armelf_linux_eabi.sh
ld/emulparams/armelf_linux_fdpiceabi.sh
ld/emulparams/armelf_nacl.sh
ld/emulparams/armelf_nbsd.sh
ld/emulparams/armelf_vxworks.sh
ld/emulparams/armelfb.sh
ld/emulparams/armelfb_fbsd.sh
ld/emulparams/armelfb_fuchsia.sh
ld/emulparams/armelfb_linux.sh
ld/emulparams/armelfb_linux_eabi.sh
ld/emulparams/armelfb_linux_fdpiceabi.sh
ld/emulparams/armelfb_nacl.sh
ld/emulparams/armelfb_nbsd.sh
ld/emulparams/armsymbian.sh
ld/emulparams/cskyelf_linux.sh
ld/emulparams/elf32_sparc_sol2.sh
ld/emulparams/elf32_sparc_vxworks.sh
ld/emulparams/elf32_tic6x_be.sh
ld/emulparams/elf32_tic6x_elf_be.sh
ld/emulparams/elf32_tic6x_elf_le.sh
ld/emulparams/elf32_tic6x_linux_be.sh
ld/emulparams/elf32_tic6x_linux_le.sh
ld/emulparams/elf32_x86_64.sh
ld/emulparams/elf32_x86_64_nacl.sh
ld/emulparams/elf32b4300.sh
ld/emulparams/elf32bfinfd.sh
ld/emulparams/elf32bmipn32.sh
ld/emulparams/elf32bsmip.sh
ld/emulparams/elf32btsmip.sh
ld/emulparams/elf32btsmip_fbsd.sh
ld/emulparams/elf32btsmipn32.sh
ld/emulparams/elf32btsmipn32_fbsd.sh
ld/emulparams/elf32ebmip.sh
ld/emulparams/elf32ebmipvxworks.sh
ld/emulparams/elf32elmip.sh
ld/emulparams/elf32elmipvxworks.sh
ld/emulparams/elf32frvfd.sh
ld/emulparams/elf32l4300.sh
ld/emulparams/elf32lm32fd.sh
ld/emulparams/elf32lmip.sh
ld/emulparams/elf32lppc.sh
ld/emulparams/elf32lppclinux.sh
ld/emulparams/elf32lppcnto.sh
ld/emulparams/elf32lppcsim.sh
ld/emulparams/elf32lr5900.sh
ld/emulparams/elf32lr5900n32.sh
ld/emulparams/elf32lriscv.sh
ld/emulparams/elf32lriscv_ilp32.sh
ld/emulparams/elf32lriscv_ilp32f.sh
ld/emulparams/elf32lsmip.sh
ld/emulparams/elf32ltsmip.sh
ld/emulparams/elf32ltsmip_fbsd.sh
ld/emulparams/elf32ltsmipn32.sh
ld/emulparams/elf32ltsmipn32_fbsd.sh
ld/emulparams/elf32microblazeel.sh
ld/emulparams/elf32or1k_linux.sh
ld/emulparams/elf32ppc.sh
ld/emulparams/elf32ppc_fbsd.sh
ld/emulparams/elf32ppccommon.sh
ld/emulparams/elf32ppclinux.sh
ld/emulparams/elf32ppcnto.sh
ld/emulparams/elf32ppcsim.sh
ld/emulparams/elf32ppcvxworks.sh
ld/emulparams/elf32ppcwindiss.sh
ld/emulparams/elf32tilegx_be.sh
ld/emulparams/elf64_ia64_fbsd.sh
ld/emulparams/elf64_sparc_fbsd.sh
ld/emulparams/elf64_sparc_sol2.sh
ld/emulparams/elf64alpha_fbsd.sh
ld/emulparams/elf64alpha_nbsd.sh
ld/emulparams/elf64bmip-defs.sh
ld/emulparams/elf64bmip.sh
ld/emulparams/elf64btsmip.sh
ld/emulparams/elf64btsmip_fbsd.sh
ld/emulparams/elf64lppc.sh
ld/emulparams/elf64lriscv-defs.sh
ld/emulparams/elf64lriscv.sh
ld/emulparams/elf64lriscv_lp64.sh
ld/emulparams/elf64lriscv_lp64f.sh
ld/emulparams/elf64ltsmip.sh
ld/emulparams/elf64ltsmip_fbsd.sh
ld/emulparams/elf64ppc.sh
ld/emulparams/elf64ppc_fbsd.sh
ld/emulparams/elf64rdos.sh
ld/emulparams/elf64tilegx_be.sh
ld/emulparams/elf_i386.sh
ld/emulparams/elf_i386_be.sh
ld/emulparams/elf_i386_fbsd.sh
ld/emulparams/elf_i386_ldso.sh
ld/emulparams/elf_i386_nacl.sh
ld/emulparams/elf_i386_sol2.sh
ld/emulparams/elf_i386_vxworks.sh
ld/emulparams/elf_iamcu.sh
ld/emulparams/elf_k1om.sh
ld/emulparams/elf_k1om_fbsd.sh
ld/emulparams/elf_l1om.sh
ld/emulparams/elf_l1om_fbsd.sh
ld/emulparams/elf_x86_64.sh
ld/emulparams/elf_x86_64_cloudabi.sh
ld/emulparams/elf_x86_64_fbsd.sh
ld/emulparams/elf_x86_64_nacl.sh
ld/emulparams/elf_x86_64_sol2.sh
ld/emulparams/h8300helf.sh
ld/emulparams/h8300helf_linux.sh
ld/emulparams/h8300hnelf.sh
ld/emulparams/h8300self.sh
ld/emulparams/h8300self_linux.sh
ld/emulparams/h8300snelf.sh
ld/emulparams/h8300sxelf.sh
ld/emulparams/h8300sxelf_linux.sh
ld/emulparams/h8300sxnelf.sh
ld/emulparams/hppanbsd.sh
ld/emulparams/hppaobsd.sh
ld/emulparams/m32rlelf.sh
ld/emulparams/m32rlelf_linux.sh
ld/emulparams/m68kelfnbsd.sh
ld/emulparams/mn10300.sh
ld/emulparams/msp430X.sh
ld/emulparams/nds32belf.sh
ld/emulparams/nds32belf16m.sh
ld/emulparams/nds32belf_linux.sh
ld/emulparams/pjlelf.sh
ld/emulparams/ppclynx.sh
ld/emulparams/score7_elf.sh
ld/emulparams/shelf_fd.sh
ld/emulparams/shelf_linux.sh
ld/emulparams/shelf_nbsd.sh
ld/emulparams/shelf_uclinux.sh
ld/emulparams/shelf_vxworks.sh
ld/emulparams/shl.sh
ld/emulparams/shlelf.sh
ld/emulparams/shlelf_fd.sh
ld/emulparams/shlelf_nbsd.sh
ld/emulparams/shlelf_vxworks.sh
ld/genscrba.sh
ld/genscripts.sh