blob: 1a32185ecd379d756b4ab5575aa798fe3c1b1bb2 [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
Oleksii Prudkyi39a09ac2016-05-19 16:55:11 +030026BIN_PHP_WEB = bin/php-web-server/Main-debug.php
Jens Geyerbd52f1a2014-07-28 01:25:30 +020027
Jens Geyerfea00ac2014-10-01 02:22:48 +020028gen-haxe/thrift/test/ThriftTest.hx: $(THRIFTTEST)
Jens Geyerbd52f1a2014-07-28 01:25:30 +020029 $(THRIFTCMD) $(THRIFTTEST)
Jens Geyerfea00ac2014-10-01 02:22:48 +020030
Oleksii Prudkyi39a09ac2016-05-19 16:55:11 +030031all-local: $(BIN_CPP) $(BIN_PHP) $(BIN_PHP_WEB)
Jens Geyerfea00ac2014-10-01 02:22:48 +020032
Jens Geyerbbd6fd72015-05-30 19:33:44 +020033$(BIN_CPP): \
34 src/*.hx \
35 ../../lib/haxe/src/org/apache/thrift/**/*.hx \
36 gen-haxe/thrift/test/ThriftTest.hx
Jens Geyerbd52f1a2014-07-28 01:25:30 +020037 $(HAXE) --cwd . cpp.hxml
38
Jens Geyer1d20a372016-03-15 23:04:27 +020039$(BIN_PHP): \
40 src/*.hx \
41 ../../lib/haxe/src/org/apache/thrift/**/*.hx \
42 gen-haxe/thrift/test/ThriftTest.hx
43 $(HAXE) --cwd . php.hxml
44
Oleksii Prudkyi39a09ac2016-05-19 16:55:11 +030045$(BIN_PHP_WEB): \
46 src/*.hx \
47 ../../lib/haxe/src/org/apache/thrift/**/*.hx \
48 gen-haxe/thrift/test/ThriftTest.hx
49 $(HAXE) --cwd . php-web-server.hxml
Jens Geyer1d20a372016-03-15 23:04:27 +020050
51
Jens Geyerfea00ac2014-10-01 02:22:48 +020052
Jens Geyerbd52f1a2014-07-28 01:25:30 +020053#TODO: other haxe targets
Jens Geyerfea00ac2014-10-01 02:22:48 +020054# $(HAXE) --cwd . csharp
55# $(HAXE) --cwd . flash
56# $(HAXE) --cwd . java
57# $(HAXE) --cwd . javascript
58# $(HAXE) --cwd . neko
Jens Geyerbbd6fd72015-05-30 19:33:44 +020059# $(HAXE) --cwd . python # needs Haxe 3.2.0
Jens Geyerbd52f1a2014-07-28 01:25:30 +020060
61
62clean-local:
63 $(RM) -r gen-haxe bin
64
Oleksii Prudkyi39a09ac2016-05-19 16:55:11 +030065.NOTPARALLEL:
66
67check: check_cpp \
68 check_php \
69 check_php_web
Jens Geyer1d20a372016-03-15 23:04:27 +020070
71check_cpp: $(BIN_CPP)
Oleksii Prudkyi39a09ac2016-05-19 16:55:11 +030072 timeout 20 $(BIN_CPP) server &
Jens Geyerbd52f1a2014-07-28 01:25:30 +020073 sleep 1
74 $(BIN_CPP) client
Jens Geyer8c8e9c62014-12-29 19:52:47 +010075 sleep 10
Jens Geyerbd52f1a2014-07-28 01:25:30 +020076
Jens Geyer1d20a372016-03-15 23:04:27 +020077check_php: $(BIN_PHP)
Oleksii Prudkyi39a09ac2016-05-19 16:55:11 +030078 timeout 20 php -f $(BIN_PHP) server &
Jens Geyer1d20a372016-03-15 23:04:27 +020079 sleep 1
80 php -f $(BIN_PHP) client
81 sleep 10
82
Oleksii Prudkyi39a09ac2016-05-19 16:55:11 +030083check_php_web: $(BIN_PHP_WEB) $(BIN_CPP)
84 timeout 20 php -S 127.0.0.1:9090 router.php &
85 sleep 1
86 $(BIN_CPP) client --transport http
87 sleep 10
88
Jens Geyer1d20a372016-03-15 23:04:27 +020089
Jens Geyer65e9bde2014-11-11 01:30:02 +010090EXTRA_DIST = \
91 src \
92 cpp.hxml \
93 csharp.hxml \
94 flash.hxml \
95 java.hxml \
96 javascript.hxml \
97 neko.hxml \
98 php.hxml \
99 python.hxml \
100 project.hide \
101 TestClientServer.hxproj \
102 make_all.bat \
103 make_all.sh