Update Makefile configuration variables.

This commit is contained in:
Markus F.X.J. Oberhumer
2016-09-28 13:07:39 +02:00
parent 93cf170253
commit 51eab2a4b7
4 changed files with 24 additions and 31 deletions
+4 -4
View File
@@ -5,10 +5,10 @@ os: Visual Studio 2015
environment: environment:
matrix: matrix:
# - { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 } # - { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 } # missing strtoull()
### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # x64 is not installed ### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # AppVeyor: x64 compiler is not installed
# - { C: msvc-11.0-x86, CL_VERSION: 17.00, VS_VERSION: 2012 } # - { C: msvc-11.0-x86, CL_VERSION: 17.00, VS_VERSION: 2012 } # missing strtoull()
### - { C: msvc-11.0-x64, CL_VERSION: 17.00, VS_VERSION: 2012 } # x64 is not installed ### - { C: msvc-11.0-x64, CL_VERSION: 17.00, VS_VERSION: 2012 } # AppVeyor: x64 compiler is not installed
- { C: msvc-12.0-x86, CL_VERSION: 18.00, VS_VERSION: 2013 } - { C: msvc-12.0-x86, CL_VERSION: 18.00, VS_VERSION: 2013 }
- { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 } - { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 }
- { C: msvc-14.0-x86, CL_VERSION: 19.00, VS_VERSION: 2015 } - { C: msvc-14.0-x86, CL_VERSION: 19.00, VS_VERSION: 2015 }
+2 -2
View File
@@ -79,11 +79,11 @@ if [[ $B =~ (^|\+)coverage($|\+) ]]; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fprofile-arcs -ftest-coverage" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fprofile-arcs -ftest-coverage"
fi fi
if [[ $B =~ (^|\+)debug($|\+) ]]; then if [[ $B =~ (^|\+)debug($|\+) ]]; then
make="$make USE_DEBUG=1" make="$make BUILD_TYPE_DEBUG=1"
fi fi
if [[ $B =~ (^|\+)sanitize($|\+) ]]; then if [[ $B =~ (^|\+)sanitize($|\+) ]]; then
case $TRAVIS_OS_NAME-$CC in linux-gcc*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fuse-ld=gold" ;; esac case $TRAVIS_OS_NAME-$CC in linux-gcc*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fuse-ld=gold" ;; esac
make="$make USE_SANITIZE=1" make="$make BUILD_TYPE_SANITIZE=1"
fi fi
if [[ $B =~ (^|\+)scan-build($|\+) ]]; then if [[ $B =~ (^|\+)scan-build($|\+) ]]; then
make="$SCAN_BUILD $make" make="$SCAN_BUILD $make"
-7
View File
@@ -8,15 +8,10 @@ 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 $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local) include $(wildcard $(top_srcdir)/Makevars.global ./Makevars.local)
# info: src/stub needs special build tools from https://github.com/upx/upx-stubtools # info: src/stub needs special build tools from https://github.com/upx/upx-stubtools
BUILD_STUB = 0 BUILD_STUB = 0
ifneq ($(wildcard $(HOME)/local/bin/bin-upx/upx-stubtools-check-version),) ifneq ($(wildcard $(HOME)/local/bin/bin-upx/upx-stubtools-check-version),)
@@ -26,7 +21,6 @@ ifneq ($(wildcard $(HOME)/bin/bin-upx/upx-stubtools-check-version),)
BUILD_STUB = 1 BUILD_STUB = 1
endif endif
default: default:
@echo "UPX info: please choose a target for 'make'" @echo "UPX info: please choose a target for 'make'"
@@ -37,7 +31,6 @@ endif
$(MAKE) -C src $@ $(MAKE) -C src $@
$(MAKE) -C doc $@ $(MAKE) -C doc $@
.PHONY: default all mostlyclean clean distclean maintainer-clean .PHONY: default all mostlyclean clean distclean maintainer-clean
# vim:set ts=8 sw=8 noet: # vim:set ts=8 sw=8 noet:
+18 -18
View File
@@ -4,9 +4,10 @@
# Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 1996-2016 Markus Franz Xaver Johannes Oberhumer
# #
# build configuration options # build configuration options for this Makefile
#USE_DEBUG = 1 BUILD_TYPE_DEBUG ?= 0
#USE_SANITIZE = 1 BUILD_TYPE_SANITIZE ?= 0
BUILD_USE_DEPEND ?= 1
MAKEFLAGS += -r MAKEFLAGS += -r
ifneq ($(upx_CXX),) ifneq ($(upx_CXX),)
@@ -22,10 +23,6 @@ endif
export SHELL = /bin/sh export SHELL = /bin/sh
override e = $($1) $(EXTRA_$1) $(upx_$1) $(upx_EXTRA_$1) $($(basename $(notdir $@)).$1) override e = $($1) $(EXTRA_$1) $(upx_$1) $(upx_EXTRA_$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,/*$$,,')
@@ -65,7 +62,7 @@ include $(top_srcdir)/src/stub/src/c/Makevars.lzma
DEFS += -DWITH_LZMA=$(UPX_LZMA_VERSION) DEFS += -DWITH_LZMA=$(UPX_LZMA_VERSION)
CPPFLAGS += $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) CPPFLAGS += $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
ifdef USE_DEBUG ifeq ($(BUILD_TYPE_DEBUG),1)
CXXFLAGS += -O0 -g CXXFLAGS += -O0 -g
else else
CXXFLAGS += -O2 CXXFLAGS += -O2
@@ -79,7 +76,7 @@ CXXFLAGS += -Wall -W -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-a
CXXFLAGS_WERROR ?= -Werror CXXFLAGS_WERROR ?= -Werror
CXXFLAGS += $(CXXFLAGS_WERROR) CXXFLAGS += $(CXXFLAGS_WERROR)
ifdef USE_SANITIZE ifeq ($(BUILD_TYPE_SANITIZE),1)
CXXFLAGS_SANITIZE := -fsanitize=address,undefined -fno-omit-frame-pointer -DACC_CFG_NO_UNALIGNED CXXFLAGS_SANITIZE := -fsanitize=address,undefined -fno-omit-frame-pointer -DACC_CFG_NO_UNALIGNED
CXXFLAGS += $(CXXFLAGS_SANITIZE) CXXFLAGS += $(CXXFLAGS_SANITIZE)
LDFLAGS += $(CXXFLAGS_SANITIZE) LDFLAGS += $(CXXFLAGS_SANITIZE)
@@ -88,35 +85,36 @@ compress_lzma$(objext) filteri$(objext) : CXXFLAGS := $(filter-out $(CXXFLAGS_SA
endif endif
all: upx$(exeext) | .depend all: upx$(exeext) | ./.depend
.DELETE_ON_ERROR: upx$(exeext) $(upx_OBJECTS) .depend .DELETE_ON_ERROR: upx$(exeext) $(upx_OBJECTS) ./.depend
upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES) upx$(exeext): $(upx_OBJECTS) $(upx_DEPENDENCIES)
$($(notdir $@).PRE_LINK_STEP) $($(notdir $@).PRE_LINK_STEP)
$(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: $(sort $(wildcard $(srcdir)/*.cpp $(srcdir)/*.h)) $(MAKEFILE_LIST) ifeq ($(BUILD_USE_DEPEND),1)
./.depend: $(sort $(wildcard $(srcdir)/*.cpp $(srcdir)/*.h)) $(MAKEFILE_LIST)
@rm -f $@ @rm -f $@
ifeq (1,1)
@echo "Updating $@" @echo "Updating $@"
@$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@ @$(strip $(CXX) $(call e,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@
else else
@echo "timestamp" > $@ ./.depend:
.PHONY: ./.depend
endif endif
.depend compress_lzma$(objext) : INCLUDES += -I$(UPX_LZMADIR) ./.depend compress_lzma$(objext) : INCLUDES += -I$(UPX_LZMADIR)
compress_lzma$(objext) : CXXFLAGS += -Wno-shadow compress_lzma$(objext) : CXXFLAGS += -Wno-shadow
p_mach$(objext) : CXXFLAGS += -Wno-cast-align p_mach$(objext) : CXXFLAGS += -Wno-cast-align
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)
.PHONY: all mostlyclean clean distclean maintainer-clean .PHONY: all mostlyclean clean distclean maintainer-clean
@@ -126,7 +124,9 @@ else ifeq ($(MAKECMDGOALS),distclean)
else ifeq ($(MAKECMDGOALS),maintainer-clean) else ifeq ($(MAKECMDGOALS),maintainer-clean)
else ifeq ($(MAKECMDGOALS),clang-format) else ifeq ($(MAKECMDGOALS),clang-format)
else else
-include .depend ifeq ($(BUILD_USE_DEPEND),1)
-include ./.depend
endif
help$(objext): $(MAKEFILE_LIST) help$(objext): $(MAKEFILE_LIST)
endif endif