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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
#-*-makefile-*- ; force emacs to enter makefile-mode
# %CopyrightBegin%
#
# Copyright Ericsson AB 1996-2011. 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
# ----------------------------------------------------
# Application version
# ----------------------------------------------------
include ../vsn.mk
VSN = $(SNMP_VSN)
# ----------------------------------------------------
# Configured variables
# ----------------------------------------------------
PERL = @PERL@
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
RELSYSDIR = $(RELEASE_PATH)/lib/snmp-$(VSN)
# ----------------------------------------------------
# Common macros
# ----------------------------------------------------
# NOTE:
# 1) Order is important; some MIBs include others
# 2) The OTP-REG mib actually belongs to another
# application (otp_mibs), and is exported by this
# app. But since that app is built later, we have
# to built it here in order to be able to build
# OTP-SNMPEA-MIB (that needs otpModules and
# otpApplications).
MIBS_A = \
RFC1213-MIB \
STANDARD-MIB \
SNMPv2-TM \
SNMPv2-MIB \
SNMP-FRAMEWORK-MIB \
SNMP-MPD-MIB \
SNMP-TARGET-MIB \
SNMP-NOTIFICATION-MIB \
SNMP-COMMUNITY-MIB \
SNMP-USER-BASED-SM-MIB \
SNMP-VIEW-BASED-ACM-MIB \
SNMP-USM-AES-MIB \
INET-ADDRESS-MIB \
TRANSPORT-ADDRESS-MIB
MIBS_B = OTP-SNMPEA-MIB
BUILD_MIBS = \
$(MIBS_A) \
OTP-REG \
$(MIBS_B)
MIBS = $(MIBS_A) $(MIBS_B)
STD_v1_MIB_FILES = \
RFC1155-SMI.mib \
RFC-1212.mib \
RFC-1215.mib
STD_v2_MIB_FILES = \
SNMPv2-SMI.mib \
SNMPv2-TC.mib \
SNMPv2-CONF.mib
FUNCS_FILES = \
STANDARD-MIB.funcs \
SNMPv2-MIB.funcs \
SNMP-NOTIFICATION-MIB.funcs \
SNMP-TARGET-MIB.funcs
V1_MIB_FILES = v1/OTP-SNMPEA-MIB.mib.v1
MIB_FILES = $(MIBS:%=%.mib)
BIN_TARGETS = $(MIBS:%=$(SNMP_BIN_TARGET_DIR)/%.bin)
HRL_TARGETS = $(MIBS:%=$(SNMP_HRL_TARGET_DIR)/%.hrl)
HRL_FILES = $(SNMP_HRL_TARGET_DIR)/SNMPv2-TC.hrl \
$(HRL_TARGETS)
TARGET_FILES = \
$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 \
$(BUILD_MIBS:%=$(SNMP_BIN_TARGET_DIR)/%.bin) \
$(HRL_TARGETS) \
$(V1_MIB_FILES)
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
SNMP_FLAGS += -pa ../ebin +version
ifneq ($(MIBS_VERBOSITY),)
SNMP_FLAGS += +'{verbosity, $(MIBS_VERBOSITY)}'
endif
ifeq ($(MIBS_REFERENCE),true)
SNMP_FLAGS += +reference
endif
ifeq ($(MIBS_OPTIONS),true)
SNMP_FLAGS += +options
endif
ifeq ($(MIBS_MC),true)
SNMP_FLAGS += +module_compliance
endif
ifeq ($(MIBS_AC),true)
SNMP_FLAGS += +agent_capabilities
endif
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
OTP_MIBDIR = $(shell if test -d ../../otp_mibs; then echo otp_mibs; \
else echo sasl; fi)
debug opt: $(TARGET_FILES)
$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1: $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1.src
$(PERL) -p -e 's?%PERL%?$(PERL)? ' < $< > $@
chmod 755 $@
$(SNMP_BIN_TARGET_DIR)/OTP-REG.bin: $(ERL_TOP)/lib/$(OTP_MIBDIR)/mibs/OTP-REG.mib
$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $<
clean:
rm -f $(TARGET_FILES)
docs:
conf:
cd ..; $(MAKE) conf
info:
@echo "MIBS_REFERENCE = $(MIBS_REFERENCE)"
@echo ""
@echo "MIBS_OPTIONS = $(MIBS_OPTIONS)"
@echo ""
@echo "MIBS_MC = $(MIBS_MC)"
@echo ""
@echo "MIBS_AC = $(MIBS_AC)"
@echo ""
@echo "SNMP_FLAGS = $(SNMP_FLAGS)"
@echo ""
@echo "MIBS = $(MIBS)"
@echo ""
@echo "BUILD_MIBS = $(BUILD_MIBS)"
@echo ""
@echo "MIB_FILES = $(MIB_FILES)"
@echo ""
@echo "BIN_TARGETS = $(BIN_TARGETS)"
@echo ""
@echo "HRL_TARGETS = $(HRL_TARGETS)"
@echo ""
@echo "TARGET_FILES = $(TARGET_FILES)"
@echo ""
@echo "OTP_MIBDIR = $(OTP_MIBDIR)"
@echo ""
@echo "SNMP_VSN = $(SNMP_VSN)"
@echo "VSN = $(VSN)"
@echo "RELSYSDIR = $(RELSYSDIR)"
v1/%.mib.v1: %.mib
$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $<
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
$(INSTALL_DIR) $(RELSYSDIR)/mibs
$(INSTALL_DIR) $(RELSYSDIR)/mibs/v1
$(INSTALL_DATA) $(MIB_FILES) $(RELSYSDIR)/mibs
$(INSTALL_DATA) $(STD_v2_MIB_FILES) $(RELSYSDIR)/mibs
$(INSTALL_DATA) $(FUNCS_FILES) $(RELSYSDIR)/mibs
$(INSTALL_DATA) $(STD_v1_MIB_FILES) $(RELSYSDIR)/mibs/v1
$(INSTALL_DATA) $(V1_MIB_FILES) $(RELSYSDIR)/mibs/v1
$(INSTALL_DIR) $(RELSYSDIR)/include
$(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
$(INSTALL_DIR) $(RELSYSDIR)/priv/mibs
$(INSTALL_DATA) $(BIN_TARGETS) $(RELSYSDIR)/priv/mibs
release_docs_spec:
|