# ``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 via the world wide web 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.
# 
# The Initial Developer of the Original Code is Ericsson Utvecklings AB.
# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
# AB. All Rights Reserved.''
# 
#     $Id$
#
include $(ERL_TOP)/make/target.mk

# ----------------------------------------------------
# Configuration info.
# ----------------------------------------------------
include $(ERL_TOP)/make/$(TARGET)/otp.mk

# ----------------------------------------------------
# Application version
# ----------------------------------------------------
include ../vsn.mk
VSN=$(TEST_SERVER_VSN)

# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
RELSYSDIR = $(RELEASE_PATH)/lib/test_server-$(VSN)

# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------

MODULES= test_server_ctrl \
	 test_server_node \
	 test_server \
	 test_server_sup \
	 ts \
         ts_run \
	 ts_reports \
	 ts_lib \
	 ts_make \
	 ts_erl_config \
	 ts_autoconf_win32 \
         ts_autoconf_vxworks \
         ts_autoconf_ose \
	 ts_save \
	 ts_install \
	 erl2html2 \
	 telnet_client \
	 vxworks_client

TARGET_MODULES= $(MODULES:%=$(EBIN)/%)

ERL_FILES= $(MODULES:=.erl)
HRL_FILES = ../include/test_server.hrl test_server_internal.hrl ts.hrl
C_FILES = 
AUTOCONF_FILES = configure.in conf_vars.in
PROGRAMS = configure config.sub config.guess install-sh 

TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR))

TARGETS = $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(PROGRAMS)

# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
ERL_FLAGS += 
ERL_COMPILE_FLAGS += -I../include

# ----------------------------------------------------
# Targets
# ----------------------------------------------------

tests debug opt: $(TARGETS)

clean:
	rm -f $(TARGET_FILES)
	rm -f core

doc:

configure: configure.in
	autoconf configure.in > configure

#
# test_server_node must be loaded in an R7B node.
#
$(EBIN)/test_server_node.beam: test_server_node.erl
	$(ERLC) +r7 $(ERL_FLAGS) $(ERL_COMPILE_FLAGS) \
          -o$(EBIN) test_server_node.erl

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

release_spec: opt
	$(INSTALL_DIR) $(RELSYSDIR)/src
	$(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
	$(INSTALL_DIR) $(RELSYSDIR)/ebin
	$(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin

release_tests_spec: opt
	$(INSTALL_DIR) $(RELEASE_PATH)/test_server
	$(INSTALL_DATA) $(ERL_FILES) \
		$(HRL_FILES) $(TARGET_FILES) $(AUTOCONF_FILES) $(C_FILES)\
		$(RELEASE_PATH)/test_server
	$(INSTALL_PROGRAM) $(PROGRAMS) $(RELEASE_PATH)/test_server

release_docs_spec:

