blob: 6094452f9c38a5c31be28c660a2c601ee922c928 [file] [log] [blame]
Jens Geyerbd52f1a2014-07-28 01:25:30 +02001#
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
Roger Meier41ad4342015-03-24 22:30:40 +010020THRIFT = $(top_builddir)/compiler/cpp/thrift
Jens Geyerbd52f1a2014-07-28 01:25:30 +020021THRIFTCMD = $(THRIFT) --gen haxe -r
22THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
23
24BIN_CPP = bin/Main-debug
Jens Geyer1d20a372016-03-15 23:04:27 +020025BIN_PHP = bin/php/Main-debug.php
Jens Geyerbd52f1a2014-07-28 01:25:30 +020026
Jens Geyerfea00ac2014-10-01 02:22:48 +020027gen-haxe/thrift/test/ThriftTest.hx: $(THRIFTTEST)
Jens Geyerbd52f1a2014-07-28 01:25:30 +020028 $(THRIFTCMD) $(THRIFTTEST)
Jens Geyerfea00ac2014-10-01 02:22:48 +020029
Jens Geyer1d20a372016-03-15 23:04:27 +020030all-local: $(BIN_CPP) $(BIN_PHP)
Jens Geyerfea00ac2014-10-01 02:22:48 +020031
Jens Geyerbbd6fd72015-05-30 19:33:44 +020032$(BIN_CPP): \
33 src/*.hx \
34 ../../lib/haxe/src/org/apache/thrift/**/*.hx \
35 gen-haxe/thrift/test/ThriftTest.hx
Jens Geyerbd52f1a2014-07-28 01:25:30 +020036 $(HAXE) --cwd . cpp.hxml
37
Jens Geyer1d20a372016-03-15 23:04:27 +020038$(BIN_PHP): \
39 src/*.hx \
40 ../../lib/haxe/src/org/apache/thrift/**/*.hx \
41 gen-haxe/thrift/test/ThriftTest.hx
42 $(HAXE) --cwd . php.hxml
43
44
45
Jens Geyerfea00ac2014-10-01 02:22:48 +020046
Jens Geyerbd52f1a2014-07-28 01:25:30 +020047#TODO: other haxe targets
Jens Geyerfea00ac2014-10-01 02:22:48 +020048# $(HAXE) --cwd . csharp
49# $(HAXE) --cwd . flash
50# $(HAXE) --cwd . java
51# $(HAXE) --cwd . javascript
52# $(HAXE) --cwd . neko
Jens Geyerbbd6fd72015-05-30 19:33:44 +020053# $(HAXE) --cwd . python # needs Haxe 3.2.0
Jens Geyerbd52f1a2014-07-28 01:25:30 +020054
55
56clean-local:
57 $(RM) -r gen-haxe bin
58
Jens Geyer1d20a372016-03-15 23:04:27 +020059check: check_cpp check_php
60
61check_cpp: $(BIN_CPP)
Jens Geyer8c8e9c62014-12-29 19:52:47 +010062 timeout 10 $(BIN_CPP) server &
Jens Geyerbd52f1a2014-07-28 01:25:30 +020063 sleep 1
64 $(BIN_CPP) client
Jens Geyer8c8e9c62014-12-29 19:52:47 +010065 sleep 10
Jens Geyerbd52f1a2014-07-28 01:25:30 +020066
Jens Geyer1d20a372016-03-15 23:04:27 +020067check_php: $(BIN_PHP)
68 timeout 10 php -f $(BIN_PHP) server &
69 sleep 1
70 php -f $(BIN_PHP) client
71 sleep 10
72
73
Jens Geyer65e9bde2014-11-11 01:30:02 +010074EXTRA_DIST = \
75 src \
76 cpp.hxml \
77 csharp.hxml \
78 flash.hxml \
79 java.hxml \
80 javascript.hxml \
81 neko.hxml \
82 php.hxml \
83 python.hxml \
84 project.hide \
85 TestClientServer.hxproj \
86 make_all.bat \
87 make_all.sh