Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 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 | |
Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 20 | THRIFT = ../../compiler/cpp/thrift |
alisdair sullivan | 06d0fa0 | 2014-08-05 19:54:57 -0700 | [diff] [blame] | 21 | THRIFT_FILES = $(wildcard test/*.thrift) \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 22 | ../../test/ThriftTest.thrift |
Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 23 | |
Jens Geyer | 57ac33e | 2015-07-28 23:12:10 +0200 | [diff] [blame] | 24 | if ERLANG_OTP16 |
| 25 | .generated: $(THRIFT) $(THRIFT_FILES) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 26 | for f in $(THRIFT_FILES) ; do \ |
Jens Geyer | 57ac33e | 2015-07-28 23:12:10 +0200 | [diff] [blame] | 27 | $(THRIFT) --gen erl:otp16 -o test $$f ; \ |
| 28 | done ; |
| 29 | else |
| 30 | .generated: $(THRIFT) $(THRIFT_FILES) |
| 31 | for f in $(THRIFT_FILES) ; do \ |
| 32 | $(THRIFT) --gen erl -o test $$f ; \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 33 | done ; \ |
Jens Geyer | 5cf9d77 | 2015-07-02 21:01:52 +0200 | [diff] [blame] | 34 | $(THRIFT) --gen erl:maps -o test test/Thrift3214.thrift ; \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 35 | touch .generated |
Jens Geyer | 57ac33e | 2015-07-28 23:12:10 +0200 | [diff] [blame] | 36 | endif |
Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 37 | |
| 38 | all: .generated |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 39 | ./rebar get-deps |
| 40 | ./rebar compile |
Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 41 | |
| 42 | check: .generated |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 43 | ./rebar skip_deps=true eunit |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 44 | |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 45 | install: all |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 46 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift) ; \ |
| 47 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/ebin ; \ |
| 48 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/include ; \ |
| 49 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/src ; \ |
| 50 | for p in ebin/*.app* ebin/*.beam include/*.hrl src/*.erl ; \ |
| 51 | do $(INSTALL) $$p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/$$p ; \ |
| 52 | done |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 53 | |
| 54 | uninstall: |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 55 | rm -rf $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift) |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 56 | |
Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 57 | clean: |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 58 | rm -f .generated |
| 59 | rm -rf test/gen-erl/ |
| 60 | ./rebar clean |
Anthony F. Molinaro | a653067 | 2011-09-18 04:57:50 +0000 | [diff] [blame] | 61 | |
| 62 | maintainer-clean-local: |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 63 | rm -rf ebin |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 64 | |
jfarrell | 8fd8c63 | 2014-07-10 09:14:51 -0400 | [diff] [blame] | 65 | EXTRA_DIST = \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 66 | include \ |
| 67 | src \ |
| 68 | rebar \ |
| 69 | rebar.config \ |
| 70 | test \ |
| 71 | README.md |
David Reiss | 653eada | 2010-10-05 02:38:58 +0000 | [diff] [blame] | 72 | |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 73 | MAINTAINERCLEANFILES = Makefile.in |