blob: 132462ca35f20d506a56087124b0d123bdf575a9 [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 Slee2c44d202007-05-16 02:18:07 +000014 src/generate/t_xsd_generator.cc \
David Reiss9f2a5d72008-06-11 01:15:45 +000015 src/generate/t_erl_generator.cc \
Mark Sleeefd37f12007-11-20 05:13:09 +000016 src/globals.h \
17 src/main.h \
David Reiss204420f2008-01-11 20:59:03 +000018 src/platform.h \
Mark Sleeefd37f12007-11-20 05:13:09 +000019 src/md5.h \
20 src/parse/t_doc.h \
21 src/parse/t_type.h \
22 src/parse/t_base_type.h \
23 src/parse/t_enum.h \
24 src/parse/t_enum_value.h \
25 src/parse/t_typedef.h \
26 src/parse/t_container.h \
27 src/parse/t_list.h \
28 src/parse/t_set.h \
29 src/parse/t_map.h \
30 src/parse/t_struct.h \
31 src/parse/t_field.h \
32 src/parse/t_service.h \
33 src/parse/t_function.h \
34 src/parse/t_program.h \
35 src/parse/t_scope.h \
36 src/parse/t_const.h \
37 src/parse/t_const_value.h \
38 src/generate/t_generator.h \
39 src/generate/t_oop_generator.h \
Mark Sleeefd37f12007-11-20 05:13:09 +000040 src/generate/t_php_generator.h \
David Reiss9f16d782009-02-17 20:27:58 +000041 src/generate/t_xsd_generator.h
iproctor9a41a0c2007-07-16 21:59:24 +000042
David Reiss22585732008-02-27 01:55:33 +000043if THRIFT_GEN_cpp
44thrift_SOURCES += src/generate/t_cpp_generator.cc
45endif
David Reisse8a87de2008-02-27 02:39:25 +000046if THRIFT_GEN_java
47thrift_SOURCES += src/generate/t_java_generator.cc
48endif
David Reissce4f4f02008-03-27 21:41:31 +000049if THRIFT_GEN_csharp
50thrift_SOURCES += src/generate/t_csharp_generator.cc
51endif
David Reissbfd26dc2008-03-27 21:41:49 +000052if THRIFT_GEN_py
53thrift_SOURCES += src/generate/t_py_generator.cc
54endif
David Reissae253582008-03-27 21:42:11 +000055if THRIFT_GEN_rb
56thrift_SOURCES += src/generate/t_rb_generator.cc
57endif
David Reissfdc21aa2008-03-27 21:42:34 +000058if THRIFT_GEN_perl
59thrift_SOURCES += src/generate/t_perl_generator.cc
60endif
David Reiss4b349aa2008-03-27 21:41:02 +000061if THRIFT_GEN_cocoa
62thrift_SOURCES += src/generate/t_cocoa_generator.cc
63endif
David Reissb3ac8a62008-03-27 21:40:42 +000064if THRIFT_GEN_st
65thrift_SOURCES += src/generate/t_st_generator.cc
66endif
David Reiss3d671b52008-03-27 21:40:11 +000067if THRIFT_GEN_ocaml
68thrift_SOURCES += src/generate/t_ocaml_generator.cc
69endif
David Reiss22812f82008-03-27 21:40:26 +000070if THRIFT_GEN_hs
71thrift_SOURCES += src/generate/t_hs_generator.cc
72endif
David Reissdc0aada2008-10-21 00:09:23 +000073if THRIFT_GEN_html
74thrift_SOURCES += src/generate/t_html_generator.cc
75endif
David Reiss22585732008-02-27 01:55:33 +000076
David Reiss832b2622007-12-28 18:25:33 +000077thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS)
Mark Slee58dfb4f2007-07-06 02:45:25 +000078thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS)
Mark Sleeeb0d0242007-01-25 07:58:55 +000079
80thrift_LDADD = @LEXLIB@
81
David Reiss832b2622007-12-28 18:25:33 +000082EXTRA_DIST = README
David Reissb72d19f2007-09-18 19:46:00 +000083
Mark Sleeeb0d0242007-01-25 07:58:55 +000084clean-local:
David Reiss466b3fa2008-11-20 21:24:32 +000085 $(RM) thriftl.cc thrifty.cc thrifty.h version.h
David Reissdd08f6d2008-06-30 20:24:24 +000086
87src/main.cc: version.h
88
89# Adding this to BUILT_SOURCES will cause version.h to be
90# regenerated on every "make all" or "make check", which is
91# necessary because it changes whenever we "svn up" or similar.
92# Ideally, we would like this to be regenerated whenever the
93# compiler is rebuilt, but every way we could think of to do
94# that caused unnecessary rebuilds of the compiler.
95BUILT_SOURCES += regen_version_h
96
97THRIFT_VERSION=$(shell /bin/sh $(top_srcdir)/print_version.sh -v)
98THRIFT_REVISION=$(shell /bin/sh $(top_srcdir)/print_version.sh -r)
99
100regen_version_h:
David Reiss4d8edc52008-06-30 21:55:52 +0000101 @printf "Regenerating version.h... "
David Reissdd08f6d2008-06-30 20:24:24 +0000102 @TMPFILE=`mktemp ./version_h.tmp_XXXXXX` ; \
103 echo "// AUTOGENERATED, DO NOT EDIT" > $$TMPFILE ; \
David Reissaabfa632008-06-30 22:27:29 +0000104 echo '#define THRIFT_VERSION "$(THRIFT_VERSION)"' >> $$TMPFILE ; \
105 echo '#define THRIFT_REVISION "$(THRIFT_REVISION)"' >> $$TMPFILE ; \
David Reissdd08f6d2008-06-30 20:24:24 +0000106 if cmp $$TMPFILE version.h >/dev/null ; \
107 then \
108 rm -f $$TMPFILE ; \
109 echo "No changes." ; \
110 else \
111 mv $$TMPFILE version.h ; \
112 echo "Updated." ; \
113 fi