1#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10#   http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
20THRIFTCMD = $(THRIFT) --gen haxe -r
21THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
22AGGR = $(top_srcdir)/contrib/async-test/aggr.thrift
23BENCHMARK = $(top_srcdir)/lib/rb/benchmark/Benchmark.thrift
24
25BIN_CPP = bin/Main-debug
26BIN_PHP = bin/php/Main-debug.php
27
28gen-haxe/thrift/test/ThriftTest.hx: $(THRIFTTEST)
29	$(THRIFTCMD) $(THRIFTTEST)
30
31gen-haxe/thrift/test/Aggr.hx: $(AGGR)
32	$(THRIFTCMD) $(AGGR)
33
34gen-haxe/thrift/test/BenchmarkService.hx: $(BENCHMARK)
35	$(THRIFTCMD) $(BENCHMARK)
36
37all-local: $(BIN_CPP) $(BIN_PHP)
38
39$(BIN_CPP): \
40		src/*.hx \
41		../src/org/apache/thrift/**/*.hx \
42		gen-haxe/thrift/test/ThriftTest.hx \
43		gen-haxe/thrift/test/Aggr.hx \
44		gen-haxe/thrift/test/BenchmarkService.hx
45	$(HAXE) --cwd .  cpp.hxml
46
47$(BIN_PHP): \
48		src/*.hx \
49		../src/org/apache/thrift/**/*.hx \
50		gen-haxe/thrift/test/ThriftTest.hx \
51		gen-haxe/thrift/test/Aggr.hx \
52		gen-haxe/thrift/test/BenchmarkService.hx
53	$(HAXE) --cwd .  php.hxml
54
55
56#TODO: other haxe targets
57#    $(HAXE)  --cwd .  csharp
58#    $(HAXE)  --cwd .  flash
59#    $(HAXE)  --cwd .  java
60#    $(HAXE)  --cwd .  javascript
61#    $(HAXE)  --cwd .  neko
62#    $(HAXE)  --cwd .  python  # needs Haxe 3.2.0
63
64
65clean-local:
66	$(RM) -r gen-haxe bin
67
68check: $(BIN_CPP) $(BIN_PHP)
69	$(BIN_CPP)
70	php -f $(BIN_PHP)
71
72EXTRA_DIST = \
73             src \
74             cpp.hxml \
75             csharp.hxml \
76             flash.hxml \
77             java.hxml \
78             javascript.hxml \
79             neko.hxml \
80             php.hxml \
81             python.hxml \
82             project.hide \
83             HaxeTests.hxproj \
84             make_all.bat \
85             make_all.sh
86