public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: timur at freescale.com <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Add support for generating assembly listing files
Date: Thu, 11 Jan 2007 11:04:45 -0600	[thread overview]
Message-ID: <11685350856-git-send-email-timur@freescale.com> (raw)

From: Timur Tabi <timur@freescale.com>

This patch adds support for generating assembly listing files when building
U-Boot.  When "LISTING=1" is specified on the "make" command line, each 
compiled .c and .S file will generate a .lst file in the same location as
the corresponding .o file.  Assembly listing files contain the assembly
instructions and opcodes that the compiler generates.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 Makefile  |    2 +-
 README    |   15 +++++++++++++++
 config.mk |   20 +++++++++-----------
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index a973dff..1dbdf4d 100644
--- a/Makefile
+++ b/Makefile
@@ -2302,7 +2302,7 @@ atstk1002_config	:	unconfig
 clean:
 	find $(OBJTREE) -type f \
 		\( -name 'core' -o -name '*.bak' -o -name '*~' \
-		-o -name '*.o'  -o -name '*.a'  \) -print \
+		-o -name '*.o'  -o -name '*.a' -o -name '*.lst' \) -print \
 		| xargs rm -f
 	rm -f $(obj)examples/hello_world $(obj)examples/timer \
 	      $(obj)examples/eepro100_eeprom $(obj)examples/sched \
diff --git a/README b/README
index ecfd1f8..f6bef2d 100644
--- a/README
+++ b/README
@@ -2425,6 +2425,21 @@ this behavior and build U-Boot to some e
 Note that the command line "O=" setting overrides the BUILD_DIR environment
 variable.
 
+To generate an assembly listing file for each source file (.c and .S), add
+"LISTING=1" on the make command line when building your image:
+
+	make LISTING=1 all
+
+or
+
+	make O=/tmp/build LISTING=1 all
+
+A listing file contains the assembly instructions (with opcodes) that the 
+compiler generated when it compiled a source file.  Each listing file will be 
+located in the same place as the corresponding .o file, and it will have 
+a .lst extension.  Listing files are useful when you want to examine the
+compiler's output, which may not be what you expect.  They are also useful
+with hardware debuggers that do not support source code.
 
 Please be aware that the Makefiles assume you are using GNU make, so
 for instance on NetBSD you might need to use "gmake" instead of
diff --git a/config.mk b/config.mk
index 6e280bc..a3c88c7 100644
--- a/config.mk
+++ b/config.mk
@@ -224,22 +224,20 @@ export	TEXT_BASE PLATFORM_CPPFLAGS PLATF
 
 #########################################################################
 
-ifndef REMOTE_BUILD
-
-%.s:	%.S
-	$(CPP) $(AFLAGS) -o $@ $<
-%.o:	%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-%.o:	%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-else
-
 $(obj)%.s:	%.S
 	$(CPP) $(AFLAGS) -o $@ $<
+
 $(obj)%.o:	%.S
+ifdef LISTING
+	$(CC) $(AFLAGS) -Wa,-alds=$(@D)/$(*F).lst -c -o $@ $<
+else
 	$(CC) $(AFLAGS) -c -o $@ $<
+endif
+
 $(obj)%.o:	%.c
+ifdef LISTING
+	$(CC) $(CFLAGS) -Wa,-alds=$(@D)/$(*F).lst -c -o $@ $<
+else
 	$(CC) $(CFLAGS) -c -o $@ $<
 endif
 
-- 
1.4.4

                 reply	other threads:[~2007-01-11 17:04 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=11685350856-git-send-email-timur@freescale.com \
    --to=timur@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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