aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/test/test_config/Makefile
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2010-12-09 18:44:04 +0100
committerMicael Karlberg <[email protected]>2010-12-09 18:44:04 +0100
commitec857328b0ece6a676633a3bd647a4ce37703469 (patch)
tree020e7c2c980e36b86676b9cc4c2b30c45a21b3a7 /lib/snmp/test/test_config/Makefile
parentadd572241ac6085f1dc1062ae6ca351737ec43eb (diff)
downloadotp-ec857328b0ece6a676633a3bd647a4ce37703469.tar.gz
otp-ec857328b0ece6a676633a3bd647a4ce37703469.tar.bz2
otp-ec857328b0ece6a676633a3bd647a4ce37703469.zip
First preliminary sedding...
Diffstat (limited to 'lib/snmp/test/test_config/Makefile')
-rw-r--r--lib/snmp/test/test_config/Makefile56
1 files changed, 44 insertions, 12 deletions
diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
index 250c594af6..064c9f4689 100644
--- a/lib/snmp/test/test_config/Makefile
+++ b/lib/snmp/test/test_config/Makefile
@@ -30,54 +30,81 @@ VSN = $(SNMP_VSN)
# ----------------------------------------------------
+# Configured variables
+# ----------------------------------------------------
+# PERL = @PERL@
+PERL = perl
+
+
+# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------
include modules.mk
+ERL_TARGETS = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
+
SYS_CONFIG_SRCS = $(SYS_CONFIG_FILES:%=%.src)
AGENT_CONFIG_SRCS = $(AGENT_CONFIG_FILES:%=%.src)
MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_FILES:%=%.src)
+CONFIG_FILES = \
+ $(SYS_CONFIG_FILES) \
+ $(AGENT_CONFIG_FILES) \
+ $(MANAGER_CONFIG_FILES)
-# ----------------------------------------------------
-# Release directory specification
-# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)
+TARGETS = \
+ $(ERL_TARGETS) \
+ $(CONFIG_FILES)
# ----------------------------------------------------
-# SNMP FLAGS
+# Release directory specification
# ----------------------------------------------------
+ifeq ($(TESTROOT),)
+TESTROOT=/tmp
+endif
+RELSYSDIR = $(TESTROOT)
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
+EBIN = .
+
+ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \
+ +'{attribute,insert,app_vsn,$(APP_VSN)}'
+
+ifeq ($(ADDR),)
+ADDR = $(shell erl -noshell -s test_config ip_address -s init stop)
+endif
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
-tests debug opt: $(SYS_CONFIG_FILES) $(AGENT_CONFIG_FILES) $(MANAGER_CONFIG_FILES)
+tests debug opt: $(TARGETS)
clean:
- rm -f $(SYS_CONFIG_FILES)
- rm -f $(AGENT_CONFIG_FILES)
- rm -f $(MANAGER_CONFIG_FILES)
+ rm -f $(CONFIG_FILES)
+ rm -f $(ERL_TARGETS)
rm -f core
docs:
$(SYS_CONFIG_FILES): $(SYS_CONFIG_SRCS)
- @echo "sys: $< -> $@"
+ @echo "$< -> $@"
+ $(PERL) -p -e 's?%DIR%?$(RELSYSDIR)? ' < $< > $@
$(AGENT_CONFIG_FILES): $(AGENT_CONFIG_SRCS)
- @echo "agent: $< -> $@"
+ @echo "$< -> $@"
+ $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@
$(MANAGER_CONFIG_FILES): $(MANAGER_CONFIG_SRCS)
- @echo "manager: $< -> $@"
+ @echo "$< -> $@"
+ $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@
# ----------------------------------------------------
@@ -114,6 +141,9 @@ release_docs_spec:
info:
+ @echo ""
+ @echo "RELSYSDIR = $(RELSYSDIR)"
+ @echo ""
@echo "SYS_CONFIG_SRCS = $(SYS_CONFIG_SRCS)"
@echo "SYS_CONFIG_FILES = $(SYS_CONFIG_FILES)"
@echo ""
@@ -123,5 +153,7 @@ info:
@echo "MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_SRCS)"
@echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)"
@echo ""
+ @echo "ADDR = $(ADDR)"
+ @echo ""