# $Id: makefile.dos,v 6.3 1999/11/26 16:03:25 vakatov Exp $
##################################################
###  Makefile to build one of PC version of NCBI toolkit
#####

!ifdef NCBIHOME
BUILD_BASE = $(NCBIHOME)\build
INC_BASE   = $(NCBIHOME)\include
!else
BUILD_BASE = build
INC_BASE   = ..\include
!endif

ARG_BASE = NCOPY_BIN=1

# Debug/Release
!ifdef DBUG
DEBUG_SFX = _d
DEBUG_FLG = DBUG=1
!endif

# Console/GUI
!ifdef CONSOLE
CONSOLE_FLG = CONSOLE=1
!endif

# Compiler, DLL
!ifdef DLL
BUILD_SFX    = dll
DLL_FLG      = DLL=1
COMPILER_FLG = MS=1
!endif
!ifdef MS
BUILD_SFX    = ms
COMPILER_FLG = MS=1
!endif
!ifdef BOR
BUILD_SFX    = bor
COMPILER_FLG = BOR=1
ARG_EXTRA    = -N
!endif

# Compose names, flags, etc.
BUILD = $(BUILD_BASE)$(DEBUG_SFX).$(BUILD_SFX)
INC   = $(INC_BASE)
ARG   = $(ARG_EXTRA) $(ARG_BASE) $(COMPILER_FLG) $(CONSOLE_FLG) $(DEBUG_FLG) $(DLL_FLG) INCPATH=$(INC)
FLAG  = flag$(DEBUG_SFX).$(BUILD_SFX)

!undef DBUG
!undef CONSOLE
!undef MS
!undef DLL
!undef BOR

# BUILD::  must be run from inside the BUILD directory
nocopy: make_exe.dos make_lib.dos make_gen.dos makeall.dos makedemo.dos makenet.dos $(FLAG)
        $(MAKE) -f makeall.dos  $(ARG) nocopy
        $(MAKE) -f makedemo.dos $(ARG) nocopy
        $(MAKE) -f makenet.dos  $(ARG) nocopy

noexe: make_lib.dos make_gen.dos makeall.dos makedemo.dos makenet.dos $(FLAG)
        $(MAKE) -f makeall.dos  $(ARG) noexe
        $(MAKE) -f makenet.dos  $(ARG) noexe


# COPY::   must be run from inside the MAKE directory
copy:
        mkdir ..\$(BUILD)
        copy *.dos ..\$(BUILD)
        copy *.bat ..\$(BUILD)
        cd ..\$(BUILD)
        echo "Denis Vakatov, NCBI" > $(FLAG)
        $(MAKE) -f makeall.dos  $(ARG) copy
        $(MAKE) -f makedemo.dos $(ARG) copy
        $(MAKE) -f makenet.dos  $(ARG) copy

# USER::   can be run from any directory
# by the time, the relevant sources must be deployed and all needed libraries
# must be built - using the "copy" and "nocopy" targets, with the same options
# (it uses only files from the relevant BUILD*.* directories)
user: $(MAKEUSER)
        $(MAKE) -f $(MAKEUSER) $(ARG) LIBPATH=$(BUILD)
