blob: 1f65a242919372dd79172b00968c7941eddb842a [file] [log] [blame]
Bryan Duxbury7173bd92010-05-02 22:54:22 +00001#
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
Anthony F. Molinaro917d8982011-06-21 06:20:18 +000020THRIFT = ../../compiler/cpp/thrift
alisdair sullivan06d0fa02014-08-05 19:54:57 -070021THRIFT_FILES = $(wildcard test/*.thrift) \
Jens Geyer79f988c2014-10-03 20:42:54 +020022 ../../test/ThriftTest.thrift
Anthony F. Molinaro917d8982011-06-21 06:20:18 +000023
24.generated: $(THRIFT_FILES)
Jens Geyer79f988c2014-10-03 20:42:54 +020025 for f in $(THRIFT_FILES) ; do \
26 $(THRIFT) --gen erl -o test $$f ; \
27 done ; \
Jens Geyer5cf9d772015-07-02 21:01:52 +020028 $(THRIFT) --gen erl:maps -o test test/Thrift3214.thrift ; \
Jens Geyer79f988c2014-10-03 20:42:54 +020029 touch .generated
Anthony F. Molinaro917d8982011-06-21 06:20:18 +000030
31all: .generated
Jens Geyer79f988c2014-10-03 20:42:54 +020032 ./rebar get-deps
33 ./rebar compile
Anthony F. Molinaro917d8982011-06-21 06:20:18 +000034
35check: .generated
Jens Geyer79f988c2014-10-03 20:42:54 +020036 ./rebar skip_deps=true eunit
Bryan Duxbury7173bd92010-05-02 22:54:22 +000037
Bryan Duxbury7173bd92010-05-02 22:54:22 +000038install: all
Jens Geyer79f988c2014-10-03 20:42:54 +020039 mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift) ; \
40 mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/ebin ; \
41 mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/include ; \
42 mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/src ; \
43 for p in ebin/*.app* ebin/*.beam include/*.hrl src/*.erl ; \
44 do $(INSTALL) $$p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/$$p ; \
45 done
Bryan Duxbury7173bd92010-05-02 22:54:22 +000046
47uninstall:
Jens Geyer79f988c2014-10-03 20:42:54 +020048 rm -rf $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)
Bryan Duxbury7173bd92010-05-02 22:54:22 +000049
Anthony F. Molinaro917d8982011-06-21 06:20:18 +000050clean:
Jens Geyer79f988c2014-10-03 20:42:54 +020051 rm -f .generated
52 rm -rf test/gen-erl/
53 ./rebar clean
Anthony F. Molinaroa6530672011-09-18 04:57:50 +000054
55maintainer-clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +020056 rm -rf ebin
Bryan Duxbury7173bd92010-05-02 22:54:22 +000057
jfarrell8fd8c632014-07-10 09:14:51 -040058EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +020059 include \
60 src \
61 rebar \
62 rebar.config \
63 test \
64 README.md
David Reiss653eada2010-10-05 02:38:58 +000065
Bryan Duxbury7173bd92010-05-02 22:54:22 +000066MAINTAINERCLEANFILES = Makefile.in