# Default MS Build version
!IF EXIST("$(PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\msbuild.exe")
BUILDEXE = "$(PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\msbuild.exe"
!ELSE IF EXIST("$(PROGRAMFILES)\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\msbuild.exe")
BUILDEXE = "$(PROGRAMFILES)\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\msbuild.exe"
!ELSE IF EXIST("$(PROGRAMFILES)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe")
BUILDEXE = "$(PROGRAMFILES)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe"
!ELSE 
BUILDEXE = "msbuild.exe"
!ENDIF

PROGRAMFILESX86 = C:\Program Files (x86)

BUILD = $(BUILDEXE) /t:Rebuild
EMBARCADERO = $(PROGRAMFILESX86)\Embarcadero\RAD Studio
STUDIO = $(PROGRAMFILESX86)\Embarcadero\Studio
BDSCOMMONDIRMAIN = %PUBLIC%\Documents\Embarcadero\Studio\

clean: 
	DEL /S *.EXE
	DEL /S *.DCU
	DEL /S *.BPL
	
Package: lib\* Package\Delphi\*
	@SET BDS=$(STUDIO)\$(BDSVersion)
	@SET BDSINCLUDE=$(STUDIO)\$(BDSVersion)\include
	$(BUILD) "Package\UIRibbonPackage.dproj"
	
12.0: 
	$(MAKE) Package "BDSVersion=23.0"
	
10.4: 
	$(MAKE) Package "BDSVersion=21.0"

10.2: 
	$(MAKE) Package "BDSVersion=19.0"

_XE8:
	$(MAKE) Package "BDSVersion=16.0"

_XE7:
	$(MAKE) Package "BDSVersion=15.0"

_XE5:
	SET BDS=$(EMBARCADERO)\12.0
	$(BUILD) "Package\UIRibbonPackage.dproj"
	$(MAKE) _samples

"Designer\Bin\RibbonDesigner.exe": Designer\*.pas Designer\*.dfm Designer\*.dpr Designer\*.dproj 
	SET BDS=$(STUDIO)\23.0
	$(BUILD) /p:Config=Release "Designer\RibbonDesigner.dproj"

"Samples\High Level\01 Simple Ribbon\SimpleRibbon.exe": "Samples\High Level\01 Simple Ribbon\*.dproj" "Samples\High Level\01 Simple Ribbon\*.pas" "Samples\High Level\01 Simple Ribbon\*.dpr"
	$(BUILD) "Samples\High Level\01 Simple Ribbon\SimpleRibbon.dproj"

"Samples\High Level\02 Context Popup\ContextPopup.exe": "Samples\High Level\02 Context Popup\*.dproj" "Samples\High Level\02 Context Popup\*.pas" "Samples\High Level\02 Context Popup\*.dpr"
	$(BUILD) "Samples\High Level\02 Context Popup\ContextPopup.dproj"

"Samples\High Level\03 DropDown Color Picker\DropDownColorPicker.exe": "Samples\High Level\03 DropDown Color Picker\*.dproj" "Samples\High Level\03 DropDown Color Picker\*.pas" "Samples\High Level\03 DropDown Color Picker\*.dpr"
	$(BUILD) "Samples\High Level\03 DropDown Color Picker\DropDownColorPicker.dproj"

"Samples\High Level\04 Gallery\Gallery.exe": "Samples\High Level\04 Gallery\*.dproj" "Samples\High Level\04 Gallery\*.pas" "Samples\High Level\04 Gallery\*.dpr"
	$(BUILD) "Samples\High Level\04 Gallery\Gallery.dproj"
	
"Samples\High Level\05 Font Control\FontControl.exe": "Samples\High Level\05 Font Control\*.dproj" "Samples\High Level\05 Font Control\*.pas" "Samples\High Level\05 Font Control\*.dpr"
	$(BUILD) "Samples\High Level\05 Font Control\FontControl.dproj"
	
"Samples\High Level\06 Text Pad\TextPad.exe": "Samples\High Level\06 Text Pad\*.dproj" "Samples\High Level\06 Text Pad\*.pas" "Samples\High Level\06 Text Pad\*.dpr"
	$(BUILD) "Samples\High Level\06 Text Pad\TextPad.dproj"
	
"Samples\High Level\07 Text Pad with Action List\TextPad.exe": "Samples\High Level\07 Text Pad with Action List\*.dproj" "Samples\High Level\07 Text Pad with Action List\*.pas" "Samples\High Level\07 Text Pad with Action List\*.dpr"
	$(BUILD) "Samples\High Level\07 Text Pad with Action List\TextPad.dproj"
	
_samples: "Samples\High Level\01 Simple Ribbon\SimpleRibbon.exe" "Samples\High Level\02 Context Popup\ContextPopup.exe" "Samples\High Level\03 DropDown Color Picker\DropDownColorPicker.exe" "Samples\High Level\04 Gallery\Gallery.exe" "Samples\High Level\05 Font Control\FontControl.exe" "Samples\High Level\06 Text Pad\TextPad.exe" "Samples\High Level\07 Text Pad with Action List\TextPad.exe"
	
_continuousbuilds: clean 12.0 "Designer\Bin\RibbonDesigner.exe" _samples