forked from exdev/ex2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (51 loc) · 2 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
# ======================================================================================
# File : Makefile
# Author : Wu Jie
# Last Change : 09/10/2011 | 15:00:32 PM | Saturday,September
# Description :
# ======================================================================================
# /////////////////////////////////////////////////////////////////////////////
# general
# /////////////////////////////////////////////////////////////////////////////
# settings
UNITY_PATH = /Applications/Unity/Unity.app/Contents/Frameworks
# unit essential
COMPILER = $(UNITY_PATH)/Mono/bin/gmcs
UNITY_ENGINE_DLL = $(UNITY_PATH)/Managed/UnityEngine.dll
UNITY_VER = UNITY_3_4
# Utilities.
MKDIR = mkdir -p
RM = rm -f
# Target
TARGET_DIR = build
RUNTIME_TARGET = $(TARGET_DIR)/ex2D.Runtime.dll
# /////////////////////////////////////////////////////////////////////////////
# do build
# /////////////////////////////////////////////////////////////////////////////
.PHONY: clean rebuild
all: $(RUNTIME_TARGET)
clean:
$(RM) $(RUNTIME_TARGET)
rebuild: |clean all
# /////////////////////////////////////////////////////////////////////////////
# runtime target
# /////////////////////////////////////////////////////////////////////////////
# get sources
RUNTIME_SOURCE_DIRS += ex2D/Core/Asset/
RUNTIME_SOURCE_DIRS += ex2D/Core/Component/
RUNTIME_SOURCE_DIRS += ex2D/Core/Component/AnimationHelper/
RUNTIME_SOURCE_DIRS += ex2D/Core/Component/Helper/
RUNTIME_SOURCE_DIRS += ex2D/Core/Component/Sprite/
RUNTIME_SOURCE_DIRS += ex2D/Core/Extension/
RUNTIME_SOURCE_DIRS += ex2D/Core/Helper/
RUNTIME_SOURCE = $(wildcard $(addsuffix *.cs,$(RUNTIME_SOURCE_DIRS)))
# defines
RUNTIME_DEFINE = -d:UNITY_3_4
# deubg argument
# RUNTIME_ARGUMENT = $(RUNTIME_DEFINE) -d:DEBUG -r:$(UNITY_ENGINE_DLL)
# release argument
RUNTIME_ARGUMENT = $(RUNTIME_DEFINE) -r:$(UNITY_ENGINE_DLL)
# do the build
$(RUNTIME_TARGET):
$(MKDIR) $(TARGET_DIR)
$(COMPILER) -target:library -out:$(RUNTIME_TARGET) $(RUNTIME_ARGUMENT) $(RUNTIME_SOURCE)