cc=cl.exe
cflags=/Opt2 /G6 /Gs /c /YX /MD
rc=rc.exe
rflags=-r
link=link.exe
lflags=/LIBPATH:%microsoft%\lib /DEFAULTLIB:MSVCRT.LIB /SUBSYSTEM:WINDOWS /DLL user32.lib kernel32.lib gdi32.lib
target1=simpmesh
target2=expcurv
all: $(target1).dll $(target2).dll
$(target1).obj: $(target1).cpp
  $(cc) $(cflags) $(target1).cpp
res\$(target1).res: res\$(target1).rc
  $(rc) $(rflags) res\$(target1).rc
$(target1).dll: $(target1).obj common.def res\$(target1).res
	cd cppdecl
	nmake
	cd ../win32ui
	nmake
	cd ..
	$(link) $(lflags) $(target1).obj res\$(target1).res cppdecl\plugcommon.obj win32ui\winplus.lib /DEF:common.def
$(target2).obj: $(target2).cpp
  $(cc) $(cflags) $(target2).cpp
res\$(target2).res: res\$(target2).rc
  $(rc) $(rflags) res\$(target2).rc
$(target2).dll: $(target2).obj common.def res\$(target2).res
	cd cppdecl
	nmake
	cd ../win32ui
	nmake
	cd ..
	$(link) $(lflags) $(target2).obj res\$(target2).res cppdecl\plugcommon.obj win32ui\winplus.lib /DEF:common.def  
clean:
	cd cppdecl
	nmake clean
	cd ../win32ui
	nmake clean
	cd ..
	if exist *.exp del *.exp
	if exist *.obj del *.obj
	if exist *.pch del *.pch
	if exist *.lib del *.lib
clean_rest:
	cd cppdecl
	nmake clean_rest
	cd ../win32ui
	nmake clean_rest
	cd ..
	if exist *.dll del *.dll
