# $Id: make_exe.dos,v 6.7 2000/02/25 16:46:00 vakatov Exp $
########################################################################
#  This file describes rules to build NCBI-toolkit-based application.
#  Below is an example of using this file(along with another template
#  "make_gen.dos").
#
########################################################################
# MT =
# !include "$(LIBPATH)\make_gen.dos"
# TEST_NAME = testcore
# TEST_LIB = $(LIB1)
# TEST_OBJ = testcore.obj
# TEST_OPT =
# TEST_STDLIB =
# RES =
# RES_DEP =
# !include "$(LIBPATH)\make_exe.dos"
########################################################################
# For more detail explanations see in the file "make/_howto_.dos"
########################################################################


#############################################################################
# Compose default input/output file names
TEST_EXE = $(TEST_NAME).exe
TEST_MAP = $(TEST_NAME).map
TEST_RC  = $(TEST_NAME).rc


#############################################################################
# If to link with the "real" MT module
!ifdef MT
X_MT_OBJ=$(MT_OBJ)
!endif


#############################################################################
# OBJ, RES and EXE building rules

.c.obj:
	$(CC) @<<
$(TEST_OPT) $(CFLAGS) $*.c
<<

.cxx.obj:
	$(CC) @<<
$(TEST_OPT) $(CFLAGS) $*.cxx
<<

!ifdef RES
TEST_RES = $(TEST_NAME).res
$(TEST_RES): $(TEST_RC) $(RES_DEP)
	$(RC) -r -I$(INCPATH) -I$(LIBPATH) $(TEST_RC)
!endif


#############################################################################
# special rules to build some of the NCBI toolkit object files
test_ncbi_socket_.obj:  test_ncbi_socket_.c test_ncbi_socket.c
	$(CC) @<<
$(CFLAGS) test_ncbi_socket_.c
<<


#############################################################################

copy:   $(TEST_EXE)
nocopy: $(TEST_EXE)

$(TEST_EXE): $(TEST_OBJ) $(X_MT_OBJ) $(TEST_LIB) $(TEST_RES) $(TEST_DEF)
!ifdef BOR
	$(LINK) @<<
$(LDFLAGS) $(STD_OBJ) $(TEST_OBJ) $(MAIN_OBJ) $(X_MT_OBJ)
$(TEST_EXE), $(TEST_MAP)
$(TEST_LIB) $(TEST_STDLIB) $(STDLIB)

$(TEST_RES)
<<
!else
	$(LINK)  @<<
/OUT:$(TEST_EXE)
/MAP:$(TEST_MAP)
$(STD_OBJ) $(TEST_OBJ) $(MAIN_OBJ) $(X_MT_OBJ) $(TEST_RES)
$(LFLAGS) $(TEST_LIB) $(TEST_STDLIB) $(STDLIB)
<<
!endif
	$(COPY_BIN) $(TEST_EXE) $(BINPATH)
