blob: ed601b7acaaf4f026de8dee6f6f4c891a117bed2 [file] [log] [blame]
Mark Sleeeb0d0242007-01-25 07:58:55 +00001AM_YFLAGS = -d
David Reissdd08f6d2008-06-30 20:24:24 +00002BUILT_SOURCES =
Mark Sleeeb0d0242007-01-25 07:58:55 +00003
4bin_PROGRAMS = thrift
5
6thrift_OBJDIR = obj
7
8thrift_SOURCES = src/thrifty.yy \
9 src/thriftl.ll \
10 src/main.cc \
David Reiss8df6c822008-05-04 03:00:22 +000011 src/md5.c \
Mark Sleeeb0d0242007-01-25 07:58:55 +000012 src/generate/t_generator.cc \
Mark Sleeeb0d0242007-01-25 07:58:55 +000013 src/generate/t_php_generator.cc \
Mark Sleeefd37f12007-11-20 05:13:09 +000014 src/globals.h \
15 src/main.h \
David Reiss204420f2008-01-11 20:59:03 +000016 src/platform.h \
Mark Sleeefd37f12007-11-20 05:13:09 +000017 src/md5.h \
18 src/parse/t_doc.h \
19 src/parse/t_type.h \
20 src/parse/t_base_type.h \
21 src/parse/t_enum.h \
22 src/parse/t_enum_value.h \
23 src/parse/t_typedef.h \
24 src/parse/t_container.h \
25 src/parse/t_list.h \
26 src/parse/t_set.h \
27 src/parse/t_map.h \
28 src/parse/t_struct.h \
29 src/parse/t_field.h \
30 src/parse/t_service.h \
31 src/parse/t_function.h \
32 src/parse/t_program.h \
33 src/parse/t_scope.h \
34 src/parse/t_const.h \
35 src/parse/t_const_value.h \
36 src/generate/t_generator.h \
David Reissbba69282009-02-17 20:28:28 +000037 src/generate/t_oop_generator.h
iproctor9a41a0c2007-07-16 21:59:24 +000038
David Reiss22585732008-02-27 01:55:33 +000039if THRIFT_GEN_cpp
40thrift_SOURCES += src/generate/t_cpp_generator.cc
41endif
David Reisse8a87de2008-02-27 02:39:25 +000042if THRIFT_GEN_java
43thrift_SOURCES += src/generate/t_java_generator.cc
44endif
David Reissce4f4f02008-03-27 21:41:31 +000045if THRIFT_GEN_csharp
46thrift_SOURCES += src/generate/t_csharp_generator.cc
47endif
David Reissbfd26dc2008-03-27 21:41:49 +000048if THRIFT_GEN_py
49thrift_SOURCES += src/generate/t_py_generator.cc
50endif
David Reissae253582008-03-27 21:42:11 +000051if THRIFT_GEN_rb
52thrift_SOURCES += src/generate/t_rb_generator.cc
53endif
David Reissfdc21aa2008-03-27 21:42:34 +000054if THRIFT_GEN_perl
55thrift_SOURCES += src/generate/t_perl_generator.cc
56endif
David Reissf3b0db32009-02-17 20:28:01 +000057if THRIFT_GEN_erl
58thrift_SOURCES += src/generate/t_erl_generator.cc
59endif
David Reiss4b349aa2008-03-27 21:41:02 +000060if THRIFT_GEN_cocoa
61thrift_SOURCES += src/generate/t_cocoa_generator.cc
62endif
David Reissb3ac8a62008-03-27 21:40:42 +000063if THRIFT_GEN_st
64thrift_SOURCES += src/generate/t_st_generator.cc
65endif
David Reiss3d671b52008-03-27 21:40:11 +000066if THRIFT_GEN_ocaml
67thrift_SOURCES += src/generate/t_ocaml_generator.cc
68endif
David Reiss22812f82008-03-27 21:40:26 +000069if THRIFT_GEN_hs
70thrift_SOURCES += src/generate/t_hs_generator.cc
71endif
David Reiss782cb672009-02-17 20:28:13 +000072if THRIFT_GEN_xsd
73thrift_SOURCES += src/generate/t_xsd_generator.cc
74endif
David Reissdc0aada2008-10-21 00:09:23 +000075if THRIFT_GEN_html
76thrift_SOURCES += src/generate/t_html_generator.cc
77endif
David Reiss22585732008-02-27 01:55:33 +000078
David Reiss832b2622007-12-28 18:25:33 +000079thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS)
Mark Slee58dfb4f2007-07-06 02:45:25 +000080thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS)
Mark Sleeeb0d0242007-01-25 07:58:55 +000081
82thrift_LDADD = @LEXLIB@
83
David Reiss832b2622007-12-28 18:25:33 +000084EXTRA_DIST = README
David Reissb72d19f2007-09-18 19:46:00 +000085
Mark Sleeeb0d0242007-01-25 07:58:55 +000086clean-local:
David Reiss466b3fa2008-11-20 21:24:32 +000087 $(RM) thriftl.cc thrifty.cc thrifty.h version.h
David Reissdd08f6d2008-06-30 20:24:24 +000088
89src/main.cc: version.h
90
91# Adding this to BUILT_SOURCES will cause version.h to be
92# regenerated on every "make all" or "make check", which is
93# necessary because it changes whenever we "svn up" or similar.
94# Ideally, we would like this to be regenerated whenever the
95# compiler is rebuilt, but every way we could think of to do
96# that caused unnecessary rebuilds of the compiler.
97BUILT_SOURCES += regen_version_h
98
99THRIFT_VERSION=$(shell /bin/sh $(top_srcdir)/print_version.sh -v)
100THRIFT_REVISION=$(shell /bin/sh $(top_srcdir)/print_version.sh -r)
101
102regen_version_h:
David Reiss4d8edc52008-06-30 21:55:52 +0000103 @printf "Regenerating version.h... "
David Reissdd08f6d2008-06-30 20:24:24 +0000104 @TMPFILE=`mktemp ./version_h.tmp_XXXXXX` ; \
105 echo "// AUTOGENERATED, DO NOT EDIT" > $$TMPFILE ; \
David Reissaabfa632008-06-30 22:27:29 +0000106 echo '#define THRIFT_VERSION "$(THRIFT_VERSION)"' >> $$TMPFILE ; \
107 echo '#define THRIFT_REVISION "$(THRIFT_REVISION)"' >> $$TMPFILE ; \
David Reissdd08f6d2008-06-30 20:24:24 +0000108 if cmp $$TMPFILE version.h >/dev/null ; \
109 then \
110 rm -f $$TMPFILE ; \
111 echo "No changes." ; \
112 else \
113 mv $$TMPFILE version.h ; \
114 echo "Updated." ; \
115 fi