blob: 3838facfa9d53a3b674e75908a7ad94164f2668f [file] [log] [blame]
David Reissea2cba82009-03-30 21:35:00 +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
Mark Sleeeb0d0242007-01-25 07:58:55 +000020AM_YFLAGS = -d
David Reissdd08f6d2008-06-30 20:24:24 +000021BUILT_SOURCES =
Mark Sleeeb0d0242007-01-25 07:58:55 +000022
23bin_PROGRAMS = thrift
24
25thrift_OBJDIR = obj
26
27thrift_SOURCES = src/thrifty.yy \
28 src/thriftl.ll \
29 src/main.cc \
David Reiss8df6c822008-05-04 03:00:22 +000030 src/md5.c \
Mark Sleeeb0d0242007-01-25 07:58:55 +000031 src/generate/t_generator.cc \
Mark Sleeefd37f12007-11-20 05:13:09 +000032 src/globals.h \
33 src/main.h \
David Reiss204420f2008-01-11 20:59:03 +000034 src/platform.h \
Mark Sleeefd37f12007-11-20 05:13:09 +000035 src/md5.h \
36 src/parse/t_doc.h \
37 src/parse/t_type.h \
38 src/parse/t_base_type.h \
39 src/parse/t_enum.h \
40 src/parse/t_enum_value.h \
41 src/parse/t_typedef.h \
42 src/parse/t_container.h \
43 src/parse/t_list.h \
44 src/parse/t_set.h \
45 src/parse/t_map.h \
46 src/parse/t_struct.h \
47 src/parse/t_field.h \
48 src/parse/t_service.h \
49 src/parse/t_function.h \
50 src/parse/t_program.h \
51 src/parse/t_scope.h \
52 src/parse/t_const.h \
53 src/parse/t_const_value.h \
54 src/generate/t_generator.h \
David Reissbba69282009-02-17 20:28:28 +000055 src/generate/t_oop_generator.h
iproctor9a41a0c2007-07-16 21:59:24 +000056
David Reiss22585732008-02-27 01:55:33 +000057if THRIFT_GEN_cpp
58thrift_SOURCES += src/generate/t_cpp_generator.cc
59endif
David Reisse8a87de2008-02-27 02:39:25 +000060if THRIFT_GEN_java
61thrift_SOURCES += src/generate/t_java_generator.cc
62endif
David Reissce4f4f02008-03-27 21:41:31 +000063if THRIFT_GEN_csharp
64thrift_SOURCES += src/generate/t_csharp_generator.cc
65endif
David Reissbfd26dc2008-03-27 21:41:49 +000066if THRIFT_GEN_py
67thrift_SOURCES += src/generate/t_py_generator.cc
68endif
David Reissae253582008-03-27 21:42:11 +000069if THRIFT_GEN_rb
70thrift_SOURCES += src/generate/t_rb_generator.cc
71endif
David Reissfdc21aa2008-03-27 21:42:34 +000072if THRIFT_GEN_perl
73thrift_SOURCES += src/generate/t_perl_generator.cc
74endif
David Reiss32272d92009-02-17 20:28:30 +000075if THRIFT_GEN_php
76thrift_SOURCES += src/generate/t_php_generator.cc
77endif
David Reissf3b0db32009-02-17 20:28:01 +000078if THRIFT_GEN_erl
79thrift_SOURCES += src/generate/t_erl_generator.cc
80endif
David Reiss4b349aa2008-03-27 21:41:02 +000081if THRIFT_GEN_cocoa
82thrift_SOURCES += src/generate/t_cocoa_generator.cc
83endif
David Reissb3ac8a62008-03-27 21:40:42 +000084if THRIFT_GEN_st
85thrift_SOURCES += src/generate/t_st_generator.cc
86endif
David Reiss3d671b52008-03-27 21:40:11 +000087if THRIFT_GEN_ocaml
88thrift_SOURCES += src/generate/t_ocaml_generator.cc
89endif
David Reiss22812f82008-03-27 21:40:26 +000090if THRIFT_GEN_hs
91thrift_SOURCES += src/generate/t_hs_generator.cc
92endif
David Reiss782cb672009-02-17 20:28:13 +000093if THRIFT_GEN_xsd
94thrift_SOURCES += src/generate/t_xsd_generator.cc
95endif
David Reissdc0aada2008-10-21 00:09:23 +000096if THRIFT_GEN_html
97thrift_SOURCES += src/generate/t_html_generator.cc
98endif
David Reiss22585732008-02-27 01:55:33 +000099
David Reiss832b2622007-12-28 18:25:33 +0000100thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS)
Mark Slee58dfb4f2007-07-06 02:45:25 +0000101thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS)
Mark Sleeeb0d0242007-01-25 07:58:55 +0000102
103thrift_LDADD = @LEXLIB@
104
David Reiss832b2622007-12-28 18:25:33 +0000105EXTRA_DIST = README
David Reissb72d19f2007-09-18 19:46:00 +0000106
Mark Sleeeb0d0242007-01-25 07:58:55 +0000107clean-local:
David Reiss466b3fa2008-11-20 21:24:32 +0000108 $(RM) thriftl.cc thrifty.cc thrifty.h version.h
David Reissdd08f6d2008-06-30 20:24:24 +0000109
110src/main.cc: version.h
111
112# Adding this to BUILT_SOURCES will cause version.h to be
113# regenerated on every "make all" or "make check", which is
114# necessary because it changes whenever we "svn up" or similar.
115# Ideally, we would like this to be regenerated whenever the
116# compiler is rebuilt, but every way we could think of to do
117# that caused unnecessary rebuilds of the compiler.
118BUILT_SOURCES += regen_version_h
119
120THRIFT_VERSION=$(shell /bin/sh $(top_srcdir)/print_version.sh -v)
121THRIFT_REVISION=$(shell /bin/sh $(top_srcdir)/print_version.sh -r)
122
123regen_version_h:
David Reiss4d8edc52008-06-30 21:55:52 +0000124 @printf "Regenerating version.h... "
David Reissdd08f6d2008-06-30 20:24:24 +0000125 @TMPFILE=`mktemp ./version_h.tmp_XXXXXX` ; \
126 echo "// AUTOGENERATED, DO NOT EDIT" > $$TMPFILE ; \
David Reissaabfa632008-06-30 22:27:29 +0000127 echo '#define THRIFT_VERSION "$(THRIFT_VERSION)"' >> $$TMPFILE ; \
128 echo '#define THRIFT_REVISION "$(THRIFT_REVISION)"' >> $$TMPFILE ; \
David Reissdd08f6d2008-06-30 20:24:24 +0000129 if cmp $$TMPFILE version.h >/dev/null ; \
130 then \
131 rm -f $$TMPFILE ; \
132 echo "No changes." ; \
133 else \
134 mv $$TMPFILE version.h ; \
135 echo "Updated." ; \
136 fi