commit 9711d37395d68c8db326c3460c9b5001210fc6ac
parent 06db3b4bdc78ffcd62b72f4906c6f7a6be4920d7
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date: Wed, 21 Nov 2018 13:54:47 +0000
Merge "[arch/rmode] Simplify the Makefile"
Diffstat:
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/arch/rmode/Makefile b/arch/rmode/Makefile
@@ -23,6 +23,10 @@ RAMOBJS = ram-crt.o \
TARGET = $(BINDIR)/romfw.bin $(BINDIR)/ramfw.bin
+.SUFFIXES: .tst
+.elf.tst:
+ ./mktst $<
+
all: $(TARGET)
ram-crt.o rom-crt.o: crt.s
@@ -42,27 +46,10 @@ $(BINDIR)/romfw.elf: $(ROMOBJS) $(LIBDEP)
$(BINDIR)/ramfw.elf: $(RAMOBJS) $(LIBDEP)
$(LD) $(RCODE_LDFLAGS) $(RAMOBJS) $(LIBS) -o $@
+$(BINDIR)/ramfw.bin: $(BINDIR)/ramfw.tst
+$(BINDIR)/romfw.bin: $(BINDIR)/romfw.tst
+
clean:
rm -f $(TARGET:.bin=.elf)
rm -f $(TARGET:.bin=.tst)
rm -f sysreg.h sysreg.s
-
-#
-# Rules to verify that the binary images doesn't have data or bss
-#
-.SUFFIXES: .tst
-
-$(BINDIR)/ramfw.bin: $(BINDIR)/ramfw.tst
-$(BINDIR)/romfw.bin: $(BINDIR)/romfw.tst
-
-.elf.tst:
- @test $(SYS) != "rcode" && exit; \
- size $< | \
- awk 'NR == 2 {\
- if ($$2 != 0 || $$3 != 0) {\
- printf("image %s with data section!\n",\
- "$<") > "/dev/stderr";\
- exit 1;\
- }\
- }'
- touch $@
diff --git a/arch/rmode/mktst b/arch/rmode/mktst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+size ${1?'First parameter unset'} |
+awk 'NR == 2 {
+ if ($2 != 0 || $3 != 0) {
+ printf("image %s with data section!\n",
+ "'$1'") > "/dev/stderr";
+ exit 1;\
+ }\
+}'
+touch ${1%.elf}.tst