1
#-*-makefile-*- ; force emacs to enter makefile-mode
5
# Copyright Ericsson AB 1997-2011. All Rights Reserved.
7
# The contents of this file are subject to the Erlang Public License,
8
# Version 1.1, (the "License"); you may not use this file except in
9
# compliance with the License. You should have received a copy of the
10
# Erlang Public License along with this software. If not, it can be
11
# retrieved online at http://www.erlang.org/.
13
# Software distributed under the License is distributed on an "AS IS"
14
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
# the License for the specific language governing rights and limitations
20
include $(ERL_TOP)/make/target.mk
21
include $(ERL_TOP)/make/$(TARGET)/otp.mk
24
# ----------------------------------------------------
26
# ----------------------------------------------------
32
# ----------------------------------------------------
33
# Configured variables
34
# ----------------------------------------------------
37
# ----------------------------------------------------
39
# ----------------------------------------------------
43
ERL_TARGETS = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
45
SYS_CONFIG_SRCS = $(SYS_CONFIG_FILES:%=%.src)
46
AGENT_CONFIG_SRCS = $(AGENT_CONFIG_FILES:%=%.src)
47
MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_FILES:%=%.src)
51
$(AGENT_CONFIG_FILES) \
52
$(MANAGER_CONFIG_FILES)
59
# ----------------------------------------------------
60
# Release directory specification
61
# ----------------------------------------------------
65
RELSYSDIR = $(TESTROOT)
68
# ----------------------------------------------------
70
# ----------------------------------------------------
74
ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \
75
+'{attribute,insert,app_vsn,$(APP_VSN)}'
78
ADDR = $(shell erl -noshell -s snmp_test_config ip_address -s init stop)
81
ifeq ($(TARGET_NAME_PRE),)
82
TARGET_NAME_PRE = $(shell erl -noshell -s snmp_test_config ip_address2 -s init stop)
85
ifeq ($(SYS_CONTACT),)
86
SYS_CONTACT = foo@bar.ericsson.se
89
ifeq ($(SYS_LOCATION),)
90
SYS_LOCATION = Erlang/OTP
97
ifeq ($(AGENT_ENGINE_ID),)
98
AGENT_ENGINE_ID = Agent engine of $(USER)
101
ifeq ($(AGENT_USM_ENGINE_ID),)
102
AGENT_USM_ENGINE_ID = $(AGENT_ENGINE_ID)
105
ifeq ($(MANAGER_ENGINE_ID),)
106
MANAGER_ENGINE_ID = Manager engine of $(USER)
109
ifeq ($(MANAGER_USM_ENGINE_ID),)
110
MANAGER_USM_ENGINE_ID = $(MANAGER_ENGINE_ID)
115
# ----------------------------------------------------
117
# ----------------------------------------------------
119
tests debug opt: $(TARGETS)
122
rm -f $(CONFIG_FILES)
128
%.config: %.config.src
130
$(PERL) -p -e 's?%DIR%?$(RELSYSDIR)? ' < $< > $@
132
agent/%.conf: agent/%.conf.src
134
sed -e 's?%ADDR%?$(ADDR)? ' \
135
-e 's?%SYS_CONTACT%?$(SYS_CONTACT)? ' \
136
-e 's?%SYS_LOCATION%?$(SYS_LOCATION)? ' \
137
-e 's?%SYS_NAME%?$(SYS_NAME)? ' \
138
-e 's?%TARGET_NAME_PRE%?$(TARGET_NAME_PRE)? ' \
139
-e 's?%ENGINE_ID%?\"$(AGENT_ENGINE_ID)\"? ' \
140
-e 's?%USM_ENGINE_ID%?\"$(AGENT_USM_ENGINE_ID)\"? ' < $< > $@
142
manager/%.conf: manager/%.conf.src
144
sed -e 's?%ADDR%?$(ADDR)? ' \
145
-e 's?%ENGINE_ID%?\"$(MANAGER_ENGINE_ID)\"? ' \
146
-e 's?%USM_ENGINE_ID%?\"$(MANAGER_USM_ENGINE_ID)\"? ' < $< > $@
149
# ----------------------------------------------------
151
# ----------------------------------------------------
152
include $(ERL_TOP)/make/otp_release_targets.mk
156
release_tests_spec: clean opt
157
$(INSTALL_DIR) $(RELSYSDIR)
158
chmod -f -R u+w $(RELSYSDIR)
159
$(INSTALL_DIR) $(RELSYSDIR)/agent
160
chmod -f -R u+w $(RELSYSDIR)/agent
161
$(INSTALL_DIR) $(RELSYSDIR)/agent/conf
162
chmod -f -R u+w $(RELSYSDIR)/agent/conf
163
$(INSTALL_DIR) $(RELSYSDIR)/agent/db
164
chmod -f -R u+w $(RELSYSDIR)/agent/db
165
$(INSTALL_DIR) $(RELSYSDIR)/agent/log
166
chmod -f -R u+w $(RELSYSDIR)/agent/log
167
$(INSTALL_DIR) $(RELSYSDIR)/manager
168
chmod -f -R u+w $(RELSYSDIR)/manager
169
$(INSTALL_DIR) $(RELSYSDIR)/manager/conf
170
chmod -f -R u+w $(RELSYSDIR)/manager/conf
171
$(INSTALL_DIR) $(RELSYSDIR)/manager/db
172
chmod -f -R u+w $(RELSYSDIR)/manager/db
173
$(INSTALL_DIR) $(RELSYSDIR)/manager/log
174
chmod -f -R u+w $(RELSYSDIR)/manager/log
175
$(INSTALL_DATA) $(SYS_CONFIG_FILES) $(RELSYSDIR)
176
$(INSTALL_DATA) $(AGENT_CONFIG_FILES) $(RELSYSDIR)/agent/conf
177
$(INSTALL_DATA) $(MANAGER_CONFIG_FILES) $(RELSYSDIR)/manager/conf
184
@echo "RELSYSDIR = $(RELSYSDIR)"
186
@echo "SYS_CONFIG_SRCS = $(SYS_CONFIG_SRCS)"
187
@echo "SYS_CONFIG_FILES = $(SYS_CONFIG_FILES)"
189
@echo "AGENT_CONFIG_SRCS = $(AGENT_CONFIG_SRCS)"
190
@echo "AGENT_CONFIG_FILES = $(AGENT_CONFIG_FILES)"
192
@echo "MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_SRCS)"
193
@echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)"
195
@echo "ADDR = $(ADDR)"
196
@echo "TARGET_NAME_PRE = $(TARGET_NAME_PRE)"