Removed old Makfiles (horrible cruft dating back from 1998).
committer: mfx <mfx> 1109750572 +0000
This commit is contained in:
@@ -1,42 +0,0 @@
|
|||||||
ifeq ($(DEPS_DONE),)
|
|
||||||
DEPS_DONE := 1
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // automated dependencies
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
ifeq ($(DEPMODE),gcc)
|
|
||||||
EXTRA_CFLAGS += -Wp,-MMD,.deps/$(*F).d
|
|
||||||
EXTRA_CXXFLAGS += -Wp,-MMD,.deps/$(*F).d
|
|
||||||
HAVE_DEPS := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(DEPMODE),linux-intelc)
|
|
||||||
EXTRA_CFLAGS += -MMD -MF.deps/$(*F).d
|
|
||||||
EXTRA_CXXFLAGS += -MMD -MF.deps/$(*F).d
|
|
||||||
HAVE_DEPS := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(DEPMODE),linux-pgi)
|
|
||||||
## NOTE: -MMD does not work...
|
|
||||||
EXTRA_CFLAGS += -MD.deps/$(*F).d
|
|
||||||
EXTRA_CXXFLAGS += -MD.deps/$(*F).d
|
|
||||||
HAVE_DEPS := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(HAVE_DEPS),1)
|
|
||||||
ifeq ($(strip $(wildcard .deps)),)
|
|
||||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
|
||||||
else
|
|
||||||
DEPS_FILES := $(wildcard .deps/*.d)
|
|
||||||
ifneq ($(strip $(DEPS_FILES)),)
|
|
||||||
include $(DEPS_FILES)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
endif # DEPS_DONE
|
|
||||||
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
DEPMODE := gcc
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // defaults for gcc
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
|
|
||||||
|
|
||||||
CFLAGS_W =
|
|
||||||
CFLAGS_M =
|
|
||||||
CFLAGS_O =
|
|
||||||
CXXFLAGS_W =
|
|
||||||
CXXFLAGS_M =
|
|
||||||
CXXFLAGS_O =
|
|
||||||
|
|
||||||
CFLAGS = $(call __mkflags,CFLAGS_W) $(call __mkflags,CFLAGS_M) $(call __mkflags,CFLAGS_O)
|
|
||||||
CXXFLAGS = $(call __mkflags,CXXFLAGS_W) $(call __mkflags,CXXFLAGS_M) $(call __mkflags,CXXFLAGS_O)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# cflags
|
|
||||||
#
|
|
||||||
|
|
||||||
##CFLAGS_WERROR = -Werror
|
|
||||||
CFLAGS_WERROR =
|
|
||||||
CFLAGS_W = $(CFLAGS_WERROR) -Wall -W -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wwrite-strings
|
|
||||||
CXXFLAGS_W = $(CFLAGS_WERROR) -Wall -W -Wcast-align -Wcast-qual -Winline -Woverloaded-virtual -Wpointer-arith -Wshadow -Wsign-promo -Wwrite-strings
|
|
||||||
|
|
||||||
##CFLAGS_M += -fno-builtin
|
|
||||||
##CFLAGS_M += -malign-functions=0 -malign-jumps=0 -malign-loops=0
|
|
||||||
CXXFLAGS_M = $(CFLAGS_M)
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS_O = -g -O0
|
|
||||||
else
|
|
||||||
##CFLAGS_O = -Os -fstrict-aliasing
|
|
||||||
CFLAGS_O = -O2 -fstrict-aliasing
|
|
||||||
##CFLAGS_O = -O2 -fno-strict-aliasing
|
|
||||||
endif
|
|
||||||
CXXFLAGS_O = $(CFLAGS_O) -fconserve-space
|
|
||||||
##CXXFLAGS += -fasynchronous-exceptions
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# cxxflags for g++ 3.2 or better
|
|
||||||
|
|
||||||
##CXXFLAGS_W += -Wdisabled-optimization -Wpacked
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# ldflags
|
|
||||||
#
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
LDFLAGS += -g
|
|
||||||
else
|
|
||||||
LDFLAGS += -s
|
|
||||||
endif
|
|
||||||
LDFLAGS += -Wl,-Map,$T.map
|
|
||||||
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# vi:nowrap
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
UDIR := $($(U)DIR)
|
|
||||||
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/include)),) # { include
|
|
||||||
DEFS += -DWITH_$(U)
|
|
||||||
INCLUDES += -I$(UDIR)/include
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/debug/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/debug/src/.libs
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/$(release)/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/$(release)/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/$(target)/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/$(target)/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/release/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/release/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR)/build/src/.libs)),)
|
|
||||||
LIBDIRS += $(UDIR)/build/src/.libs
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(UDIR))),)
|
|
||||||
LIBDIRS += $(UDIR)
|
|
||||||
DOS_LIBDIRS := $(DOS_LIBDIRS);$(UDIR)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDLIBS += -l$(u)
|
|
||||||
DOS_LDLIBS += $(u).lib
|
|
||||||
|
|
||||||
|
|
||||||
DEFS := $(DEFS)
|
|
||||||
INCLUDES := $(INCLUDES)
|
|
||||||
LIBDIRS := $(LIBDIRS)
|
|
||||||
LDLIBS := $(LDLIBS)
|
|
||||||
DOS_LDLIBS := $(DOS_LDLIBS)
|
|
||||||
|
|
||||||
endif # } include
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
#
|
|
||||||
# UPX Makefile (GNU make) - works with unix/win32/djgpp2
|
|
||||||
#
|
|
||||||
# usage:
|
|
||||||
# `make target=linux' # linux
|
|
||||||
# `make target=dos32-djggp2' # dos32 - djggp2
|
|
||||||
# `make target=win32-cygwin' # win32 - cygwin
|
|
||||||
# `make target=win32-mingw32' # win32 - mingw32
|
|
||||||
# `make target=win32-rsxnt' # win32 - rsxnt
|
|
||||||
# `make target=win32-bc' # win32 - Borland C++
|
|
||||||
# `make target=win32-dm' # win32 - Digital Mars C++
|
|
||||||
# `make target=win32-ic' # win32 - Intel C++
|
|
||||||
# `make target=win32-vc' # win32 - Visual C++
|
|
||||||
# `make target=win32-wc' # win32 - Watcom C++
|
|
||||||
# `make target=cross-amd64-linux' # x86_64-linux cross compiler
|
|
||||||
# `make target=cross-mingw32' # i586-mingw32msvc cross compiler
|
|
||||||
# `make target=cross-mint' # m68k-atari-mint cross compiler
|
|
||||||
# `make target=gcc' # generic gcc
|
|
||||||
#
|
|
||||||
# you can also set the `UPX_MAKE_TARGET' environment variable.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
# configuration section
|
|
||||||
|
|
||||||
ifeq ($(strip $(UCLDIR)),)
|
|
||||||
# change this to reflect where the UCL library is
|
|
||||||
UCLDIR = $(HOME)/local/src/ucl-1.03
|
|
||||||
endif
|
|
||||||
|
|
||||||
## you can set the default target here
|
|
||||||
##target =
|
|
||||||
|
|
||||||
DEBUG = 0
|
|
||||||
|
|
||||||
srcdir = .
|
|
||||||
top_srcdir = ..
|
|
||||||
|
|
||||||
|
|
||||||
##### You should not have to change anything below this line. #####
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // object files
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
# these use exceptions & RTTI
|
|
||||||
OBJECTS1 = \
|
|
||||||
compress$o except$o file$o lefile$o \
|
|
||||||
filter$o linker$o mem$o msg$o stdcxx$o work$o ui$o \
|
|
||||||
packer$o packerf$o packhead$o packmast$o \
|
|
||||||
p_com$o p_djgpp2$o p_elks$o p_exe$o \
|
|
||||||
p_lx_elf$o p_lx_exc$o p_lx_sep$o p_lx_sh$o p_lx_interp$o \
|
|
||||||
p_ps1$o p_sys$o p_tmt$o p_tos$o \
|
|
||||||
p_unix$o p_vmlinz$o p_vmlinx$o p_w16ne$o p_w32pe$o p_wcle$o \
|
|
||||||
p_mach$o
|
|
||||||
|
|
||||||
# no exceptions or RTTI
|
|
||||||
OBJECTS2 = \
|
|
||||||
filteri$o help$o main$o mygetopt$o snprintf$o util$o \
|
|
||||||
c_init$o c_file$o c_none$o c_screen$o \
|
|
||||||
s_object$o s_djgpp2$o s_vcsa$o s_win32$o
|
|
||||||
|
|
||||||
# pure C sources
|
|
||||||
OBJECTS3 =
|
|
||||||
|
|
||||||
OBJECTS = $(OBJECTS1) $(OBJECTS2) $(OBJECTS3)
|
|
||||||
LIBS =
|
|
||||||
RESOURCES =
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // main
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
override WITH_ZLIB = 1
|
|
||||||
|
|
||||||
include $(srcdir)/Makefile.bld
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // dependencies
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
include $(srcdir)/Makedefs.dep
|
|
||||||
|
|
||||||
$(OBJECTS): miniacc.h
|
|
||||||
|
|
||||||
# vi:nowrap
|
|
||||||
@@ -1,720 +0,0 @@
|
|||||||
# /***********************************************************************
|
|
||||||
# // prepare setup
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .a .c .cpp .exe .lib .o .obj .rc .res .ttp
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(srcdir),)
|
|
||||||
srcdir = .
|
|
||||||
endif
|
|
||||||
|
|
||||||
VPATH = $(srcdir)
|
|
||||||
|
|
||||||
|
|
||||||
# auto-detect the target unless given on the commandline
|
|
||||||
ifeq ($(strip $(target)),)
|
|
||||||
# try environment variable UPX_MAKE_TARGET
|
|
||||||
target := $(UPX_MAKE_TARGET)
|
|
||||||
endif
|
|
||||||
ifeq ($(strip $(target)),)
|
|
||||||
ifneq ($(strip $(wildcard /usr/include/linux)),)
|
|
||||||
target = linux
|
|
||||||
endif
|
|
||||||
##ifneq ($(strip $(wildcard /platform/sun4?/kernel/unix)),)
|
|
||||||
##target = sparc-sun-solaris
|
|
||||||
##endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(strip $(target)),)
|
|
||||||
include please_specify_a_target
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# util var for use in the rules - basename of the current target
|
|
||||||
override T = $(basename $@)
|
|
||||||
|
|
||||||
# expand "VAR" into "$(VAR) $(EXTRA_VAR) $(UPX_EXTRA_VAR)"
|
|
||||||
override __mkflags = $(strip $($(1)) $(EXTRA_$(1)) $(UPX_EXTRA_$(1)))
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // compiler defaults
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
CC_SRC = $<
|
|
||||||
CXX_SRC = $<
|
|
||||||
CC_COMPILE = $(CC) $(CCARCH) $(call __mkflags,DEFS) $(call __mkflags,INCLUDES) $(call __mkflags,CFLAGS) $(CFLAGS_OUTPUT) -c $(CC_SRC)
|
|
||||||
CXX_COMPILE = $(CXX) $(CXXARCH) $(call __mkflags,DEFS) $(call __mkflags,INCLUDES) $(call __mkflags,CXXFLAGS) $(CXXFLAGS_OUTPUT) -c $(CXX_SRC)
|
|
||||||
CXX_LINK_EXE = $(CXXLD) $(CXXLDARCH) $(call __mkflags,LDFLAGS) $(LINK_EXE_OUTPUT) $^ $(call __mkflags,LDLIBS)
|
|
||||||
STUBEDIT_EXE =
|
|
||||||
STUBIFY_EXE =
|
|
||||||
CHMOD_EXE =
|
|
||||||
|
|
||||||
o = .o
|
|
||||||
a = .a
|
|
||||||
e =
|
|
||||||
DEFS =
|
|
||||||
INCLUDES =
|
|
||||||
LIBDIRS =
|
|
||||||
DOS_LDLIBS =
|
|
||||||
DOS_LIBDIRS =
|
|
||||||
|
|
||||||
# CC defaults
|
|
||||||
CC = INVALID_TARGET_CC
|
|
||||||
CCARCH =
|
|
||||||
CFLAGS =
|
|
||||||
CFLAGS_OUTPUT =
|
|
||||||
|
|
||||||
# CXX defaults
|
|
||||||
CXX = $(CC)
|
|
||||||
CXXARCH = $(CCARCH)
|
|
||||||
CXXFLAGS = $(CFLAGS)
|
|
||||||
CXXFLAGS_OUTPUT = $(CFLAGS_OUTPUT)
|
|
||||||
|
|
||||||
# CXXLD defaults
|
|
||||||
CXXLD = $(CXX)
|
|
||||||
CXXLDARCH = $(CXXARCH)
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT =
|
|
||||||
LDLIBS =
|
|
||||||
LINK_EXE_LDFLAGS =
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
DEFS += -DDEBUG
|
|
||||||
## DEFS += -DTESTING
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // compression libraries
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
DOS_LDLIBS += zlib.lib
|
|
||||||
ZLIBDIR:=$(strip $(subst \,/,$(ZLIBDIR)))
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR))),)
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR)/include/zlib.h)),)
|
|
||||||
INCLUDES += -I$(ZLIBDIR)/include
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR)/src/zlib.h)),)
|
|
||||||
INCLUDES += -I$(ZLIBDIR)/src
|
|
||||||
else
|
|
||||||
ifneq ($(strip $(wildcard $(ZLIBDIR)/zlib.h)),)
|
|
||||||
INCLUDES += -I$(ZLIBDIR)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
UCLDIR:=$(strip $(subst \,/,$(UCLDIR)))
|
|
||||||
NRVDIR:=$(strip $(subst \,/,$(NRVDIR)))
|
|
||||||
u = ucl
|
|
||||||
U = UCL
|
|
||||||
upx_exe_tail =
|
|
||||||
include $(srcdir)/Makedefs.inc
|
|
||||||
ifneq ($(strip $(wildcard $(NRVDIR)/include/nrv)),)
|
|
||||||
u = nrv
|
|
||||||
U = NRV
|
|
||||||
upx_exe_tail := _$(u)
|
|
||||||
include $(srcdir)/Makedefs.inc
|
|
||||||
endif
|
|
||||||
upx_exe = upx$(upx_exe_tail)$(e)
|
|
||||||
|
|
||||||
override tmp := -Wl,--rpath,
|
|
||||||
LDRPATH := $(addprefix $(tmp),$(LIBDIRS))
|
|
||||||
LIBDIRS += .
|
|
||||||
LDLIBDIRS := $(addprefix -L,$(LIBDIRS))
|
|
||||||
|
|
||||||
##LDFLAGS += $(LDRPATH)
|
|
||||||
LDFLAGS += $(LDLIBDIRS)
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // compiler settings
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
###
|
|
||||||
### generic gcc
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),gcc)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux - gcc
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
override arch := $(shell uname -m | sed -e 's/^i[3456789]86$$/i386/')
|
|
||||||
ifeq ($(arch),i386)
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
endif
|
|
||||||
DEFS += -D_FILE_OFFSET_BITS=64
|
|
||||||
LDLIBS += -lmcheck
|
|
||||||
##CFLAGS_WERROR = -Werror
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
else
|
|
||||||
##LDFLAGS += -static
|
|
||||||
STUBEDIT_EXE = objcopy -S -R .comment -R .note $@
|
|
||||||
ifeq ($(arch),i386)
|
|
||||||
## STUBIFY_EXE = perl $(srcdir)/stub/scripts/brandelf.pl $@
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
CHMOD_EXE = chmod 755 $@
|
|
||||||
endif # linux
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux/i386 - Borland C++ 5.7 (Kylix 3)
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux-bc57)
|
|
||||||
##DEPMODE := linux-XXX ## FIXME
|
|
||||||
CC = bc++ -q -3
|
|
||||||
CFLAGS = -w '-w!'
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS += -ls
|
|
||||||
LINK_EXE_OUTPUT = -e$@
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
# warning: do not use option `-d' --> incorrect string merging will happen
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -dc
|
|
||||||
else
|
|
||||||
CFLAGS += -O2 -dc
|
|
||||||
endif
|
|
||||||
# transform `-lxx -lyy' into `libxx.a libyy.a'
|
|
||||||
LDLIBS := $(shell echo "$(LDLIBS)" | perl -pe 's/-l(.+?)\b/lib\1.a/g')
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux/i386 - Intel C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux-intelc)
|
|
||||||
DEPMODE := linux-intelc
|
|
||||||
CC = icc
|
|
||||||
CXX = icpc
|
|
||||||
CCARCH += -march=i386 -mcpu=i686 -nolib_inline
|
|
||||||
DEFS += -D_FILE_OFFSET_BITS=64
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
CFLAGS = $(CFLAGS_WERROR)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -g -O0
|
|
||||||
else
|
|
||||||
CFLAGS += -O2
|
|
||||||
endif
|
|
||||||
LDFLAGS += -Wl,-Map,$T.map
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### linux/i386 - Portland Group PGI C++ 5.x
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),linux-pgi)
|
|
||||||
DEPMODE := linux-pgi
|
|
||||||
CC = pgcc
|
|
||||||
CXX = pgCC
|
|
||||||
CCARCH += -tp=p6
|
|
||||||
DEFS += -D_FILE_OFFSET_BITS=64
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
ifeq ($(WITH_ZLIB),1)
|
|
||||||
LDLIBS += -lz
|
|
||||||
endif
|
|
||||||
##CFLAGS += -Minform=info
|
|
||||||
CXXFLAGS = $(CFLAGS) -tused
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
else
|
|
||||||
CFLAGS += -O2
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### Linux cross compilers
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),cross-amd64-linux)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
CC = x86_64-linux-gcc
|
|
||||||
CXX = x86_64-linux-g++
|
|
||||||
LDLIBS += -lmcheck
|
|
||||||
endif # cross-amd64-linux
|
|
||||||
|
|
||||||
ifeq ($(target),cross-m68k-linux)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
CC = m68k-linux-gcc
|
|
||||||
CXX = m68k-linux-g++
|
|
||||||
##LDLIBS += -lmcheck
|
|
||||||
endif # cross-m68k-linux
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### sparc-sun-solaris2.8
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),sparc-sun-solaris)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### Atari cross compilers
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),cross-mint)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .ttp
|
|
||||||
CC = m68k-atari-mint-gcc
|
|
||||||
CXX = m68k-atari-mint-g++
|
|
||||||
CCARCH += -m68000
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),cross-mint-m68040)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .ttp
|
|
||||||
CC = m68k-atari-mint-gcc
|
|
||||||
CXX = m68k-atari-mint-g++
|
|
||||||
CCARCH += -m68040
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),cross-mint-m68020-60)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .ttp
|
|
||||||
CC = m68k-atari-mint-gcc
|
|
||||||
CXX = m68k-atari-mint-g++
|
|
||||||
CCARCH += -m68020-60 -m68881
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### dos32 - djgpp2 / emx
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),dos32-djgpp2)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CXX = gxx
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
CFLAGS_WERROR = -Werror
|
|
||||||
STUBEDIT_EXE = stubedit $@ bufsize=0xfc00
|
|
||||||
ifneq ($(strip $(wildcard $(DJDIR)/bin/mfxdjstubify.ex[eE])),)
|
|
||||||
ifneq ($(strip $(wildcard $(DJDIR)/bin/cwsdstub.ex[eE])),)
|
|
||||||
STUBIFY_EXE = mfxdjstubify -v -s $(DJDIR)/bin/cwsdstub.exe $@
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),dos32-emx)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CXX = gcc
|
|
||||||
CFLAGS_O = -O2
|
|
||||||
CCARCH += -mno-probe
|
|
||||||
LDFLAGS = -L. -s
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - cygwin / mingw32 / rsxnt
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-cygwin)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
##CXX = g++-2
|
|
||||||
e = .exe
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
LDLIBS += -lwinmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(target),win32-mingw32)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
LDLIBS += -lwinmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
# mingw32 cross compiler
|
|
||||||
ifeq ($(target),cross-mingw32)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CC = i586-mingw32msvc-gcc
|
|
||||||
CXX = i586-mingw32msvc-g++
|
|
||||||
CCARCH += -march=i386 -mcpu=i686
|
|
||||||
LDLIBS += -lwinmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
# rsxnt (g++ 2.8.1)
|
|
||||||
ifeq ($(target),win32-rsxnt)
|
|
||||||
include $(srcdir)/Makedefs.gcc
|
|
||||||
e = .exe
|
|
||||||
CXX = gcc
|
|
||||||
CFLAGS_O = -O2
|
|
||||||
CCARCH += -Zwin32 -Zsys -mno-probe
|
|
||||||
LDFLAGS = -L. -s
|
|
||||||
STUBEDIT_EXE = pestack -s1024 -c1024 $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Borland C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-bc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = bcc32 -3
|
|
||||||
ifeq ($(UPX_BROKEN_INCLUDES),1)
|
|
||||||
ifneq ($(srcdir),.)
|
|
||||||
INCLUDES += -I$(srcdir)
|
|
||||||
endif
|
|
||||||
INCLUDES += -I$(srcdir)/acc
|
|
||||||
ifneq ($(strip $(wildcard $(srcdir)/filter)),)
|
|
||||||
INCLUDES += -I$(srcdir)/filter
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
CFLAGS = -w -w-inl -g1
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS = -ls
|
|
||||||
LINK_EXE_OUTPUT = -e$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -d
|
|
||||||
else
|
|
||||||
CFLAGS += -O2 -d
|
|
||||||
endif
|
|
||||||
endif # win32-bc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Digital Mars C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-dm)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = dmc -mn
|
|
||||||
CFLAGS = -w- -wx
|
|
||||||
CXXFLAGS = $(CFLAGS) -Aa -Ab -Ae -Ar
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS = -L/map
|
|
||||||
LINK_EXE_OUTPUT = -o$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -o- -g -s
|
|
||||||
else
|
|
||||||
CFLAGS += -o
|
|
||||||
endif
|
|
||||||
endif # win32-dm
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Intel C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-ic)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = icl -nologo
|
|
||||||
CFLAGS = -W3 -WX
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,2)
|
|
||||||
# statically link libcmt.lib
|
|
||||||
CC += -MT
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win32-ic
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Metrowerks C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-mwerks)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = mwcc -gccinc
|
|
||||||
CFLAGS = -w on
|
|
||||||
CXXFLAGS = $(CFLAGS)
|
|
||||||
CFLAGS_OUTPUT = -o $@
|
|
||||||
LDFLAGS = -lwinmm.lib -map $T.map
|
|
||||||
LINK_EXE_OUTPUT = -o $@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -opt full
|
|
||||||
else
|
|
||||||
CFLAGS +=
|
|
||||||
endif
|
|
||||||
endif # win32-mwerks
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Symantec C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-sc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = sc -mn
|
|
||||||
CFLAGS = -w- -wx
|
|
||||||
CXXFLAGS = $(CFLAGS) -EH -ER
|
|
||||||
CFLAGS_OUTPUT = -o$@
|
|
||||||
LDFLAGS = -L/map
|
|
||||||
LINK_EXE_OUTPUT = -o$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -o- -g -s
|
|
||||||
else
|
|
||||||
CFLAGS += -o
|
|
||||||
endif
|
|
||||||
endif # win32-sc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Visual C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-vc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = cl -nologo
|
|
||||||
CFLAGS = -W4 -WX
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,1)
|
|
||||||
# statically link libcmt.lib
|
|
||||||
CC += -MT
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
##LINK_EXE_LDFLAGS += /opt:nowin98
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win32-vc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win32 - Watcom C++
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win32-wc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = wcl386 -zq -bt=nt -mf -5r
|
|
||||||
##CC = wcl386 -zq -bt=dos -l=CauseWay -mf -5r
|
|
||||||
CFLAGS = -zc -w5 -we
|
|
||||||
CXXFLAGS = $(CFLAGS) -xs -xr
|
|
||||||
CFLAGS_OUTPUT = -fo=$@
|
|
||||||
LDFLAGS = -k0x100000 -fm
|
|
||||||
LINK_EXE_OUTPUT = -fe=$@
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
CC_SRC = $(subst /,\\,$<)
|
|
||||||
CXX_SRC = $(subst /,\\,$<)
|
|
||||||
INCLUDES := $(strip $(subst /,\\,$(INCLUDES)))
|
|
||||||
ifeq (1,2)
|
|
||||||
WCL386 := $(INCLUDES)
|
|
||||||
export WCL386
|
|
||||||
INCLUDES :=
|
|
||||||
endif
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS +=
|
|
||||||
else
|
|
||||||
# note: it seems that the optimizer is generating bad code with `-ox'
|
|
||||||
CFLAGS += -olr
|
|
||||||
endif
|
|
||||||
endif # win32-wc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win64 - Intel C++ [Itanium]
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win64-ic)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = ecl -nologo
|
|
||||||
CFLAGS = -W3
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,2)
|
|
||||||
# statically link libcmt.lib
|
|
||||||
CC += -MT
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win64-ic
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
### win64 - Visual C++ [AMD64 or Itanium]
|
|
||||||
###
|
|
||||||
|
|
||||||
ifeq ($(target),win64-vc)
|
|
||||||
o = .obj
|
|
||||||
a = .lib
|
|
||||||
e = .exe
|
|
||||||
CC = cl -nologo
|
|
||||||
CFLAGS = -W4 -Wall
|
|
||||||
CXXFLAGS = $(CFLAGS) -EHac -GR
|
|
||||||
LDFLAGS =
|
|
||||||
LINK_EXE_OUTPUT = -Fe$@
|
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
|
||||||
ifeq (1,1)
|
|
||||||
# statically link libcmt.lib
|
|
||||||
CC += -MT
|
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
|
||||||
else
|
|
||||||
# link against msvcrt.dll
|
|
||||||
CC += -MD
|
|
||||||
endif
|
|
||||||
LDLIBS = $(DOS_LDLIBS)
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -Od -ZI
|
|
||||||
LINK_EXE_LDFLAGS += /debug
|
|
||||||
else
|
|
||||||
CFLAGS += -O1 -GF
|
|
||||||
LINK_EXE_LDFLAGS += /release
|
|
||||||
endif
|
|
||||||
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
|
|
||||||
endif # win64-vc
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // malloc debuggers and memory checkers - obsolete, use valgrind
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
# compile in extra valgrind support
|
|
||||||
DEFS += -DWITH_VALGRIND
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
LDLIBS += -lefence
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
DEFS += -DWITH_DMALLOC
|
|
||||||
LDLIBS += -ldmalloc
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (1,2)
|
|
||||||
DEFS += -DWITH_GC -DLINUX_THREADS -D_REENTRANT
|
|
||||||
LDLIBS += -lgc -lpthread
|
|
||||||
# only needed when using -static:
|
|
||||||
##LDFLAGS += -Wl,-defsym,_DYNAMIC=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // main targets
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
-include ./Makefile.local
|
|
||||||
|
|
||||||
all: $(upx_exe)
|
|
||||||
|
|
||||||
$(upx_exe): $(OBJECTS) $(LIBS) $(RESOURCES)
|
|
||||||
$(strip $(CXX_LINK_EXE))
|
|
||||||
$(strip $(STUBEDIT_EXE))
|
|
||||||
$(strip $(STUBIFY_EXE))
|
|
||||||
$(strip $(CHMOD_EXE))
|
|
||||||
|
|
||||||
mostlyclean:
|
|
||||||
-rm -f *.d *.err *.i *.log *.map gdb-trans*
|
|
||||||
|
|
||||||
clean: mostlyclean
|
|
||||||
-rm -f *.a *.lib *.o *.obj *.res *.tds tags TAGS ID
|
|
||||||
-rm -f *.idb *.pdb
|
|
||||||
-rm -f $(upx_exe) upx upx.exe upx.ttp upx_nrv upx_nrv.exe upx_nrv.ttp upx_ucl upx_ucl.exe upx_ucl.ttp
|
|
||||||
-rm -rf .deps _deps
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
|
|
||||||
maintainer-clean: distclean
|
|
||||||
|
|
||||||
.PHONY: all mostlyclean clean distclean maintainer-clean
|
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
|
||||||
# // rules
|
|
||||||
# ************************************************************************/
|
|
||||||
|
|
||||||
%$o : %.c
|
|
||||||
$(strip $(CC_COMPILE))
|
|
||||||
|
|
||||||
%$o : %.cpp
|
|
||||||
$(strip $(CXX_COMPILE))
|
|
||||||
|
|
||||||
%.res : %.rc
|
|
||||||
rc -l 0x409 -fo$@ $<
|
|
||||||
|
|
||||||
|
|
||||||
# vi:nowrap
|
|
||||||
+1
-1
@@ -146,7 +146,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#if !defined(WITH_UCL)
|
#if !defined(WITH_UCL)
|
||||||
# error "please set UCLDIR in the Makefile"
|
# define WITH_UCL 1
|
||||||
#endif
|
#endif
|
||||||
#if defined(WITH_UCL)
|
#if defined(WITH_UCL)
|
||||||
# include <ucl/uclconf.h>
|
# include <ucl/uclconf.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user