aboutsummaryrefslogtreecommitdiffstats
path: root/lib/megaco/test/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/megaco/test/Makefile')
-rw-r--r--lib/megaco/test/Makefile46
1 files changed, 37 insertions, 9 deletions
diff --git a/lib/megaco/test/Makefile b/lib/megaco/test/Makefile
index e521194419..682b83d368 100644
--- a/lib/megaco/test/Makefile
+++ b/lib/megaco/test/Makefile
@@ -52,13 +52,15 @@ endif
include modules.mk
+EBIN = .
+
HRL_FILES = megaco_test_lib.hrl
ERL_FILES = $(MODULES:%=%.erl)
-TARGET_FILES = $(MODULES:%=%.$(EMULATOR))
+SOURCE = $(HRL_FILES) $(ERL_FILES)
-COVER_SPEC_FILE = megaco.cover
+TARGET_FILES = $(MODULES:%=%.$(EMULATOR))
APP_CASES = app appup
@@ -71,6 +73,18 @@ OP_CASES = mess mib mreq pending trans actions load
ALL_CASES = $(APP_CASES) $(CODEC_CASES) $(MISC_CASES) $(OP_CASES)
+EMAKEFILE = Emakefile
+MAKE_EMAKE = $(wildcard $(ERL_TOP)/make/make_emakefile)
+
+ifeq ($(MAKE_EMAKE),)
+BUILDTARGET = $(TARGET_FILES)
+RELTEST_FILES = $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) $(SOURCE)
+else
+BUILDTARGET = emakebuild
+RELTEST_FILES = $(EMAKEFILE) $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) $(SOURCE)
+endif
+
+
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
@@ -128,15 +142,30 @@ endif
# Targets
# ----------------------------------------------------
-tests debug opt: $(TARGET_FILES)
+tests debug opt: $(BUILDTARGET)
+
+targets: $(TARGET_FILES)
+
+.PHONY: emakebuild
+
+emakebuild: $(EMAKEFILE)
+
+$(EMAKEFILE):
+ $(MAKE_EMAKE) $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' | grep -v Warning > $(EMAKEFILE)
+ $(MAKE_EMAKE) $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) | grep -v Warning >> $(EMAKEFILE)
clean:
+ rm -f $(EMAKEFILE)
rm -f $(TARGET_FILES)
rm -f errs core *~
docs:
info:
+ @echo "MAKE_EMAKE = $(MAKE_EMAKE)"
+ @echo "EMAKEFILE = $(EMAKEFILE)"
+ @echo "BUILDTARGET = $(BUILDTARGET)"
+ @echo ""
@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"
@echo "ERL = $(ERL)"
@echo "MERL = $(MERL)"
@@ -314,8 +343,6 @@ all: make
make: targets
-targets: $(TARGET_FILES)
-
test: make
$(MERL) $(ARGS) -sname megaco_test $(ERL_PATH) \
-s megaco_test_lib t $(SUITE) \
@@ -722,9 +749,10 @@ release_docs_spec:
release_tests_spec: tests
$(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) \
- $(HRL_FILES) $(ERL_FILES) \
- $(RELSYSDIR)
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)
+ $(INSTALL_DATA) $(RELTEST_FILES) $(RELSYSDIR)
+# $(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) \
+# $(HRL_FILES) $(ERL_FILES) \
+# $(RELSYSDIR)
+#
chmod -f -R u+w $(RELSYSDIR)