-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (74 loc) · 3.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# $Id$
#
# Package openMSX and Catapult together in an NSIS installer
# =========================================================
# Default target; make sure this is always the first target in this Makefile.
MAKECMDGOALS?=default
default: all
# Check if the stuff is in a different directory
OPENMSX_PATH?=../openMSX
CATAPULT_PATH?=../wxCatapult
# Python Interpreter
# ==================
# We need Python from the 2.x series, version 2.5 or higher.
# Usually this executable is available as just "python", but on some systems
# you might have to be more specific, for example "python2" or "python2.6".
# Or if the Python interpreter is not in the search path, you can specify its
# full path.
PYTHON?=python
# Name of the installer
VERSIONED_PACKAGE_NAME:=$(shell cd $(OPENMSX_PATH); PYTHONPATH=$(OPENMSX_PATH)/build $(PYTHON) -c \
"import version; print version.getVersionedPackageName()" \
)
PACKAGE_FULL=$(VERSIONED_PACKAGE_NAME)-win32-bin.exe
# Make this flavour for the package
export OPENMSX_FLAVOUR:=i686
export CATAPULT_FLAVOUR:=i686
# Name of the installer script
INSTALLER_SCRIPT=win32_installer.nsi
# Base Directories
# ================
# All created files will be inside this directory
BUILD_BASE:=derived
# All distribution files will be inside this directory
DIST_PATH=$(BUILD_BASE)/dist
FULL_DIST_PATH=$$PWD/$(DIST_PATH)
SED_DIST_PATH=$(subst /,\/,$(DIST_PATH))
# Build Rules
# ==========
all: openmsx catapult findnsis.exe w32_package
.PHONY: openmsx catapult w32_package
openmsx:
@echo "Setting up files for openMSX"
@echo " Making static build..."
@make -C $(OPENMSX_PATH) staticbindist OPENMSX_FLAVOUR=$(OPENMSX_FLAVOUR)
@echo " Copying results to target directory..."
@mkdir -p $(FULL_DIST_PATH)
@cp -Rf $(OPENMSX_PATH)/derived/x86-mingw32-$(OPENMSX_FLAVOUR)-3rd/bindist/install/* $(FULL_DIST_PATH)
@echo " Copy ico version of icon to target directory..."
@cp $(OPENMSX_PATH)/src/resource/openmsx.ico $(FULL_DIST_PATH)/share/icons
catapult:
@echo "Setting up files for Catapult"
@echo " Making build..."
@CATAPULT_INSTALL=$(FULL_DIST_PATH)/Catapult make -C $(CATAPULT_PATH) install
findnsis.exe: findnsis.cc
@g++ $^ -o $(BUILD_BASE)/$@
NSIS_INSTALLER_PATH=`$(BUILD_BASE)/findnsis`
NSIS_INSTALLER="$(NSIS_INSTALLER_PATH)\makensis.exe"
w32_package:
@rm -rf $(FULL_DIST_PATH)/bin
ifeq ($(ADDFILES_PATH),)
@$(error Please set the ADDFILES_PATH environment variable)
endif
# copy the addfiles stuff
@cp -Rf $(ADDFILES_PATH)/* $(FULL_DIST_PATH)
# copy the codec to the target dir, without svn admin stuff (reuse openMSX script)
@$(shell PYTHONPATH=$(OPENMSX_PATH)/build $(PYTHON) install-recursive.py $(BUILD_BASE)/../ $(BUILD_BASE)/../codec $(FULL_DIST_PATH))
@find $(DIST_PATH) -name "*" -type f | sed -e 's/$(SED_DIST_PATH)\//Delete $$INSTDIR\\/' -e \
's/\//\\/g' > $(BUILD_BASE)/RemoveFileList.nsh
@find $(DIST_PATH) -name "*" -type d | sort -r | sed -e 's/$(SED_DIST_PATH)\//RMDir $$INSTDIR\\/' \
-e '$$d' -e 's/\//\\/g' >> $(BUILD_BASE)/RemoveFileList.nsh
@cp -f win32_installer.nsi $(BUILD_BASE)
@cp -f integrate.ini $(BUILD_BASE)
@echo "Creating installer: $(PACKAGE_FULL)"
@$(NSIS_INSTALLER) //V2 "//XOutFile $(PACKAGE_FULL)" $(BUILD_BASE)/$(INSTALLER_SCRIPT)