mirror of https://github.com/upx/upx.git
Update Makefiles.
This commit is contained in:
parent
f07cea0b79
commit
56a35649fe
13
Makefile
13
Makefile
|
@ -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
|
MAKEFLAGS += -rR
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
export SHELL = /bin/sh
|
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 = .
|
srcdir = .
|
||||||
top_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
|
BUILD_STUB = 0
|
||||||
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
|
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
|
||||||
BUILD_STUB = 1
|
BUILD_STUB = 1
|
||||||
|
@ -19,9 +23,6 @@ endif
|
||||||
ifneq ($(wildcard $(HOME)/bin/bin-upx/.),)
|
ifneq ($(wildcard $(HOME)/bin/bin-upx/.),)
|
||||||
BUILD_STUB = 1
|
BUILD_STUB = 1
|
||||||
endif
|
endif
|
||||||
ifneq ($(findstring $(firstword $(MAKE_VERSION)),3.79 3.79.1 3.80),)
|
|
||||||
BUILD_STUB = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
18
src/Makefile
18
src/Makefile
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# UPX Makefile - needs GNU make 3.80 or better
|
# UPX Makefile - needs GNU make 3.81 or better
|
||||||
#
|
#
|
||||||
|
|
||||||
MAKEFLAGS += -rR
|
MAKEFLAGS += -rR
|
||||||
|
@ -7,6 +7,10 @@ MAKEFLAGS += -rR
|
||||||
export SHELL = /bin/sh
|
export SHELL = /bin/sh
|
||||||
override e = $($1) $(EXTRA_$1) $(upx_$1) $($(basename $(notdir $@)).$1)
|
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
|
ifndef srcdir
|
||||||
srcdir := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
|
srcdir := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
|
||||||
srcdir := $(shell echo '$(srcdir)' | sed 's,/*$$,,')
|
srcdir := $(shell echo '$(srcdir)' | sed 's,/*$$,,')
|
||||||
|
@ -14,7 +18,7 @@ endif
|
||||||
ifndef top_srcdir
|
ifndef top_srcdir
|
||||||
top_srcdir := $(srcdir)/..
|
top_srcdir := $(srcdir)/..
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
ifneq ($(srcdir),.)
|
ifneq ($(srcdir),.)
|
||||||
##$(info Info: using VPATH . $(srcdir))
|
##$(info Info: using VPATH . $(srcdir))
|
||||||
VPATH := . $(srcdir)
|
VPATH := . $(srcdir)
|
||||||
|
@ -58,7 +62,7 @@ INCLUDES += -I$(UPX_LZMADIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: .depend upx$(exeext)
|
all: upx$(exeext) | .depend
|
||||||
.DELETE_ON_ERROR: .depend upx$(exeext) $(upx_OBJECTS)
|
.DELETE_ON_ERROR: .depend upx$(exeext) $(upx_OBJECTS)
|
||||||
|
|
||||||
upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES)
|
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))
|
$(strip $(CXXLD) $(call e,CPPFLAGS) $(call e,CXXFLAGS) $(call e,LDFLAGS) -o $@ $(upx_OBJECTS) $(call e,LDADD) $(call e,LIBS))
|
||||||
$($(notdir $@).POST_LINK_STEP)
|
$($(notdir $@).POST_LINK_STEP)
|
||||||
|
|
||||||
%.o : %.cpp .depend
|
%.o : %.cpp | .depend
|
||||||
$(strip $(CXX) $(call e,CPPFLAGS) $(call e,CXXFLAGS) -o $@ -c $<)
|
$(strip $(CXX) $(call e,CPPFLAGS) $(call e,CXXFLAGS) -o $@ -c $<)
|
||||||
|
|
||||||
.depend: $(wildcard $(srcdir)/*.cpp) $(wildcard $(srcdir)/*.h) $(MAKEFILE_LIST)
|
.depend: $(wildcard $(srcdir)/*.cpp) $(wildcard $(srcdir)/*.h) $(MAKEFILE_LIST)
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
ifeq ($(USE_GNUC),1)
|
ifeq ($(USE_GNUC),1)
|
||||||
$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@
|
@echo "Updating $@"
|
||||||
|
@$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@
|
||||||
else
|
else
|
||||||
touch $@
|
touch $@
|
||||||
endif
|
endif
|
||||||
|
@ -91,5 +96,6 @@ endif
|
||||||
mostlyclean clean distclean maintainer-clean:
|
mostlyclean clean distclean maintainer-clean:
|
||||||
rm -f *.d *.map *.o *.obj *.res .depend upx.exe upx.out upx.ttp upx$(exeext)
|
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
|
.PHONY: all mostlyclean clean distclean maintainer-clean
|
||||||
|
|
||||||
|
-include .depend
|
||||||
|
|
|
@ -18,7 +18,7 @@ empty :=
|
||||||
space := $(empty) $(empty)
|
space := $(empty) $(empty)
|
||||||
tab := $(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)
|
$(error GNU make 3.81 or better is required)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ endif
|
||||||
ifndef top_srcdir
|
ifndef top_srcdir
|
||||||
top_srcdir := $(srcdir)/../..
|
top_srcdir := $(srcdir)/../..
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
|
|
||||||
# update $PATH for our special stub build tools
|
# update $PATH for our special stub build tools
|
||||||
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
|
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/.),)
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -14,7 +14,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
|
@ -8,7 +8,7 @@ __dir_list += ../../../../../.. ../../../../../../.. ../../../../../../../..
|
||||||
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
__dir_search = $(firstword $(foreach v,$1,$(if $(wildcard $v/$2),$v)) $3)
|
||||||
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
top_srcdir := $(call __dir_search,$(__dir_list),src/bele.h,NOT_FOUND)
|
||||||
endif
|
endif
|
||||||
-include $(top_srcdir)/Makevars.global ./Makevars.local
|
include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
|
||||||
vpath %.c $(top_srcdir)/src/stub/src/c
|
vpath %.c $(top_srcdir)/src/stub/src/c
|
||||||
|
|
||||||
STUBS =
|
STUBS =
|
||||||
|
|
Loading…
Reference in New Issue