blob: 81913eefd76ebb6d092852ae5c633d0d11ce187c [file] [log] [blame]
alisdair sullivan06d0fa02014-08-05 19:54:57 -07001#
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
alisdair sullivan06d0fa02014-08-05 19:54:57 -070020THRIFT_FILES = $(wildcard ../*.thrift)
21
Nobuaki Sukegawa826ea992015-10-28 22:19:45 +090022if ERLANG_OTP16
23ERL_FLAG = erl:otp16
24else
25ERL_FLAG = erl
26endif
Jens Geyer3a3ba002014-12-30 00:10:06 +010027# make sure ThriftTest.thrift is generated last to prevent conflicts with other *.thrift files
alisdair sullivan06d0fa02014-08-05 19:54:57 -070028.generated: $(THRIFT_FILES)
Jens Geyer79f988c2014-10-03 20:42:54 +020029 for f in $(THRIFT_FILES) ; do \
Nobuaki Sukegawa826ea992015-10-28 22:19:45 +090030 $(THRIFT) --gen $(ERL_FLAG) -o src $$f ; \
Jens Geyer79f988c2014-10-03 20:42:54 +020031 done ; \
Nobuaki Sukegawa826ea992015-10-28 22:19:45 +090032 $(THRIFT) --gen $(ERL_FLAG) -o src ../ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020033 touch .generated
alisdair sullivan06d0fa02014-08-05 19:54:57 -070034
Nobuaki Sukegawa826ea992015-10-28 22:19:45 +090035precross: .generated
36 $(REBAR) compile
alisdair sullivan06d0fa02014-08-05 19:54:57 -070037
James E. King IIIb96c4382019-01-24 17:45:07 -050038maintainer-clean-local:
39 $(RM) -r ebin/
40
alisdair sullivan06d0fa02014-08-05 19:54:57 -070041clean:
Jens Geyer79f988c2014-10-03 20:42:54 +020042 $(REBAR) clean
James E. King IIIb96c4382019-01-24 17:45:07 -050043 $(RM) .generated
44 $(RM) -r .rebar/
45 $(RM) -r src/gen-erl/
46
47dist-hook:
48 $(RM) $(distdir)/.generated
49 $(RM) -r $(distdir)/.rebar/
50 $(RM) -r $(distdir)/ebin/
51 $(RM) -r $(distdir)/src/gen-erl/