Minor Makefile updates.
This commit is contained in:
+7
-4
@@ -125,9 +125,11 @@ maintainer-clean:
|
||||
override T = $(basename $(notdir $@))
|
||||
|
||||
# trim (strip) trailing whitespace
|
||||
RTRIM := sed -e 's/[ $(tab)]*$$//'
|
||||
# squeeze duplicate blank lines, remove empty first & last line
|
||||
SQUEEZE := cat --squeeze-blank | sed -e '1{/^$$/d}' -e '$${/^$$/d}'
|
||||
RTRIM := sed -e 's/[ $(tab)]*$$//'
|
||||
# squeeze duplicate blank lines, delete empty first & last line
|
||||
BLSQUEEZE := $(RTRIM) | cat --squeeze-blank | sed -e '1{/^$$/d}' -e '$${/^$$/d}'
|
||||
# delete blank lines
|
||||
BLDEL := $(RTRIM) | sed -e '/^$$/d'
|
||||
|
||||
# clear some vars, just in case
|
||||
LABEL_PREFIX =
|
||||
@@ -184,7 +186,7 @@ define tc.default.f-embed_objinfo
|
||||
$(call tc,objcopy) -R .text -R .data -R .bss $1
|
||||
$(call tc,objcopy) -R .comment -R .note -R .note.GNU-stack -R .reginfo $1
|
||||
$(call tc,objdump) -Dr $(tc_objdump_disasm_options) $1 | $(RTRIM) > $1.disasm
|
||||
$(call tc,objdump) -htr -w $1 | $(RTRIM) | $(SQUEEZE) > $1.dump
|
||||
$(call tc,objdump) -htr -w $1 | $(BLSQUEEZE) > $1.dump
|
||||
cat $1.dump >> $1
|
||||
endef
|
||||
define tc.default.f-objstrip
|
||||
@@ -714,6 +716,7 @@ $(STUBS): tmp/.tmp-stamp $(MAKEFILE_LIST)
|
||||
endif
|
||||
-include tmp/*.d
|
||||
|
||||
.DELETE_ON_ERROR: %.h %.o
|
||||
ifneq ($(strip $(STUBS)),)
|
||||
.DELETE_ON_ERROR: $(STUBS)
|
||||
endif
|
||||
|
||||
@@ -44,7 +44,8 @@ $c += -I$(top_srcdir)/src
|
||||
|
||||
lzma_d_c%.S : lzma_d_c.c
|
||||
$(call tc,gcc) $(PP_FLAGS) -S $< -o tmp/$T.s
|
||||
sed -e '1,/LzmaDecode:/c.arm' -e '/\.size/d' -e '/\.ident/d' -e 's/\.L/$(LABEL_PREFIX)/g' tmp/$T.s | $(RTRIM) > $@
|
||||
cat tmp/$T.s | $(BLDEL) | sed -e '1,/LzmaDecode:/c.arm' -e '/\.size/d' -e '/\.ident/d' -e 's/\.L/$(LABEL_PREFIX)/g' | $(BLDEL) > $@
|
||||
# the following stuff is for debugging only
|
||||
$(call tc,gcc) -c -MF /dev/null $@ -o tmp/$T.o
|
||||
$(call tc,f-objstrip,tmp/$T.o)
|
||||
$(call tc,objcopy) -O binary tmp/$T.o tmp/$T.bin
|
||||
|
||||
@@ -42,7 +42,8 @@ $c += -I$(top_srcdir)/src
|
||||
|
||||
lzma_d_c%.S : lzma_d_c.c
|
||||
$(call tc,gcc) $(PP_FLAGS) -S $< -o tmp/$T.s
|
||||
sed -e '1,/LzmaDecode:/c.thumb' -e '/\.size/d' -e '/\.ident/d' -e 's/\.L/$(LABEL_PREFIX)/g' tmp/$T.s | $(RTRIM) > $@
|
||||
cat tmp/$T.s | $(BLDEL) | sed -e '1,/LzmaDecode:/c.thumb' -e '/\.size/d' -e '/\.ident/d' -e 's/\.L/$(LABEL_PREFIX)/g' | $(BLDEL) > $@
|
||||
# the following stuff is for debugging only
|
||||
$(call tc,gcc) -c -MF /dev/null $@ -o tmp/$T.o
|
||||
$(call tc,f-objstrip,tmp/$T.o)
|
||||
$(call tc,objcopy) -O binary tmp/$T.o tmp/$T.bin
|
||||
|
||||
@@ -42,7 +42,7 @@ $c += -I$(top_srcdir)/src
|
||||
|
||||
lzma_d_c%.S : lzma_d_c.c
|
||||
$(call tc,gcc) $(PP_FLAGS) -S $< -o tmp/$T.s
|
||||
cat tmp/$T.s | $(RTRIM) | $(SQUEEZE) | sed -e '/^$$/d' -e '1,/LzmaDecode:/d' -e '/\.size/d' -e '/\.ident/d' -e '/\.section/d' -e 's/\.L/$(LABEL_PREFIX)/g' -e '/^[ \t]rts.*/d' -e 's/bsr\.l/bsr.w/' tmp/$T.s | $(RTRIM) > $@
|
||||
cat tmp/$T.s | $(BLDEL) | sed -e '1,/LzmaDecode:/d' -e '/\.size/d' -e '/\.ident/d' -e '/\.section/d' -e 's/\.L/$(LABEL_PREFIX)/g' -e '/^[ $(tab)]rts.*/d' -e 's/bsr\.l/bsr.w/' | $(BLDEL) > $@
|
||||
# the following stuff is for debugging only
|
||||
$(call tc,gcc) -c -MF /dev/null $@ -o tmp/$T.o
|
||||
$(call tc,f-objstrip,tmp/$T.o)
|
||||
|
||||
Reference in New Issue
Block a user