1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Minor Makefile updates.

This commit is contained in:
Markus F.X.J. Oberhumer 2006-11-16 21:14:58 +01:00
parent c73da864c8
commit 6e5153cd07
5 changed files with 14 additions and 8 deletions

View File

@ -25,7 +25,7 @@ endif
# //
# ************************************************************************/
top_srcdir = ..
top_srcdir ?= ..
PACKAGE = upx
VERSION_DATE := $(shell sed -n 's/^.*UPX_VERSION_DATE_ISO .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
@ -81,4 +81,5 @@ mostlyclean clean distclean maintainer-clean:
###
$(BUILT_SOURCES): $(top_srcdir)/src/version.h $(MAKEFILE_LIST)
.DELETE_ON_ERROR: $(BUILT_SOURCES)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)