Makefile update.
This commit is contained in:
+1
-4
@@ -69,7 +69,7 @@ Tools needed to build/modify the UPX sources
|
|||||||
- A C++ compiler supporting inner classes, templates, exceptions
|
- A C++ compiler supporting inner classes, templates, exceptions
|
||||||
and RTTI.
|
and RTTI.
|
||||||
|
|
||||||
- GNU make 3.80 or better (GNU make 3.81 recommened).
|
- GNU make 3.81 or better
|
||||||
|
|
||||||
|
|
||||||
To compile the packer sources
|
To compile the packer sources
|
||||||
@@ -94,9 +94,6 @@ To compile the packer sources
|
|||||||
If you want to modify the stub sources you'll also need
|
If you want to modify the stub sources you'll also need
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
- GNU make 3.81 or better
|
|
||||||
http://savannah.gnu.org/projects/make/
|
|
||||||
|
|
||||||
- Perl & Python
|
- Perl & Python
|
||||||
|
|
||||||
- A number of cross-assemblers and cross-compilers - precompiled
|
- A number of cross-assemblers and cross-compilers - precompiled
|
||||||
|
|||||||
@@ -38,34 +38,31 @@ __minienv_varlist = $(foreach v,$1,$(if $($v),$v))
|
|||||||
# enumerate the names of all environment variables
|
# enumerate the names of all environment variables
|
||||||
__minienv_expand = $(foreach v,$(call __minienv_varlist,$1),$v='$($v)')
|
__minienv_expand = $(foreach v,$(call __minienv_varlist,$1),$v='$($v)')
|
||||||
|
|
||||||
|
ifndef DOSBOX_EXE
|
||||||
|
DOSBOX_EXE := $(shell which dosbox 2>/dev/null)
|
||||||
|
endif
|
||||||
|
ifdef DOSBOX_EXE
|
||||||
ifndef DOSBOX
|
ifndef DOSBOX
|
||||||
DOSBOX := $(shell which dosbox 2>/dev/null)
|
DOSBOX = $(DOSBOX_EXE)
|
||||||
endif
|
DOSBOX = /usr/bin/time -p $(DOSBOX_EXE) -exit
|
||||||
ifdef DOSBOX
|
|
||||||
ifndef RUN_DOSBOX
|
|
||||||
RUN_DOSBOX = $(DOSBOX)
|
|
||||||
RUN_DOSBOX = /usr/bin/time -p $(DOSBOX) -exit
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef WINE
|
ifndef WINE_EXE
|
||||||
WINE := $(shell which wine 2>/dev/null)
|
WINE_EXE := $(shell which wine 2>/dev/null)
|
||||||
endif
|
endif
|
||||||
ifdef WINE
|
ifndef WINEPATH_EXE
|
||||||
ifndef WINEPATH
|
WINEPATH_EXE:= $(shell which winepath 2>/dev/null)
|
||||||
WINEPATH := $(shell which winepath 2>/dev/null)
|
|
||||||
endif
|
endif
|
||||||
endif
|
ifdef WINE_EXE
|
||||||
|
|
||||||
ifdef WINE
|
|
||||||
##WINEENV = @env
|
##WINEENV = @env
|
||||||
WINEENV = @env -i $(call __minienv_expand,DISPLAY HOME LANG LC_ALL PATH USER TERM WINEPREFIX)
|
WINEENV = @env -i $(call __minienv_expand,DISPLAY HOME LANG LC_ALL PATH USER TERM WINEDEBUG WINEPATH WINEPREFIX)
|
||||||
ifdef WINEPREFIX
|
ifdef WINEPREFIX
|
||||||
winedir_s = z:$(shell WINEPREFIX='$(WINEPREFIX)' $(WINEPATH) -s '$(realpath $1)')
|
winedir_s = z:$(shell WINEPREFIX='$(WINEPREFIX)' $(WINEPATH_EXE) -s '$(realpath $1)')
|
||||||
winedir_w = $(shell WINEPREFIX='$(WINEPREFIX)' $(WINEPATH) -w '$(realpath $1)')
|
winedir_w = $(shell WINEPREFIX='$(WINEPREFIX)' $(WINEPATH_EXE) -w '$(realpath $1)')
|
||||||
else
|
else
|
||||||
winedir_s = z:$(shell $(WINEPATH) -s '$(realpath $1)')
|
winedir_s = z:$(shell $(WINEPATH_EXE) -s '$(realpath $1)')
|
||||||
winedir_w = $(shell $(WINEPATH) -w '$(realpath $1)')
|
winedir_w = $(shell $(WINEPATH_EXE) -w '$(realpath $1)')
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
WINEENV = false 'WINEENV'
|
WINEENV = false 'WINEENV'
|
||||||
@@ -143,10 +140,10 @@ $c += -I$(UPX_LZMADIR)
|
|||||||
$c += -I$(top_srcdir)/src
|
$c += -I$(top_srcdir)/src
|
||||||
|
|
||||||
# Borland C/C++ 5.02
|
# Borland C/C++ 5.02
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
||||||
c := tc.method-lzma.bcc
|
c := tc.method-lzma.bcc
|
||||||
$c = $(WINEENV) $(WINE) cmd.exe /c tmp/bcc.bat
|
$c = $(WINEENV) $(WINE_EXE) cmd.exe /c tmp/bcc.bat
|
||||||
$c += -ms
|
$c += -ms
|
||||||
$c += -O1 -1
|
$c += -O1 -1
|
||||||
$c += -w
|
$c += -w
|
||||||
@@ -156,10 +153,10 @@ endif
|
|||||||
|
|
||||||
# Digital Mars C/C++ 8.49
|
# Digital Mars C/C++ 8.49
|
||||||
# http://www.digitalmars.com/download/freecompiler.html
|
# http://www.digitalmars.com/download/freecompiler.html
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
||||||
c := tc.method-lzma.dmc
|
c := tc.method-lzma.dmc
|
||||||
$c = $(WINEENV) $(WINE) cmd.exe /c tmp/dmc.bat
|
$c = $(WINEENV) $(WINE_EXE) cmd.exe /c tmp/dmc.bat
|
||||||
$c += -ms -R
|
$c += -ms -R
|
||||||
$c += -NS
|
$c += -NS
|
||||||
$c += -w- -w7 -r
|
$c += -w- -w7 -r
|
||||||
@@ -171,7 +168,7 @@ endif
|
|||||||
# Visual C/C++ 1.52 (8.00c)
|
# Visual C/C++ 1.52 (8.00c)
|
||||||
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
||||||
c := tc.method-lzma.cl
|
c := tc.method-lzma.cl
|
||||||
$c = $(WINEENV) $(WINE) cmd.exe /c tmp/cl.bat
|
$c = $(WINEENV) $(WINE_EXE) cmd.exe /c tmp/cl.bat
|
||||||
$c += -nologo
|
$c += -nologo
|
||||||
$c += -AS -Gd
|
$c += -AS -Gd
|
||||||
$c += -Gy
|
$c += -Gy
|
||||||
@@ -213,19 +210,19 @@ tmp/lzma_d_c%.i : tmp/lzma_d_c%.S $(MAKEFILE_LIST)
|
|||||||
tmp/lzma_d_c%.S : lzma_d_c.c wdis2gas.py $(MAKEFILE_LIST) $(TMP_DEPS)
|
tmp/lzma_d_c%.S : lzma_d_c.c wdis2gas.py $(MAKEFILE_LIST) $(TMP_DEPS)
|
||||||
rm -f tmp/$T*.i tmp/$T*.o tmp/$T*.obj tmp/$T*.S
|
rm -f tmp/$T*.i tmp/$T*.o tmp/$T*.obj tmp/$T*.S
|
||||||
# compile
|
# compile
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
||||||
## $(call tc,bcc) $(PP_FLAGS) -c -otmp/$T_bc.obj $<
|
## $(call tc,bcc) $(PP_FLAGS) -c -otmp/$T_bc.obj $<
|
||||||
## $(call tc,wdis) tmp/$T_bc.obj | $(RTRIM) > tmp/$T_bc.obj.disasm
|
## $(call tc,wdis) tmp/$T_bc.obj | $(RTRIM) > tmp/$T_bc.obj.disasm
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
||||||
$(call tc,dmc) $(PP_FLAGS) -c -otmp/$T_dm.obj $<
|
$(call tc,dmc) $(PP_FLAGS) -c -otmp/$T_dm.obj $<
|
||||||
$(call tc,wdis) tmp/$T_dm.obj | $(RTRIM) > tmp/$T_dm.obj.disasm
|
$(call tc,wdis) tmp/$T_dm.obj | $(RTRIM) > tmp/$T_dm.obj.disasm
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
||||||
$(call tc,cl) $(PP_FLAGS) -c -Fotmp/$T_vc.obj $<
|
$(call tc,cl) $(PP_FLAGS) -c -Fotmp/$T_vc.obj $<
|
||||||
$(call tc,wdis) tmp/$T_vc.obj | $(RTRIM) > tmp/$T_vc.obj.disasm
|
$(call tc,wdis) tmp/$T_vc.obj | $(RTRIM) > tmp/$T_vc.obj.disasm
|
||||||
@@ -257,7 +254,7 @@ ifneq ($(wildcard $(WATCOM)/binl/wdis),)
|
|||||||
|
|
||||||
CC_TEST_DEPS = $(MAKEFILE_LIST) $(TMP_DEPS)
|
CC_TEST_DEPS = $(MAKEFILE_LIST) $(TMP_DEPS)
|
||||||
|
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
||||||
cc_test_bc : tc_list = method-lzma arch-i086 default
|
cc_test_bc : tc_list = method-lzma arch-i086 default
|
||||||
cc_test_bc: cc_test.c $(CC_TEST_DEPS)
|
cc_test_bc: cc_test.c $(CC_TEST_DEPS)
|
||||||
@@ -267,7 +264,7 @@ cc_test-all: cc_test_bc
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
||||||
cc_test_dm : tc_list = method-lzma arch-i086 default
|
cc_test_dm : tc_list = method-lzma arch-i086 default
|
||||||
cc_test_dm: cc_test.c $(CC_TEST_DEPS)
|
cc_test_dm: cc_test.c $(CC_TEST_DEPS)
|
||||||
@@ -277,7 +274,7 @@ cc_test-all: cc_test_dm
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
||||||
cc_test_vc : tc_list = method-lzma arch-i086 default
|
cc_test_vc : tc_list = method-lzma arch-i086 default
|
||||||
cc_test_vc: cc_test.c $(CC_TEST_DEPS)
|
cc_test_vc: cc_test.c $(CC_TEST_DEPS)
|
||||||
@@ -312,43 +309,43 @@ tmp/l_test_gcc_i386.out: l_test.c $(L_TEST_DEPS)
|
|||||||
./$@
|
./$@
|
||||||
l_test-all: tmp/l_test_gcc_i386.out
|
l_test-all: tmp/l_test_gcc_i386.out
|
||||||
|
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
ifneq ($(wildcard $(BC502DIR)/bin/bcc.exe),)
|
||||||
tmp/l_test_bc.% : tc_list = method-lzma arch-i086 default
|
tmp/l_test_bc.% : tc_list = method-lzma arch-i086 default
|
||||||
tmp/l_test_bc.exe: l_test.c $(L_TEST_DEPS)
|
tmp/l_test_bc.exe: l_test.c $(L_TEST_DEPS)
|
||||||
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
||||||
$(call tc,bcc) -o$(subst /,\\,$@) $<
|
$(call tc,bcc) -o$(subst /,\\,$@) $<
|
||||||
@rm -f l_test.o l_test.obj
|
@rm -f l_test.o l_test.obj
|
||||||
ifdef RUN_DOSBOX
|
ifdef DOSBOX
|
||||||
cp -p $@ tmp/test.exe && $(RUN_DOSBOX) tmp/test.exe
|
cp -p $@ tmp/test.exe && $(DOSBOX) tmp/test.exe
|
||||||
endif
|
endif
|
||||||
##l_test-all: tmp/l_test_bc.exe
|
##l_test-all: tmp/l_test_bc.exe
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
ifneq ($(wildcard $(DM849DIR)/bin/dmc.exe),)
|
||||||
tmp/l_test_dm.% : tc_list = method-lzma arch-i086 default
|
tmp/l_test_dm.% : tc_list = method-lzma arch-i086 default
|
||||||
tmp/l_test_dm.exe: l_test.c $(L_TEST_DEPS)
|
tmp/l_test_dm.exe: l_test.c $(L_TEST_DEPS)
|
||||||
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
||||||
$(call tc,dmc) -ml -o$(subst /,\\,$@) $<
|
$(call tc,dmc) -ml -o$(subst /,\\,$@) $<
|
||||||
@rm -f l_test.o l_test.obj
|
@rm -f l_test.o l_test.obj
|
||||||
ifdef RUN_DOSBOX
|
ifdef DOSBOX
|
||||||
cp -p $@ tmp/test.exe && $(RUN_DOSBOX) tmp/test.exe
|
cp -p $@ tmp/test.exe && $(DOSBOX) tmp/test.exe
|
||||||
endif
|
endif
|
||||||
l_test-all: tmp/l_test_dm.exe
|
l_test-all: tmp/l_test_dm.exe
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef WINE
|
ifdef WINE_EXE
|
||||||
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
ifneq ($(wildcard $(VC152DIR)/bin/cl.exe),)
|
||||||
tmp/l_test_vc.% : tc_list = method-lzma arch-i086 default
|
tmp/l_test_vc.% : tc_list = method-lzma arch-i086 default
|
||||||
tmp/l_test_vc.exe: l_test.c $(L_TEST_DEPS)
|
tmp/l_test_vc.exe: l_test.c $(L_TEST_DEPS)
|
||||||
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
||||||
$(call tc,cl) -Fe$(subst /,\\,$@) $<
|
$(call tc,cl) -Fe$(subst /,\\,$@) $<
|
||||||
@rm -f l_test.o l_test.obj
|
@rm -f l_test.o l_test.obj
|
||||||
ifdef RUN_DOSBOX
|
ifdef DOSBOX
|
||||||
cp -p $@ tmp/test.exe && $(RUN_DOSBOX) tmp/test.exe
|
cp -p $@ tmp/test.exe && $(DOSBOX) tmp/test.exe
|
||||||
endif
|
endif
|
||||||
l_test-all: tmp/l_test_vc.exe
|
l_test-all: tmp/l_test_vc.exe
|
||||||
endif
|
endif
|
||||||
@@ -360,8 +357,8 @@ tmp/l_test_wc.exe: l_test.c $(L_TEST_DEPS)
|
|||||||
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
@rm -f l_test.o l_test.obj tmp/test.exe $@
|
||||||
$(call tc,wcl) -fe=$@ $<
|
$(call tc,wcl) -fe=$@ $<
|
||||||
@rm -f l_test.o l_test.obj
|
@rm -f l_test.o l_test.obj
|
||||||
ifdef RUN_DOSBOX
|
ifdef DOSBOX
|
||||||
cp -p $@ tmp/test.exe && $(RUN_DOSBOX) tmp/test.exe
|
cp -p $@ tmp/test.exe && $(DOSBOX) tmp/test.exe
|
||||||
endif
|
endif
|
||||||
l_test-all: tmp/l_test_wc.exe
|
l_test-all: tmp/l_test_wc.exe
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user