forked from melonjs/melonJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (75 loc) · 2.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#######################################################################
# MelonJS Game Engine
# Copyright (C) 2011, Olivier BIOT
# http://olivierbiot.wordpress.com/
#
# melonJS is licensed under a Creative Commons
# Attribution-NonCommercial-NoDerivs 3.0 Unported License.
# http://creativecommons.org/licenses/by-nc-nd/3.0/
#
# javascript compilation / "minification" makefile
#
# MODULE -- js files to minify
# BUILD -- js minified target file (1)
#
#######################################################################
# YUICOMPRESSOR
YUI_VERSION = 2.4.6
YUI_PATH = tools/yuicompressor-$(YUI_VERSION)/build/
YUI_COMPRESSOR = ${YUI_PATH}yuicompressor-$(YUI_VERSION).jar
YUI_OPTION =
#YUI_OPTION = --verbose
# GOOGLE CLOSURE COMPILER
GCC_VERSION =
GCC_PATH = tools/google-closure-compiler$(GCC_VERSION)/
GCC_COMPRESSOR = ${GCC_PATH}compiler$(GCC_VERSION).jar
GCC_OPTION = --jscomp_off=internetExplorerChecks
#GCC_OPTION = --compilation_level ADVANCED_OPTIMIZATIONS
# JSDOC
JSDOC_VERSION = 2.4.0
JSDOC_PATH = tools/jsdoc-toolkit
JSDOC_OPTION = -d=docs -s
# Set the source directory
srcdir = src/
buildir = build/
docdir = docs/
# CURRENT BUILD VERSION
ME_VER=$(shell cat $(srcdir)version.txt)
VERSION=sed "s/@VERSION/${VERSION}/"'
# list of module to compile
MODULE = $(srcdir)core.js\
$(srcdir)loader/loader.js\
$(srcdir)math/geometry.js\
$(srcdir)entity/camera.js\
$(srcdir)entity/entity.js\
$(srcdir)font/font.js\
$(srcdir)GUI/GUI.js\
$(srcdir)GUI/HUD.js\
$(srcdir)audio/audio.js\
$(srcdir)video/video.js\
$(srcdir)input/input.js\
$(srcdir)utils/utils.js\
$(srcdir)utils/stat.js\
$(srcdir)level/level.js\
$(srcdir)level/TMXTiledMap.js\
$(srcdir)Utils/tween.js
# Debug Target name
DEBUG = $(buildir)melonJS-$(ME_VER).js
# Build Target name
BUILD = $(buildir)melonJS-$(ME_VER)-min.js
#######################################################################
.DEFAULT_GOAL := all
.PHONY: js
all: debug
java -jar $(YUI_COMPRESSOR) $(YUI_OPTION) $(DEBUG) >> $(BUILD)
google: debug
java -jar $(GCC_COMPRESSOR) $(GCC_OPTION) --js=$(DEBUG) --js_output_file=$(BUILD)
debug: clean
cat $(MODULE) >> $(DEBUG)
clean:
rm -f $(BUILD)
rm -f $(DEBUG)
rm -Rf $(docdir)
doc:
java -jar $(JSDOC_PATH)/jsrun.jar $(JSDOC_PATH)/app/run.js -a -t=$(JSDOC_PATH)/templates/melonjs $(DEBUG) $(JSDOC_OPTION)
#######################################################################