-
Notifications
You must be signed in to change notification settings - Fork 83
/
makefile
63 lines (46 loc) · 1.94 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
# ?= means the variable can be overridden from the command line like:
# make UGLIFY=./node_modules/.bin/uglify min
# This makefile requires: babel, uglifyjs and fswatch.
# fswatch runs make automatically if a file changes
#Hexi core source file
CORE_ES6 ?= src/core.js
#Hexi core output file
CORE_ES5 ?= bin/core.js
#Pixi
PIXI ?= src/modules/pixi.js/bin/pixi.js
#The individual modules (Not including PIXI)
BUMP ?= src/modules/bump/bin/bump.js
SOUND ?= src/modules/sound.js/sound.js
SCALE_TO_WINDOW ?= src/modules/scaleToWindow/scaleToWindow.js
CHARM ?= src/modules/charm/bin/charm.js
TINK ?= src/modules/tink/bin/tink.js
DUST ?= src/modules/dust/bin/dust.js
SPRITE_UTILITIES ?= src/modules/spriteUtilities/bin/spriteUtilities.js
GAME_UTILITIES ?= src/modules/gameUtilities/bin/gameUtilities.js
SMOOTHIE ?= src/modules/smoothie/bin/smoothie.js
TILE_UTILITIES ?= src/modules/tileUtilities/bin/tileUtilities.js
#The experimental fullscreen feature has been removed for now
#FULLSCREEN ?= src/modules/fullScreen/bin/fullScreen.js
#Concatenated modules
ES5_MODULES := ${SOUND} $(SCALE_TO_WINDOW) ${BUMP} ${CHARM} ${TINK} ${DUST} ${SPRITE_UTILITIES} ${GAME_UTILITIES} ${SMOOTHIE} ${TILE_UTILITIES}
#The concatenated modules output file (exluding PIXI)
MODULES ?= bin/modules.js
#The total concatenated output of all the files (Including PIXI)
OUTPUT ?= bin/hexi.js
#The minified output file
MINIFIED_OUTPUT ?= bin/hexi.min.js
all: compile concatModules concatAllFiles minify
compile: $(CORE_ES6)
babel $^ --out-file $(CORE_ES5) --source-maps
minify: $(OUTPUT)
uglifyjs $(OUTPUT) --output $(MINIFIED_OUTPUT)
concatModules: $(ES5_MODULES)
cat $^ > $(MODULES)
concatAllFiles:
cat $(PIXI) $(MODULES) $(CORE_ES5) > $(OUTPUT)
watchSrc: $(CORE_ES6)
babel $^ --watch --out-file $(CORE_ES5) --source-maps
watchExamples:
babel examples/src --watch --out-dir examples/bin --source-maps
watchTutorials:
babel tutorials/src --watch --out-dir tutorials/bin --source-maps