forked from turbulenz/turbulenz_engine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
164 lines (130 loc) · 4.77 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
BUILDDIR := external/tzbuild
ifeq (,$(wildcard $(BUILDDIR)/config.mk))
$(error Have you updated all submodules to include tzbuild?)
endif
include $(BUILDDIR)/config.mk
# $(warning TARGET=$(TARGET))
# $(warning TARGETNAME=$(TARGETNAME))
# $(warning CONFIG=$(CONFIG))
# $(warning MAKEFLAGS=$(MAKEFLAGS))
# $(warning MAKECMDGOALS=$(MAKECMDGOALS))
############################################################
help:
@echo ""
@echo "Usage:"
@echo ""
@echo " make [<flags>] <targets>"
@echo ""
@echo "Targets:"
@echo ""
@echo "jslib"
############################################################
# TSLIB build modules
############################################################
MODULAR ?= 0
REFCHECK ?= 0
TS_MODULAR ?= $(MODULAR)
TS_REFCHECK ?= $(REFCHECK)
TS_OUTPUT_DIR := jslib$(if $(filter $(MODULAR),1),-modular)
TS_OUTPUT_DIR := $(TS_OUTPUT_DIR)$(if $(filter $(REFCHECK),1),-refcheck)
TS_SRC_DIR := tslib
# platform
platform_src := $(TS_SRC_DIR)/base.d.ts $(TS_SRC_DIR)/turbulenz.d.ts
# debug
debug_src := $(TS_SRC_DIR)/debug.ts
# vmath
vmath_src := $(TS_SRC_DIR)/vmath.ts
vmath_deps := platform debug
# AABBTree
aabbtree_src := $(TS_SRC_DIR)/aabbtree.ts
aabbtree_deps := vmath debug
# physics_canvas
physics_canvas_src := $(TS_SRC_DIR)/webgl/physicsdevice.ts
physics_canvas_deps := aabbtree vmath platform
physics_canvas_nodecls := 1
# platform_canvas - everything in webgl except the physicsdevice
platform_canvas_src := \
$(filter-out %physicsdevice.ts,$(wildcard $(TS_SRC_DIR)/webgl/*.ts))
platform_canvas_tscflags := $(TS_SRC_DIR)/external/webgl.d.ts
platform_canvas_deps := vmath platform
platform_canvas_nodecls := 1
# utilities
utilities_src = $(addprefix $(TS_SRC_DIR)/, \
observer.ts requesthandler.ts utilities.ts)
utilities_deps := platform
# servicestypes
servicedatatypes_src := $(TS_SRC_DIR)/services/servicedatatypes.d.ts
# services
services_src := $(wildcard $(TS_SRC_DIR)/services/*.ts)
services_deps := utilities debug servicedatatypes
# tzdraw2d
tzdraw2d_src := $(TS_SRC_DIR)/draw2d.ts
tzdraw2d_deps = platform
# physics2d
physics2d_src := $(addprefix $(TS_SRC_DIR)/, \
physics2ddevice.ts physics2ddebugdraw.ts boxtree.ts)
physics2d_deps := platform debug
# fontmanager
fontmanager_src := $(TS_SRC_DIR)/fontmanager.ts
fontmanager_deps := platform utilities debug
# canvas
canvas_src := $(TS_SRC_DIR)/canvas.ts
canvas_deps := platform fontmanager
# jsengine_base
jsengine_base_src := $(addprefix $(TS_SRC_DIR)/, \
assetcache.ts assettracker.ts camera.ts charactercontroller.ts \
indexbuffermanager.ts soundmanager.ts texturemanager.ts \
vertexbuffermanager.ts shadermanager.ts)
jsengine_base_deps := platform utilities debug
# jsengine
jsengine_src := $(addprefix $(TS_SRC_DIR)/, \
animation.ts animationmanager.ts defaultrendering.ts loadingscreen.ts \
effectmanager.ts material.ts floor.ts geometry.ts \
light.ts mouseforces.ts physicsmanager.ts posteffects.ts renderingcommon.ts \
resourceloader.ts scene.ts scenenode.ts shadowmapping.ts textureeffects.ts \
)
jsengine_deps := services aabbtree jsengine_base
# jsengine_simplerendering
jsengine_simplerendering_src := $(TS_SRC_DIR)/simplerendering.ts
jsengine_simplerendering_deps := jsengine
# jsengine_deferredrendering
jsengine_deferredrendering_src := $(TS_SRC_DIR)/deferredrendering.ts
jsengine_deferredrendering_deps := jsengine
# jsengine_forwardrendering
jsengine_forwardrendering_src := $(TS_SRC_DIR)/forwardrendering.ts
jsengine_forwardrendering_deps := jsengine
# jsengine_debug
jsengine_debug_src := $(addprefix $(TS_SRC_DIR)/, \
drawprimitives.ts debuggingtools.ts networklatencysimulator.ts \
scenedebugging.ts) \
$(wildcard $(TS_SRC_DIR)/dump*.ts)
jsengine_debug_deps := jsengine
# capturedevices
capturedevices_src := tslib/capturegraphicsdevice.ts
capturedevices_deps := platform debug
TSLIBS += platform debug vmath aabbtree physics_canvas platform_canvas \
utilities services tzdraw2d physics2d fontmanager canvas jsengine_base \
jsengine jsengine_simplerendering jsengine_deferredrendering \
jsengine_forwardrendering jsengine_debug capturedevices
# Check we haven't forgotten any tslib files
ifeq (macosx,$(TARGET))
all_ts_files := $(shell find tslib -iname '[^\.]*.ts' | grep -v external)
all_ts_src_files := \
$(TS_BASE_FILES) $(foreach tsl,$(TSLIBS),$($(tsl)_src))
forgotten_ts_files := $(filter-out $(all_ts_src_files),$(all_ts_files))
ifneq (,$(forgotten_ts_files))
$(error THESE FILES ARE NOT USED: $(forgotten_ts_files))
endif
endif
############################################################
# Temporary hack to prevent C rules being included since they don't
# work under pymake.
ifeq (jslib,$(MAKECMDGOALS))
APPS:=
LIBS:=
DLLS:=
endif
# EXT, LIBS, APPS are used to set up all build rules ...
include $(BUILDDIR)/rules.mk
CMDPRE:=$(CMDPREFIX)
.PHONY : projects