summaryrefslogtreecommitdiff
path: root/erts/start_scripts/Makefile
blob: 4df756848444ce26d08ad8e53d23f1bf741b097f (plain)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1997-2010. 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

# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------

SS_ROOT = $(ERL_TOP)/erts/start_scripts
SS_TMP = $(SS_ROOT)/tmp
LIBPATH= $(ERL_TOP)/lib
SCRIPT_PATH = -I$(LIBPATH)/kernel/ebin -I$(LIBPATH)/stdlib/ebin -I$(LIBPATH)/sasl/ebin
BOOTSTRAP_LIBPATH=$(BOOTSTRAP_TOP)/lib
BOOTSTRAP_SCRIPT_PATH = -I$(BOOTSTRAP_LIBPATH)/kernel/ebin -I$(BOOTSTRAP_LIBPATH)/stdlib/ebin

INSTALL_SCRIPTS = \
	$(SS_ROOT)/start_clean.script \
	$(SS_ROOT)/start_clean.boot \
	$(SS_ROOT)/start_sasl.boot \
	$(SS_ROOT)/start_sasl.script

REL_SCRIPTS = \
	$(SS_ROOT)/start_clean.rel \
	$(SS_ROOT)/start_sasl.rel \
	$(SS_ROOT)/start_all_example.rel

ifneq ($(findstring win32,$(TARGET)),win32)
RELEASES_SRC = RELEASES.src
endif

##############################################################################
# Get version numbers from the VSN files

# VSN & SYSTEM_VSN
include ../vsn.mk
include $(LIBPATH)/kernel/vsn.mk
include $(LIBPATH)/stdlib/vsn.mk
-include $(LIBPATH)/sasl/vsn.mk
-include $(LIBPATH)/os_mon/vsn.mk
-include $(LIBPATH)/mnesia/vsn.mk
-include $(LIBPATH)/snmp/vsn.mk
-include $(LIBPATH)/inets/vsn.mk

##############################################################################

debug opt script: rel $(INSTALL_SCRIPTS) $(RELEASES_SRC)

rel:	$(REL_SCRIPTS)

RELEASES.src:
	$(INSTALL_DIR) $(SS_TMP)
	( cd $(SS_TMP) && \
	$(ERL) -noinput +B -eval 'release_handler:create_RELEASES("%ERL_ROOT%", "$(SS_ROOT)", "$(SS_ROOT)/start_sasl.rel", []), halt()')
	mv RELEASES RELEASES.src

$(SS_ROOT)/start_clean.script \
$(SS_ROOT)/start_clean.boot:	$(SS_ROOT)/start_clean.rel
	$(INSTALL_DIR) $(SS_TMP)
	( cd $(SS_TMP) && \
	$(ERLC) $(SASL_FLAGS) $(SCRIPT_PATH) -o $(SS_ROOT) $< )

$(SS_ROOT)/start_sasl.script \
$(SS_ROOT)/start_sasl.boot:	$(SS_ROOT)/start_sasl.rel
	$(INSTALL_DIR) $(SS_TMP)
	( cd $(SS_TMP) && \
	$(ERLC) $(SASL_FLAGS) $(SCRIPT_PATH) -o $(SS_ROOT) $< )

$(SS_ROOT)/start_clean.rel: $(SS_ROOT)/start_clean.rel.src \
			../vsn.mk \
			$(LIBPATH)/kernel/vsn.mk \
			$(LIBPATH)/stdlib/vsn.mk
	sed -e 's;%SYS_VSN%;$(SYSTEM_VSN);' \
            -e 's;%ERTS_VSN%;$(VSN);' \
            -e 's;%KERNEL_VSN%;$(KERNEL_VSN);' \
            -e 's;%STDLIB_VSN%;$(STDLIB_VSN);' \
          $(SS_ROOT)/start_clean.rel.src > $(SS_ROOT)/start_clean.rel

$(SS_ROOT)/start_sasl.rel:	$(SS_ROOT)/start_sasl.rel.src \
			../vsn.mk \
			$(LIBPATH)/kernel/vsn.mk \
			$(LIBPATH)/stdlib/vsn.mk \
			$(LIBPATH)/sasl/vsn.mk
	sed -e 's;%SYS_VSN%;$(SYSTEM_VSN);' \
            -e 's;%ERTS_VSN%;$(VSN);' \
            -e 's;%KERNEL_VSN%;$(KERNEL_VSN);' \
            -e 's;%STDLIB_VSN%;$(STDLIB_VSN);' \
            -e 's;%SASL_VSN%;$(SASL_VSN);' \
          $(SS_ROOT)/start_sasl.rel.src > $(SS_ROOT)/start_sasl.rel

$(SS_ROOT)/start_all_example.rel:	$(SS_ROOT)/start_all_example.rel.src \
			../vsn.mk \
			$(LIBPATH)/kernel/vsn.mk \
			$(LIBPATH)/stdlib/vsn.mk \
			$(LIBPATH)/sasl/vsn.mk \
			$(LIBPATH)/os_mon/vsn.mk \
			$(LIBPATH)/mnesia/vsn.mk \
			$(LIBPATH)/snmp/vsn.mk \
			$(LIBPATH)/inets/vsn.mk
	sed -e 's;%SYS_VSN%;$(SYSTEM_VSN);' \
            -e 's;%ERTS_VSN%;$(VSN);' \
            -e 's;%KERNEL_VSN%;$(KERNEL_VSN);' \
            -e 's;%STDLIB_VSN%;$(STDLIB_VSN);' \
            -e 's;%SASL_VSN%;$(SASL_VSN);' \
            -e 's;%OS_MON_VSN%;$(OS_MON_VSN);' \
            -e 's;%MNESIA_VSN%;$(MNESIA_VSN);' \
            -e 's;%SNMP_VSN%;$(SNMPEA_VSN);' \
            -e 's;%INETS_VSN%;$(INETS_VSN);' \
          $(SS_ROOT)/start_all_example.rel.src > $(SS_ROOT)/start_all_example.rel

## Special target used from $(ERL_TOP)/erts/Makefile.
$(ERL_TOP)/bin/start.script:
	$(INSTALL_DIR) $(SS_TMP)
	( cd $(SS_TMP) && \
	  $(ERLC) $(SCRIPT_PATH) +otp_build -o $@ $(SS_ROOT)/start_clean.rel )

$(ERL_TOP)/bin/start_sasl.script:
	$(INSTALL_DIR) $(SS_TMP)
	( cd $(SS_TMP) && \
	  $(ERLC) $(SCRIPT_PATH) +otp_build -o $@ $(SS_ROOT)/start_sasl.rel )

$(ERL_TOP)/bin/start_clean.script:
	$(INSTALL_DIR) $(SS_TMP)
	( cd $(SS_TMP) && \
	  $(ERLC) $(SCRIPT_PATH) +otp_build -o $@ $(SS_ROOT)/start_clean.rel )

## Special target used from system/build/Makefile for source code release bootstrap.
bootstrap_scripts: $(SS_ROOT)/start_clean.rel
	$(INSTALL_DIR) $(TESTROOT)/bin
	$(INSTALL_DIR) $(SS_TMP)
	( cd $(SS_TMP) && \
	  $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +otp_build +no_module_tests \
	    -o $(TESTROOT)/bin/start.script $(SS_ROOT)/start_clean.rel )
	( cd $(SS_TMP) && \
	  $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +otp_build +no_module_tests \
	    -o $(TESTROOT)/bin/start_clean.script $(SS_ROOT)/start_clean.rel )

clean:
	$(RM) $(REL_SCRIPTS) $(INSTALL_SCRIPTS)

docs:


# ----------------------------------------------------
# Release Target
# ---------------------------------------------------- 
include $(ERL_TOP)/make/otp_release_targets.mk

release_spec: script
	$(INSTALL_DIR) $(RELEASE_PATH)/releases/$(SYSTEM_VSN)
ifneq ($(findstring win32,$(TARGET)),win32)
	$(INSTALL_DATA) RELEASES.src $(RELEASE_PATH)/releases
endif
	$(INSTALL_DATA) $(INSTALL_SCRIPTS) $(REL_SCRIPTS) \
	   $(RELEASE_PATH)/releases/$(SYSTEM_VSN)
	$(INSTALL_DATA) start_clean.script $(RELEASE_PATH)/releases/$(SYSTEM_VSN)/start.script
	$(INSTALL_DATA) start_clean.boot $(RELEASE_PATH)/releases/$(SYSTEM_VSN)/start.boot


release_docs_spec:

TRUE: