...
To build OpenOCD you can use this script found in the https://github.com/renesas-rz/rzg_openocd repository.
$ wget https://raw.githubusercontent.com/renesas-rz/rzg_openocd/master/build_openocd.sh
$ wget https://raw.githubusercontent.com/renesas-rz/rzg_openocd/master/0001-tcl-target-renesas_rz_g2-Rename-to-renesas_rz-and-ad.patch
$ wget https://raw.githubusercontent.com/renesas-rz/rzg_openocd/master/0002-target-aarch64-MRS-MSR-support-for-system-register-a.patch
$ wget https://raw.githubusercontent.com/renesas-rz/rzg_openocd/master/0003-target-aarch64-enable-disable-mmu-new-commands.patch
$ wget https://raw.githubusercontent.com/renesas-rz/rzg_openocd/master/0004-target-aarch64-Add-code-to-invaldate-the-instruction.patch
$ wget https://raw.githubusercontent.com/renesas-rz/rzg_openocd/master/0005-tcl-target-renesas_rz-add-hwthread-and-coreid.patch
$ chmod +x ./build_openocd.sh
$ export GIT_SSL_NO_VERIFY=1 # Avoid GIT error: server certificate verification failed
$ ./build_openocd.sh
Or manually follow the steps in that script:
...