# Alternative GNU Make workspace makefile autogenerated by Premake

ifndef config
  config=release_64bit
endif

ifndef verbose
  SILENT = @
endif

ifeq ($(config),release_64bit)
  wren_config = release_64bit
  wren_shared_config = release_64bit
  wren_test_config = release_64bit

else ifeq ($(config),release_32bit)
  wren_config = release_32bit
  wren_shared_config = release_32bit
  wren_test_config = release_32bit

else ifeq ($(config),release_64bit-no-nan-tagging)
  wren_config = release_64bit-no-nan-tagging
  wren_shared_config = release_64bit-no-nan-tagging
  wren_test_config = release_64bit-no-nan-tagging

else ifeq ($(config),debug_64bit)
  wren_config = debug_64bit
  wren_shared_config = debug_64bit
  wren_test_config = debug_64bit

else ifeq ($(config),debug_32bit)
  wren_config = debug_32bit
  wren_shared_config = debug_32bit
  wren_test_config = debug_32bit

else ifeq ($(config),debug_64bit-no-nan-tagging)
  wren_config = debug_64bit-no-nan-tagging
  wren_shared_config = debug_64bit-no-nan-tagging
  wren_test_config = debug_64bit-no-nan-tagging

else
  $(error "invalid configuration $(config)")
endif

PROJECTS := wren wren_shared wren_test

.PHONY: all clean help $(PROJECTS) 

all: $(PROJECTS)

wren:
ifneq (,$(wren_config))
	@echo "==== Building wren ($(wren_config)) ===="
	@${MAKE} --no-print-directory -C . -f wren.make config=$(wren_config)
endif

wren_shared:
ifneq (,$(wren_shared_config))
	@echo "==== Building wren_shared ($(wren_shared_config)) ===="
	@${MAKE} --no-print-directory -C . -f wren_shared.make config=$(wren_shared_config)
endif

wren_test: wren
ifneq (,$(wren_test_config))
	@echo "==== Building wren_test ($(wren_test_config)) ===="
	@${MAKE} --no-print-directory -C . -f wren_test.make config=$(wren_test_config)
endif

clean:
	@${MAKE} --no-print-directory -C . -f wren.make clean
	@${MAKE} --no-print-directory -C . -f wren_shared.make clean
	@${MAKE} --no-print-directory -C . -f wren_test.make clean

help:
	@echo "Usage: make [config=name] [target]"
	@echo ""
	@echo "CONFIGURATIONS:"
	@echo "  release_64bit"
	@echo "  release_32bit"
	@echo "  release_64bit-no-nan-tagging"
	@echo "  debug_64bit"
	@echo "  debug_32bit"
	@echo "  debug_64bit-no-nan-tagging"
	@echo ""
	@echo "TARGETS:"
	@echo "   all (default)"
	@echo "   clean"
	@echo "   wren"
	@echo "   wren_shared"
	@echo "   wren_test"
	@echo ""
	@echo "For more information, see https://github.com/premake/premake-core/wiki"