
cmtexe = $(CMTROOT)\$(CMTBIN)\cmt.exe

!if exist ("..\VisualC") == 0
!if [mkdir ..\VisualC] == 0
!endif
!endif

!if [copy cmt_dependencies.nmake ..\VisualC] == 0
!endif

!if exist ("$(cmtexe)")
!if [$(cmtexe) -quiet build constituent_makefile cmt] == 0
!endif
!else
!if [echo no cmt] == 0
!endif
!endif

!include cmt.nmake

all ::
	@set include=$(include)
	@set lib=$(lib)

all :: cmt
	echo all ok

democlean ::
	-rmdir /Q /S ..\demo

demo :: democlean
	mkdir ..\demo
	$(cmtexe) create demoA v1 ..\demo
	$(cmtexe) create demoB v1 ..\demo
	$(cmtexe) create demoC v1 ..\demo
	mkdir ..\demo\demoA\v1\demoA
	mkdir ..\demo\demoA\v1\cmt\fragments
	mkdir ..\demo\demoA\v1\cmt\fragments\nmake
	copy ..\src\demo\demoA\requirements ..\demo\demoA\v1\cmt
	copy ..\src\demo\demoA\init.bat ..\demo\demoA\v1\cmt
	copy ..\src\demo\demoA\*.cxx ..\demo\demoA\v1\src
	copy ..\src\demo\demoA\demoA.h ..\demo\demoA\v1\demoA
	copy ..\src\demo\demoA\*.java ..\demo\demoA\v1\src
	copy ..\src\demo\demoA\fragments\rename* ..\demo\demoA\v1\cmt\fragments
	copy ..\src\demo\demoA\fragments\nmake\rename* ..\demo\demoA\v1\cmt\fragments\nmake
	copy ..\src\demo\demoB\requirements ..\demo\demoB\v1\cmt
	copy ..\src\demo\demoB\init.bat ..\demo\demoB\v1\cmt
	copy ..\src\demo\demoB\*.cxx ..\demo\demoB\v1\src
	copy ..\src\demo\demoB\*.java ..\demo\demoB\v1\src
	copy ..\src\demo\demoC\requirements ..\demo\demoC\v1\cmt
	copy ..\src\demo\demoC\*.cxx ..\demo\demoC\v1\src
	set CMTPATH=$(CMTROOT)\demo
	cd ..\demo\demoA\v1\cmt
        call setup.bat
	nmake /f nmake all_groups check
	cd ..\..\..\demoB\v1\cmt
        call setup.bat
	nmake /f nmake all check
	cd ..\..\..\demoC\v1\cmt
        call setup.bat
	$(cmtexe) config
	nmake /f nmake all check

