Update Makefiles.

This commit is contained in:
Markus F.X.J. Oberhumer 2007-03-09 07:59:50 +01:00
parent f07cea0b79
commit 56a35649fe
12 changed files with 30 additions and 23 deletions

View File

@ -1,17 +1,21 @@
#
# UPX toplevel Makefile - needs GNU make 3.80 or better
# UPX toplevel Makefile - needs GNU make 3.81 or better
#
MAKEFLAGS += -rR
.SUFFIXES:
export SHELL = /bin/sh
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.77 3.78 3.78.1 3.79 3.79.1 3.80),)
$(error GNU make 3.81 or better is required)
endif
srcdir = .
top_srcdir = .
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
# info: src/stub needs GNU make 3.81 and special build tools
# info: src/stub needs special build tools
BUILD_STUB = 0
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
BUILD_STUB = 1
@ -19,9 +23,6 @@ endif
ifneq ($(wildcard $(HOME)/bin/bin-upx/.),)
BUILD_STUB = 1
endif
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.79 3.79.1 3.80),)
BUILD_STUB = 0
endif
default:

View File

@ -1,5 +1,5 @@
#
# UPX Makefile - needs GNU make 3.80 or better
# UPX Makefile - needs GNU make 3.81 or better
#
MAKEFLAGS += -rR
@ -7,6 +7,10 @@ MAKEFLAGS += -rR
export SHELL = /bin/sh
override e = $($1) $(EXTRA_$1) $(upx_$1) $($(basename $(notdir $@)).$1)
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.77 3.78 3.78.1 3.79 3.79.1 3.80),)
$(error GNU make 3.81 or better is required)
endif
ifndef srcdir
srcdir := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
srcdir := $(shell echo '$(srcdir)' | sed 's,/*$$,,')
@ -14,7 +18,7 @@ endif
ifndef top_srcdir
top_srcdir := $(srcdir)/..
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
ifneq ($(srcdir),.)
##$(info Info: using VPATH . $(srcdir))
VPATH := . $(srcdir)
@ -58,7 +62,7 @@ INCLUDES += -I$(UPX_LZMADIR)
endif
all: .depend upx$(exeext)
all: upx$(exeext) | .depend
.DELETE_ON_ERROR: .depend upx$(exeext) $(upx_OBJECTS)
upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES)
@ -66,13 +70,14 @@ upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES)
$(strip $(CXXLD) $(call e,CPPFLAGS) $(call e,CXXFLAGS) $(call e,LDFLAGS) -o $@ $(upx_OBJECTS) $(call e,LDADD) $(call e,LIBS))
$($(notdir $@).POST_LINK_STEP)
%.o : %.cpp .depend
%.o : %.cpp | .depend
$(strip $(CXX) $(call e,CPPFLAGS) $(call e,CXXFLAGS) -o $@ -c $<)
.depend: $(wildcard $(srcdir)/*.cpp) $(wildcard $(srcdir)/*.h) $(MAKEFILE_LIST)
@rm -f $@
ifeq ($(USE_GNUC),1)
$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@
@echo "Updating $@"
@$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@
else
touch $@
endif
@ -91,5 +96,6 @@ endif
mostlyclean clean distclean maintainer-clean:
rm -f *.d *.map *.o *.obj *.res .depend upx.exe upx.out upx.ttp upx$(exeext)
include $(wildcard .depend)
.PHONY: all mostlyclean clean distclean maintainer-clean
-include .depend

View File

@ -18,7 +18,7 @@ empty :=
space := $(empty) $(empty)
tab := $(empty) $(empty)
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.79 3.79.1 3.80),)
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.77 3.78 3.78.1 3.79 3.79.1 3.80),)
$(error GNU make 3.81 or better is required)
endif
@ -29,7 +29,7 @@ endif
ifndef top_srcdir
top_srcdir := $(srcdir)/../..
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
# update $PATH for our special stub build tools
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -14,7 +14,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =

View File

@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
endif
-include $(top_srcdir)/Makevars.global ./Makevars.local
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
vpath %.c $(top_srcdir)/src/stub/src/c
STUBS =