public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Frysinger <vapier@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin/users/vapier/wip] libgloss: add some objcopy/objdump build rules
Date: Tue,  2 Jan 2024 04:35:39 +0000 (GMT)	[thread overview]
Message-ID: <20240102043539.BA9223858C2C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6a1b0abc3d243f2524b738b990a85728d54bdbe9

commit 6a1b0abc3d243f2524b738b990a85728d54bdbe9
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Fri Dec 29 01:51:27 2023 -0500

    libgloss: add some objcopy/objdump build rules
    
    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.

Diff:
---
 libgloss/Makefile.am | 10 ++++++++++
 libgloss/Makefile.in |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index 0d4460b58..aa1c430e3 100644
--- a/libgloss/Makefile.am
+++ b/libgloss/Makefile.am
@@ -31,6 +31,16 @@ 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 $< $@
+%.hex: %
+	$(AM_V_GEN)$(OBJCOPY) -O ihex $< $@
+%.srec: %
+	$(AM_V_GEN)$(OBJCOPY) -O srec $< $@
+
 ## These are roughly topologically sorted in order to make porting more
 ## streamlined.
 FLAGS_TO_PASS = \
diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in
index deeb31cbc..e6441a4c5 100644
--- a/libgloss/Makefile.in
+++ b/libgloss/Makefile.in
@@ -5335,6 +5335,15 @@ uninstall-am: uninstall-aarch64_cpu_initcpuinitDATA \
 .PRECIOUS: Makefile
 
 
+%.dis: %
+	$(AM_V_GEN)$(OBJDUMP) -d $< > $@
+%.bin: %
+	$(AM_V_GEN)$(OBJCOPY) -O binary $< $@
+%.hex: %
+	$(AM_V_GEN)$(OBJCOPY) -O ihex $< $@
+%.srec: %
+	$(AM_V_GEN)$(OBJCOPY) -O srec $< $@
+
 # GNU Make needs to see an explicit $(MAKE) variable in the command it
 # runs to enable its job server during parallel builds.  Hence the
 # comments below.

                 reply	other threads:[~2024-01-02  4:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240102043539.BA9223858C2C@sourceware.org \
    --to=vapier@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).