libgloss: add some objcopy/objdump build rules

Message ID 20231230015610.23359-1-vapier@gentoo.org
State New
Headers
Series libgloss: add some objcopy/objdump build rules |

Commit Message

Mike Frysinger Dec. 30, 2023, 1:56 a.m. UTC
  A bunch of ports have manual rules to generate disassembly, srec, and
binary files from test programs.  Add top-level pattern rules so every
test program gets this for free, and we don't have to duplicate it in
every subdir.
---
 libgloss/Makefile.am | 8 ++++++++
 libgloss/Makefile.in | 7 +++++++
 2 files changed, 15 insertions(+)
  

Patch

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index 0d4460b5801e..f74f515adba2 100644
--- a/libgloss/Makefile.am
+++ b/libgloss/Makefile.am
@@ -31,6 +31,14 @@  AM_CPPFLAGS = -idirafter $(srcroot)/include
 noinst_LIBRARIES = libobjs.a
 libobjs_a_SOURCES =
 
+## Some convenience rules for debugging programs.
+%.dis: %
+	$(AM_V_GEN)$(OBJDUMP) -d $< > $@
+%.bin: %
+	$(AM_V_GEN)$(OBJCOPY) -O binary $< $@
+%.srec: %
+	$(AM_V_GEN)$(OBJCOPY) -O srec $< $@
+
 ## These are roughly topologically sorted in order to make porting more
 ## streamlined.
 FLAGS_TO_PASS = \