# vim: syntax=tcl

proc run {project_name} {
	if { "$project_name" == "MilskoDoxygen" } {
		RunCommand "doxygen"
		RunCommand "rm -rf /var/www/milsko-doxygen"
		RunCommand "mv doxygen/html /var/www/milsko-doxygen"
	} else {
		foreach target {"Linux" "Win32" "Win64"} {
			if { [file exists "Makefile"] == 1 } {
				RunCommand "make distclean"
			}
			if { "$target" == "Linux" } {
				RunCommand "./Makefile.pl --enable-opengl --enable-vulkan --without-vulkan-string-helper"
			} elseif { "$target" == "Win32" } {
				RunCommand "./Makefile.pl --enable-opengl --enable-stb-truetype --disable-freetype2 --cross --target=Windows --host=i686-w64-mingw32"
			} elseif { "$target" == "Win64" } {
				RunCommand "./Makefile.pl --enable-opengl --enable-stb-truetype --disable-freetype2 --cross --target=Windows --host=x86_64-w64-mingw32"
			}
			RunCommand "make clean"
			RunCommand "make -j4"
		}
	}
}
