#
# Makefile loader which includes platform/target specific settings
# from $(PLATFORM).mk and and then executes the local Buildrules.mk file.
# The target platform is either autodetected for host compilation or can
# be specified as command line parameter for cross compilation.
#

MAKEFILES_DIR=../../makefiles
PLATFORM=`($(MAKEFILES_DIR)/platform-detect.sh) 2>/dev/null || echo "unknown"`

_default:
	@echo "Building for auto-detected host platform: $(PLATFORM)"
	@echo "Executing makefile: $(MAKEFILES_DIR)/$(PLATFORM).mk"
	$(MAKE) -f $(MAKEFILES_DIR)/$(PLATFORM).mk

.DEFAULT:
	@echo "Executing makefile: $(MAKEFILES_DIR)/$<.mk"
	@$(MAKE) -f $(MAKEFILES_DIR)/$<.mk

