aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/win32/nsis/Makefile
blob: a53ac708f80eb2847af59e26fbbedc0da63f8bf8 (plain) (blame)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# 
# %CopyrightBegin%
# 
# Copyright Ericsson AB 2003-2012. All Rights Reserved.
# 
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
# 
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
# 
# %CopyrightEnd%
# 

include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
include $(ERL_TOP)/erts/vsn.mk

VERSION_HEADER = erlang.nsh
MAKENSIS = makensis
MAKENSISFLAGS = /V2
CUSTOM_MODERN=custom_modern.exe

# This is not the way we usually do in our makefiles, 
# but making release is the ONLY thing we do with this one,
# Its not called during ordinary recursive make.
all: release

opt debug depend:
	@echo Nothing to do for "'"$@"'" on $(TARGET)

clean:
	rm -f $(VERSION_HEADER)

include $(ERL_TOP)/make/otp_release_targets.mk

TARGET_DIR = $(RELEASE_PATH)

ifeq ($(MSYSTEM),MINGW32)

  MAKENSISFLAGS = //V2
  WTESTROOT=$(shell (msys2win_path.sh "$(RELEASE_PATH)"))
  WTARGET_DIR=$(shell (msys2win_path.sh "$(TARGET_DIR)"))

else

  MAKENSISFLAGS = /V2
  WTESTROOT=$(shell (cygpath -d "$(RELEASE_PATH)" 2>/dev/null || cygpath -w "$(RELEASE_PATH)"))
  WTARGET_DIR=$(shell (cygpath -d "$(TARGET_DIR)" 2>/dev/null || cygpath -d "$(TARGET_DIR)"))

endif

ifeq ($(CONFIG_SUBTYPE),win64)
  WINTYPE=win64
else
  WINTYPE=win32
endif

REDIST_FILE=$(shell (sh ./find_redist.sh || echo ""))
REDIST_TARGET=$(shell (sh ./find_redist.sh -n || echo ""))
REDIST_DLL_VERSION=$(shell (sh ./dll_version_helper.sh || echo ""))
REDIST_DLL_NAME=$(shell (sh ./dll_version_helper.sh -n || echo ""))

release_spec:
	@NSIS_VER=`makensis /hdrinfo | head -1 | awk '{print $$2}'`; \
	case $$NSIS_VER in \
	v2.0b*) \
	  echo '!define MUI_VERSION "$(SYSTEM_VSN)"' > $(VERSION_HEADER);\
	  echo '!define ERTS_VERSION "$(VSN)"' >> $(VERSION_HEADER);\
	  echo '!define TESTROOT "$(WTESTROOT)"' >> $(VERSION_HEADER);\
	  echo '!define OUTFILEDIR "$(WTARGET_DIR)"' >> $(VERSION_HEADER);\
	  if [ -f "$(RELEASE_PATH)/docs/doc/index.html" ];\
	  then\
		echo '!define HAVE_DOCS 1' >> $(VERSION_HEADER); \
	  fi;\
	  $(MAKENSIS) erlang.nsi;;\
	v2.*) \
	  echo '!define OTP_VERSION "$(SYSTEM_VSN)"' > $(VERSION_HEADER);\
	  echo '!define ERTS_VERSION "$(VSN)"' >> $(VERSION_HEADER);\
	  echo '!define TESTROOT "$(WTESTROOT)"' >> $(VERSION_HEADER);\
	  echo '!define OUTFILEDIR "$(WTARGET_DIR)"' >> $(VERSION_HEADER);\
	  echo '!define WINTYPE "$(WINTYPE)"' >> $(VERSION_HEADER);\
	  if [ -f $(CUSTOM_MODERN) ];\
	  then \
		echo '!define HAVE_CUSTOM_MODERN 1' >> $(VERSION_HEADER); \
	  fi;\
	  if [ '!' -z "$(REDIST_FILE)" -a '!' -z "$(REDIST_DLL_VERSION)" ];\
	  then \
		cp $(REDIST_FILE) "$(RELEASE_PATH)/$(REDIST_TARGET)";\
		echo '!define HAVE_REDIST_FILE 1'  >> $(VERSION_HEADER); \
		echo '!define REDIST_DLL_VERSION "$(REDIST_DLL_VERSION)"' >> $(VERSION_HEADER);\
		echo '!define REDIST_DLL_NAME "$(REDIST_DLL_NAME)"' >> $(VERSION_HEADER);\
		echo '!define REDIST_EXECUTABLE "$(REDIST_TARGET)"' >> $(VERSION_HEADER);\
	  fi;\
	  if [ -f "$(RELEASE_PATH)/docs/doc/index.html" ];\
	  then \
		echo '!define HAVE_DOCS 1' >> $(VERSION_HEADER); \
	  fi;\
	  echo "Running $(MAKENSIS) $(MAKENSISFLAGS) erlang20.nsi";\
	  $(MAKENSIS) $(MAKENSISFLAGS) erlang20.nsi;;\
	*) \
	  echo 'Unsupported NSIS version';;\
	esac	

release_docs release_docs_spec docs: