
CORE_SRC=	\
			core/ui.js				\
			core/network.js

SRC=		\
			game/resources.js		\
			game/uiScoreboard.js	\
			game/uiGrid.js			\
			game/Grid.js			\
			game/Player.js			\
			game/polling.js			\
			game/workflow.js

SRC_INDEX=	index/resources.js		\
			index/ui.js				\
			index/workflow.js

OUTPUT=		../public/crosswords.min.js

OUTPUT_INDEX=	../public/index.min.js

CLOSURE=	closure-compiler-v20170218.jar

all: game index

game:
	java -jar ${CLOSURE} --compilation_level ADVANCED --language_in=ECMASCRIPT5_STRICT --warning_level=VERBOSE --js_output_file ${OUTPUT} ${CORE_SRC} ${SRC}

index:
	java -jar ${CLOSURE} --compilation_level ADVANCED --language_in=ECMASCRIPT5_STRICT --warning_level=VERBOSE --js_output_file ${OUTPUT_INDEX} ${CORE_SRC} ${SRC_INDEX}

debug:
	java -jar ${CLOSURE} --compilation_level WHITESPACE_ONLY --language_in=ECMASCRIPT5_STRICT --js_output_file ${OUTPUT} ${CORE_SRC} ${SRC}
	java -jar ${CLOSURE} --compilation_level WHITESPACE_ONLY --language_in=ECMASCRIPT5_STRICT --js_output_file ${OUTPUT_INDEX} ${CORE_SRC} ${SRC_INDEX}

$OUTPUT: all

clean:
	$(RM) $(OUTPUT) $(OUTPUT_INDEX)

re:	clean all

.PHONY: all debug clean re index game

