From 2007fe5f498f8a58ceb3e241f58fb03708986608 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 29 Aug 2006 23:08:26 +0200 Subject: [PATCH] More small Makefile changes. --- Makefile | 4 +++- doc/Makefile | 19 +++++++++++++++++-- src/stub/Makefile | 15 +++++++++++---- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 30360212..76fa0f47 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -# Toplevel Makefile for UPX +# +# UPX toplevel Makefile - needs GNU make 3.80 or better +# MAKEFLAGS += -rR .SUFFIXES: diff --git a/doc/Makefile b/doc/Makefile index c5b61901..0a390147 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,17 @@ +# +# UPX doc Makefile - needs GNU make 3.80 or better +# + MAKEFLAGS += -rR .SUFFIXES: SHELL = /bin/sh +# internal make variables +comma := , +empty := +space := $(empty) $(empty) +tab := $(empty) $(empty) + # update $PATH for our special stub build tools ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),) export PATH := $(HOME)/local/bin/bin-upx:$(PATH) @@ -10,14 +20,19 @@ ifneq ($(wildcard $(HOME)/bin/bin-upx/.),) export PATH := $(HOME)/bin/bin-upx:$(PATH) endif + +# /*********************************************************************** +# // +# ************************************************************************/ + top_srcdir = .. PACKAGE = upx VERSION_DATE := $(shell sed -n 's/^.*UPX_VERSION_DATE_ISO .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h) VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h) -RTRIM := sed -e 's/[ ]*$$//' -DETAB2 := sed -e 's/ / /g' +RTRIM := sed -e 's/[ $(tab)]*$$//' +DETAB2 := sed -e 's/$(tab)/ /g' BUILT_SOURCES = upx.1 upx.doc upx.html upx.man upx.ps upx.tex BUILT_SOURCES = upx.1 upx.doc upx.html diff --git a/src/stub/Makefile b/src/stub/Makefile index c7f47a4b..14d95373 100644 --- a/src/stub/Makefile +++ b/src/stub/Makefile @@ -12,6 +12,12 @@ MAKEFLAGS += -rR export SHELL = /bin/sh export LC_ALL = C +# internal make variables +comma := , +empty := +space := $(empty) $(empty) +tab := $(empty) $(empty) + ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.79 3.79.1 3.80),) $(error GNU make 3.81 or better is required) endif @@ -118,7 +124,7 @@ maintainer-clean: override T = $(basename $(notdir $@)) # trim (strip) trailing whitespace -RTRIM := sed -e 's/[ ]*$$//' +RTRIM := sed -e 's/[ $(tab)]*$$//' # clear some vars, just in case LABEL_PREFIX = @@ -712,14 +718,15 @@ endif ifndef EXTRA_MAKEFILES EXTRA_MAKEFILES := ifneq ($(filter extra-%,$(MAKECMDGOALS)),) -EXTRA_MAKEFILES += $(shell find src/arch -name Makefile.extra 2>/dev/null | LC_ALL=C sort -u) +EXTRA_MAKEFILES += $(wildcard src/arch/*/Makefile.extra src/arch/*/*/Makefile.extra src/arch/*/*/*/Makefile.extra) +##EXTRA_MAKEFILES += $(shell find src/arch -name Makefile.extra 2>/dev/null) endif endif ifneq ($(strip $(EXTRA_MAKEFILES)),) EXTRA_MAKEFILES.targets := -EXTRA_MAKEFILES.targets += $(addsuffix .~all,$(EXTRA_MAKEFILES)) -EXTRA_MAKEFILES.targets += $(addsuffix .~clean,$(EXTRA_MAKEFILES)) +EXTRA_MAKEFILES.targets += $(addsuffix .~all,$(sort $(EXTRA_MAKEFILES))) +EXTRA_MAKEFILES.targets += $(addsuffix .~clean,$(sort $(EXTRA_MAKEFILES))) $(EXTRA_MAKEFILES.targets): MAKEFLAGS += --no-print-directory $(EXTRA_MAKEFILES.targets): $$(basename $$@)