| 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 | 
| David Hull | e544a89 | 2017-07-27 02:15:00 +0200 | [diff] [blame] | 21 | THRIFT_OMIT_FILE = test/Thrift_omit_without.thrift | 
| alisdair sullivan | 06d0fa0 | 2014-08-05 19:54:57 -0700 | [diff] [blame] | 22 | THRIFT_FILES = $(wildcard test/*.thrift) \ | 
| David Hull | e544a89 | 2017-07-27 02:15:00 +0200 | [diff] [blame] | 23 | $(THRIFT_OMIT_FILE) \ | 
| David Hull | ec2a252 | 2017-07-28 02:09:42 +0200 | [diff] [blame] | 24 | ../../test/ConstantsDemo.thrift \ | 
| Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 25 | ../../test/NameConflictTest.thrift \ | 
| Ozan Can Altiok | e46419b | 2018-03-20 15:02:28 +0300 | [diff] [blame] | 26 | ../../test/DoubleConstantsTest.thrift \ | 
| Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 27 | ../../test/ThriftTest.thrift | 
| Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 28 |  | 
| Jens Geyer | 57ac33e | 2015-07-28 23:12:10 +0200 | [diff] [blame] | 29 | if ERLANG_OTP16 | 
| Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 30 | ERL_FLAG = erl:otp16 | 
|  | 31 | ERL_FLAG_LEGACY = erl:otp16,legacynames | 
|  | 32 | # otp16 + maps does not make sense. We need to generate it anyway to avoid include error. | 
|  | 33 | ERL_FLAG_MAPS = erl:otp16 | 
| Jens Geyer | 57ac33e | 2015-07-28 23:12:10 +0200 | [diff] [blame] | 34 | else | 
| Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 35 | ERL_FLAG = erl | 
|  | 36 | ERL_FLAG_LEGACY = erl:legacynames | 
|  | 37 | ERL_FLAG_MAPS = erl:maps | 
|  | 38 | endif | 
| David Hull | e544a89 | 2017-07-27 02:15:00 +0200 | [diff] [blame] | 39 |  | 
|  | 40 | $(THRIFT_OMIT_FILE): test/Thrift_omit_with.thrift | 
|  | 41 | grep -v omit $< >$@ | 
|  | 42 |  | 
| Jens Geyer | 57ac33e | 2015-07-28 23:12:10 +0200 | [diff] [blame] | 43 | .generated: $(THRIFT) $(THRIFT_FILES) | 
|  | 44 | for f in $(THRIFT_FILES) ; do \ | 
| Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 45 | $(THRIFT) --gen $(ERL_FLAG) -o test $$f ; \ | 
|  | 46 | done | 
|  | 47 | $(THRIFT) --gen $(ERL_FLAG_LEGACY) -o test test/flags/LegacyNames.thrift | 
|  | 48 | $(THRIFT) --gen $(ERL_FLAG_MAPS) -o test test/flags/Thrift3214.thrift | 
| Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 49 | touch .generated | 
| Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 50 |  | 
|  | 51 | all: .generated | 
| Roger Meier | c7b3086 | 2015-11-14 10:08:33 +0100 | [diff] [blame] | 52 | $(REBAR) get-deps | 
|  | 53 | $(REBAR) compile | 
| Anthony F. Molinaro | 917d898 | 2011-06-21 06:20:18 +0000 | [diff] [blame] | 54 |  | 
|  | 55 | check: .generated | 
| Roger Meier | c7b3086 | 2015-11-14 10:08:33 +0100 | [diff] [blame] | 56 | $(REBAR) -C rebar.test.config get-deps | 
|  | 57 | $(REBAR) -C rebar.test.config compile | 
|  | 58 | $(REBAR) -C rebar.test.config skip_deps=true eunit | 
| Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 59 |  | 
| Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 60 | install: all | 
| Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 61 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift) ; \ | 
|  | 62 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/ebin ; \ | 
|  | 63 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/include ; \ | 
|  | 64 | mkdir -p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/src ; \ | 
|  | 65 | for p in ebin/*.app* ebin/*.beam include/*.hrl src/*.erl ; \ | 
|  | 66 | do $(INSTALL) $$p $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift)/$$p ; \ | 
|  | 67 | done | 
| Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 68 |  | 
|  | 69 | uninstall: | 
| James E. King III | b96c438 | 2019-01-24 17:45:07 -0500 | [diff] [blame] | 70 | $(RM) -rf $(DESTDIR)$(ERLANG_INSTALL_LIB_DIR_thrift) | 
| Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 71 |  | 
| James E. King III | b96c438 | 2019-01-24 17:45:07 -0500 | [diff] [blame] | 72 | clean-local: | 
| Roger Meier | c7b3086 | 2015-11-14 10:08:33 +0100 | [diff] [blame] | 73 | $(REBAR) clean | 
| James E. King III | b96c438 | 2019-01-24 17:45:07 -0500 | [diff] [blame] | 74 | $(RM)    .generated | 
|  | 75 | $(RM) -r .rebar/ | 
|  | 76 | $(RM) -r deps/ | 
|  | 77 | $(RM) -r test/gen-erl/ | 
|  | 78 | $(RM)    $(THRIFT_OMIT_FILE) | 
| Anthony F. Molinaro | a653067 | 2011-09-18 04:57:50 +0000 | [diff] [blame] | 79 |  | 
|  | 80 | maintainer-clean-local: | 
| James E. King III | b96c438 | 2019-01-24 17:45:07 -0500 | [diff] [blame] | 81 | $(RM) -r ebin/ | 
|  | 82 |  | 
|  | 83 | dist-hook: | 
|  | 84 | $(RM)    $(distdir)/.generated | 
|  | 85 | $(RM) -r $(distdir)/.rebar/ | 
|  | 86 | $(RM) -r $(distdir)/deps/ | 
|  | 87 | $(RM) -r $(distdir)/ebin/ | 
|  | 88 | $(RM) -r $(distdir)/test/gen-erl/ | 
|  | 89 | $(RM)    $(distdir)/$(THRIFT_OMIT_FILE) | 
| Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 90 |  | 
| jfarrell | 8fd8c63 | 2014-07-10 09:14:51 -0400 | [diff] [blame] | 91 | EXTRA_DIST = \ | 
| Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 92 | include \ | 
|  | 93 | src \ | 
| jfarrell | f13e431 | 2015-08-25 00:39:29 -0400 | [diff] [blame] | 94 | coding_standards.md \ | 
| Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 95 | rebar.config \ | 
| Jens Geyer | f3a2974 | 2017-11-30 22:30:03 +0100 | [diff] [blame] | 96 | rebar.config.script \ | 
| Nobuaki Sukegawa | e134cbc | 2016-03-18 15:13:36 +0900 | [diff] [blame] | 97 | rebar.test.config \ | 
| Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 98 | test \ | 
|  | 99 | README.md | 
| David Reiss | 653eada | 2010-10-05 02:38:58 +0000 | [diff] [blame] | 100 |  | 
| Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 101 | MAINTAINERCLEANFILES = Makefile.in |