sim: bfin: fix up linux-fixed-code.h generation [PR sim/10143]
authorMike Frysinger <vapier@gentoo.org>
Mon, 9 Mar 2015 03:53:48 +0000 (23:53 -0400)
committerMike Frysinger <vapier@gentoo.org>
Mon, 9 Mar 2015 04:00:05 +0000 (00:00 -0400)
The use of $< ends up picking the wrong object out of the depend
list.  Specify the input name directly to avoid fragility.

On BSD systems, we need to make sure all options come before the
non-options (i.e. the files).

Reported-by: Chris Johns <chrisj@rtems.org>
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=13160

sim/bfin/ChangeLog
sim/bfin/Makefile.in

index a07be8697de4421a2c9938842d4139547684f6eb..9a115c272ce97a942d2031378b6644b99e9eba4b 100644 (file)
@@ -1,3 +1,10 @@
+2015-03-08  Mike Frysinger  <vapier@gentoo.org>
+
+       PR sim/10143
+       * Makefile.in ($(srcdir)/linux-fixed-code.h): Specify the asm input
+       directly rather than use $<.  Move the file name to the end of the
+       sed command to be POSIX compliant.
+
 2014-08-19  Alan Modra  <amodra@gmail.com>
 
        * configure: Regenerate.
index b6cfeb55eaa863d9a1c59ec4131c269e565416ad..a7f852d223b129e30b156413d247d42b3779177c 100644 (file)
@@ -50,15 +50,16 @@ SIM_EXTRA_LIBS = @SDL_LIBS@ -lm
 ## COMMON_POST_CONFIG_FRAG
 
 $(srcdir)/linux-fixed-code.h: @MAINTAINER_MODE_TRUE@ $(srcdir)/linux-fixed-code.s Makefile.in
-       $(AS_FOR_TARGET) $< -o linux-fixed-code.o
+       $(AS_FOR_TARGET) $(srcdir)/linux-fixed-code.s -o linux-fixed-code.o
        (       set -e; \
                echo "/* DO NOT EDIT: Autogenerated from linux-fixed-code.s.  */"; \
                echo "static const unsigned char bfin_linux_fixed_code[] ="; \
                echo "{"; \
                $(OBJDUMP_FOR_TARGET) -d -z linux-fixed-code.o > $@.dis; \
-               sed -n $@.dis \
+               sed -n \
                        -e 's:^[^       ]*      :0x:' \
-                       -e '/^0x/{s:    .*::;s: *$$:,:;s: :, 0x:g;p}'; \
+                       -e '/^0x/{s:    .*::;s: *$$:,:;s: :, 0x:g;p}' \
+                       $@.dis; \
                rm -f $@.dis; \
                echo "};" \
        ) > $@.tmp