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