
!include $(CMTROOT)/src/NMakefile.core

!if defined (tag)
####---------------------------------------------------------------------------------
#### It seems that side effects of changing CMTCONFIG are too serious. Therefore this 
#### approach is discarded
####
####CMTCONFIG = $(tag)
####---------------------------------------------------------------------------------
CMTEXTRATAGS = $(tag)
!else
tag       = $(CMTCONFIG)
!endif

tags      = $(CMTEXTRATAGS)

${PACKAGE}_tag = $(tag)

!if [echo (constituents.make) Rebuilding $(${PACKAGE}_tag).make] == 0
!endif

!if [cmt -quiet build tag_makefile -tag=$(tags) >$(${PACKAGE}_tag).nmake] == 0
!endif

!include $(${PACKAGE}_tag).nmake

all ::

#--------------------------------------------------------

cmt_lock_setup = lock$(cmt_lock_pid).make
cmt_setup_pid  = $(bin)setup.make

config ::  ##$(${PACKAGE}_tag).make

env.make ::
	set >env.make.tmp; $(cmtexe) -quiet check files env.make.tmp env.make

all ::

javadirs ::
	@if not exist $(javabin) mkdir $(javabin)

srcdirs ::
	@if not exist $(src) mkdir $(src)

dirs ::
	@if not exist requirements echo "No requirements file"
	@echo (constituents.make) Rebuilding setup.make
	@if not exist $(bin) mkdir $(bin)
	@echo "----------> uses"                     >$(cmt_setup_pid)
	@$(cmtexe) -quiet -tag=$(tags) show uses    >>$(cmt_setup_pid)
	@echo "----------> tags"                    >>$(cmt_setup_pid)
	@$(cmtexe) -tag=$(tags) show tags           >>$(cmt_setup_pid)
	@echo "----------> CMTPATH"                 >>$(cmt_setup_pid)
	@$(cmtexe) show path -tag=$(tags) -quiet    >>$(cmt_setup_pid)
	@echo setup.make ok

.DEFAULT :
        @echo "???"

