
#ASMLC = $(ASMLDEVDIR)\runtime\asmlc.exe
ASMLC = $(ASMLDEVDIR)\AsmL\asmlc.bootx.exe /nowarn
ASML2DOC = $(ASMLDEVDIR)\bin\Debug\WordGenerator.exe
ASMLP = $(ASMLDEVDIR)\bin\Debug\asmlp.exe
CSC = csc 

!if "$(Config)"=="QSelf1"
QSELF1_OPTIONS = /basicblock
!endif

ASharp = no
Config = Debug
TargetDir = $(ASMLDEVDIR)\bin\$(Config)
DocDir = $(ASMLDEVDIR)\AsmL\APIDoc
TargetName = $(TargetDir)\AsmL.Tools.Env.dll
References = /lib:$(TargetDir) /reference:AsmL.Tools.Framework.dll /reference:AsmL.Tools.Compiler.dll /reference:AsmL.Tools.Remoting.dll /reference:AsmL.Tools.CustomTypeEditors.dll /reference:System.dll /reference:System.Xml.dll /reference:System.Design.dll
LauncherReferences = $(References) 
Options = $(QSELF1_OPTIONS) -localvaropt -nohint+"AsmL not longer" -nohint+"inserted a possibly failing" -v=4 /allprimitive

CSOptions=/nowarn:0108 /nowarn:0114 /nowarn:0162 /nowarn:0164 /nowarn:0183 /nowarn:0168 /nowarn:0169 /nowarn:0219 /debug+ /optimize+  /debug:full

Launcher = $(TargetDir)\asmllauncher.exe

!if "$(ASharp)"!="yes"
Sources = manifest.asml sessionprovider.asml messagingserviceprovider.asml monitoringserviceprovider.asml monitor.asml remotemessagingserviceprovider.asml interpreter.asml launcher.asml loadingserviceprovider.asml
!else
Sources = manifest.xas sessionprovider.asml messagingserviceprovider.xas monitoringserviceprovider.xas monitor.asml remotemessagingserviceprovider.asml interpreter.asml loadingserviceprovider.asml
!endif

.SUFFIXES: .asml .xas
.asml.xas:
      $(ASMLP) $(PPVALUETYPES) /ppomitasml /pp:asharp /ppout:$*.xas $**

Docs=

all: build 

build: $(TargetName) 

launcher:$(Launcher)

$(TargetDir)\env.cs: $(Sources)
	$(ASMLC) $(Options) $(References) /nocsc /ignoreSomeAsmL15CompatibilityIssues /ocs:$(TargetDir)\env.cs $(Sources)

$(TargetName): $(TargetDir)\env.cs
	$(CSC) $(CSOptions) $(References) /r:AsmlRuntime.dll /target:library /out:$(TargetName) $(TargetDir)\env.cs /keyfile:Env.snk

$(Launcher): launcher.asml $(TargetName)
	$(ASMLC) $(Options) $(LauncherReferences) /reference:$(TargetName) /ocs:$(TargetDir)\launcher.cs /out:$(Launcher) launcher.asml

clean:
	-del $(TargetName) 
	-del $(TargetDir)\env.cs 
	-del $(Docs)

rebuild: clean $(TargetName)

install:

doc: $(Docs)
