forked from HaxeFoundation/haxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
190 lines (131 loc) · 6.14 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Haxe compiler Makefile
#
# - use 'make' to build all
# - use 'make haxe' to build only the compiler (not the libraries)
# - if you want to build quickly, install 'ocamlopt.opt' and change OCAMLOPT=ocamlopt.top
#
# Windows users :
# - use 'make -f Makefile.win' to build for Windows
# - use 'make MSVC=1 -f Makefile.win' to build for Windows with OCaml/MSVC
#
.SUFFIXES : .ml .mli .cmo .cmi .cmx .mll .mly
INSTALL_DIR=/usr
OUTPUT=haxe
EXTENSION=
OCAMLOPT=ocamlopt
OCAMLC=ocamlc
CFLAGS= -g -I libs/extlib -I libs/extc -I libs/neko -I libs/javalib -I libs/ziplib -I libs/swflib -I libs/xml-light -I libs/ttflib -I libs/ilib -I libs/objsize
CC_CMD = $(OCAMLOPT) $(CFLAGS) -c $<
CC_PARSER_CMD = $(OCAMLOPT) -pp camlp4o $(CFLAGS) -c parser.ml
LIBS=unix.cmxa str.cmxa libs/extlib/extLib.cmxa libs/xml-light/xml-light.cmxa libs/swflib/swflib.cmxa \
libs/extc/extc.cmxa libs/neko/neko.cmxa libs/javalib/java.cmxa libs/ziplib/zip.cmxa \
libs/ttflib/ttf.cmxa libs/ilib/il.cmxa libs/objsize/objsize.cmxa
NATIVE_LIBS=-cclib libs/extc/extc_stubs.o -cclib -lz -cclib libs/objsize/c_objsize.o
RELDIR=../../..
EXPORT=../../../projects/motionTools/haxe
MODULES=ast type lexer common genxml parser typecore optimizer typeload \
codegen gencommon genas3 gencpp genjs genneko genphp genswf8 \
genswf9 genswf genjava gencs interp dce filters typer matcher version main
ADD_REVISION=0
export HAXE_STD_PATH=$(CURDIR)/std
ifneq ($(ADD_REVISION),0)
VERSION_EXTRA="let version_extra = Some \" (git build $(shell git rev-parse --abbrev-ref HEAD) @ $(shell git describe --always)) \""
else
VERSION_EXTRA="let version_extra = None"
endif
all: libs haxe
version.cmx:
echo $(VERSION_EXTRA) > version.ml
$(OCAMLOPT) $(CFLAGS) -c version.ml
libs:
make -C libs/extlib opt OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/extc native OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/neko OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/javalib OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/ilib OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/ziplib OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/swflib OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/xml-light xml-light.cmxa OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/ttflib OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
make -C libs/objsize OCAMLOPT=$(OCAMLOPT) OCAMLC=$(OCAMLC)
haxe: $(MODULES:=.cmx)
$(OCAMLOPT) -o $(OUTPUT) $(NATIVE_LIBS) $(LIBS) $(MODULES:=.cmx)
haxelib:
$(CURDIR)/$(OUTPUT) --cwd "$(CURDIR)/std/tools/haxelib" haxelib.hxml
cp std/tools/haxelib/haxelib$(EXTENSION) haxelib$(EXTENSION)
haxedoc:
$(CURDIR)/$(OUTPUT) --cwd "$(CURDIR)/std/tools/haxedoc" haxedoc.hxml
cp std/tools/haxedoc/haxedoc$(EXTENSION) haxedoc$(EXTENSION)
tools: haxelib haxedoc
install:
cp haxe $(INSTALL_DIR)/bin/haxe
rm -rf $(INSTALL_DIR)/lib/haxe/std
-mkdir -p $(INSTALL_DIR)/lib/haxe
cp -rf std $(INSTALL_DIR)/lib/haxe/std
-mkdir -p $(INSTALL_DIR)/lib/haxe/lib
chmod -R a+rx $(INSTALL_DIR)/lib/haxe
chmod 777 $(INSTALL_DIR)/lib/haxe/lib
cp std/tools/haxelib/haxelib.sh $(INSTALL_DIR)/bin/haxelib
cp std/tools/haxedoc/haxedoc.sh $(INSTALL_DIR)/bin/haxedoc
chmod a+rx $(INSTALL_DIR)/bin/haxe $(INSTALL_DIR)/bin/haxelib $(INSTALL_DIR)/bin/haxedoc
# will install native version of the tools instead of script ones
install_tools: tools
cp haxelib ${INSTALL_DIR}/bin/haxelib
cp haxedoc ${INSTALL_DIR}/bin/haxedoc
chmod a+rx $(INSTALL_DIR)/bin/haxelib $(INSTALL_DIR)/bin/haxedoc
uninstall:
rm -rf $(INSTALL_DIR)/bin/haxe $(INSTALL_DIR)/bin/haxelib $(INSTALL_DIR)/lib/haxe $(INSTALL_DIR)/bin/haxedoc
export:
cp haxe*.exe doc/CHANGES.txt $(EXPORT)
rsync -a --exclude .svn --exclude *.n --exclude std/libs --delete std $(EXPORT)
codegen.cmx: optimizer.cmx typeload.cmx typecore.cmx type.cmx genxml.cmx common.cmx ast.cmx
common.cmx: type.cmx ast.cmx
dce.cmx: ast.cmx common.cmx codegen.cmx type.cmx
filters.cmx: ast.cmx common.cmx type.cmx dce.cmx codegen.cmx typecore.cmx
genas3.cmx: type.cmx common.cmx codegen.cmx ast.cmx
gencommon.cmx: type.cmx common.cmx codegen.cmx ast.cmx
gencpp.cmx: type.cmx lexer.cmx common.cmx codegen.cmx ast.cmx
gencs.cmx: type.cmx lexer.cmx gencommon.cmx common.cmx codegen.cmx ast.cmx
genjava.cmx: type.cmx gencommon.cmx common.cmx codegen.cmx ast.cmx
genjs.cmx: type.cmx optimizer.cmx lexer.cmx common.cmx codegen.cmx ast.cmx
genneko.cmx: type.cmx lexer.cmx common.cmx codegen.cmx ast.cmx
genphp.cmx: type.cmx lexer.cmx common.cmx codegen.cmx ast.cmx
genswf.cmx: type.cmx genswf9.cmx genswf8.cmx common.cmx ast.cmx
genswf8.cmx: type.cmx lexer.cmx common.cmx codegen.cmx ast.cmx
genswf9.cmx: type.cmx lexer.cmx genswf8.cmx common.cmx codegen.cmx ast.cmx
genxml.cmx: type.cmx lexer.cmx common.cmx ast.cmx
interp.cmx: typecore.cmx type.cmx lexer.cmx genneko.cmx common.cmx codegen.cmx ast.cmx genswf.cmx genjava.cmx parser.cmx
matcher.cmx: optimizer.cmx codegen.cmx typecore.cmx type.cmx typer.cmx common.cmx ast.cmx
main.cmx: filters.cmx matcher.cmx typer.cmx typeload.cmx typecore.cmx type.cmx parser.cmx optimizer.cmx lexer.cmx interp.cmx genxml.cmx genswf.cmx genphp.cmx genneko.cmx genjs.cmx gencpp.cmx genas3.cmx common.cmx codegen.cmx ast.cmx gencommon.cmx genjava.cmx gencs.cmx version.cmx
optimizer.cmx: typecore.cmx type.cmx parser.cmx common.cmx ast.cmx
parser.cmx: parser.ml lexer.cmx common.cmx ast.cmx
$(CC_PARSER_CMD)
type.cmx: ast.cmx
typecore.cmx: type.cmx common.cmx ast.cmx
typeload.cmx: typecore.cmx type.cmx parser.cmx optimizer.cmx lexer.cmx common.cmx ast.cmx
typer.cmx: typeload.cmx typecore.cmx type.cmx parser.cmx optimizer.cmx lexer.cmx interp.cmx genneko.cmx genjs.cmx common.cmx codegen.cmx ast.cmx filters.cmx
lexer.cmx: lexer.ml
lexer.cmx: ast.cmx
clean: clean_libs clean_haxe clean_tools
clean_libs:
make -C libs/extlib clean
make -C libs/extc clean
make -C libs/neko clean
make -C libs/ziplib clean
make -C libs/javalib clean
make -C libs/ilib clean
make -C libs/swflib clean
make -C libs/xml-light clean
make -C libs/ttflib clean
clean_haxe:
rm -f $(MODULES:=.obj) $(MODULES:=.o) $(MODULES:=.cmx) $(MODULES:=.cmi) lexer.ml haxe.exe
clean_tools:
rm -f $(OUTPUT) haxelib haxedoc
# SUFFIXES
.ml.cmx:
$(CC_CMD)
.mli.cmi:
$(CC_CMD)
.mll.ml:
ocamllex $<
.PHONY: haxe libs version.cmx