


SOLUTIONDIR := $(shell pwd)
export SOLUTIONDIR

CONFIG ?= Debug
CONFIGS := Debug Release 
PROJECTS := SimRobotCore SimRobotGUI SimRobotDemo 
PROJECTCONFIGS := SimRobotCore_Debug SimRobotGUI_Debug SimRobotDemo_Debug SimRobotCore_Release SimRobotGUI_Release SimRobotDemo_Release 

.PHONY: all clean $(CONFIGS) $(PACKAGES) $(PACKAGECONFIGS)

all: $(CONFIG)

prebuild:
#	@echo "------ Regenerating Makefiles ------"
	-@../Util/zbuildgen/bin/zbuildgen --platform linux > /dev/null

Debug: SimRobotCore_Debug SimRobotGUI_Debug SimRobotDemo_Debug 

SimRobotCore_Debug: prebuild 
	@$(MAKE) -j 2 --no-print-directory  -f SimRobotCore.make Debug

SimRobotGUI_Debug: prebuild SimRobotCore_Debug 
	@$(MAKE) -j 2 --no-print-directory  -f SimRobotGUI.make Debug

SimRobotDemo_Debug: prebuild SimRobotGUI_Debug 
	@$(MAKE) -j 2 --no-print-directory  -f SimRobotDemo.make Debug

Release: SimRobotCore_Release SimRobotGUI_Release SimRobotDemo_Release 

SimRobotCore_Release: prebuild 
	@$(MAKE) -j 2 --no-print-directory  -f SimRobotCore.make Release

SimRobotGUI_Release: prebuild SimRobotCore_Release 
	@$(MAKE) -j 2 --no-print-directory  -f SimRobotGUI.make Release

SimRobotDemo_Release: prebuild SimRobotGUI_Release 
	@$(MAKE) -j 2 --no-print-directory  -f SimRobotDemo.make Release


SimRobotCore: SimRobotCore_$(CONFIG)

SimRobotGUI: SimRobotGUI_$(CONFIG)

SimRobotDemo: SimRobotDemo_$(CONFIG)


clean: prebuild
	@echo "------ Cleaning ------"
	@$(MAKE) --no-print-directory  -f SimRobotCore.make clean
	@$(MAKE) --no-print-directory  -f SimRobotGUI.make clean
	@$(MAKE) --no-print-directory  -f SimRobotDemo.make clean

