blob: 4fc4637277e6be566e2f7e97fcc9beb7c641c879 [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 \
37 src/generate/t_oop_generator.h \
David Reiss3ac5b6a2009-02-17 20:28:10 +000038 src/generate/t_php_generator.h
iproctor9a41a0c2007-07-16 21:59:24 +000039
David Reiss22585732008-02-27 01:55:33 +000040if THRIFT_GEN_cpp
41thrift_SOURCES += src/generate/t_cpp_generator.cc
42endif
David Reisse8a87de2008-02-27 02:39:25 +000043if THRIFT_GEN_java
44thrift_SOURCES += src/generate/t_java_generator.cc
45endif
David Reissce4f4f02008-03-27 21:41:31 +000046if THRIFT_GEN_csharp
47thrift_SOURCES += src/generate/t_csharp_generator.cc
48endif
David Reissbfd26dc2008-03-27 21:41:49 +000049if THRIFT_GEN_py
50thrift_SOURCES += src/generate/t_py_generator.cc
51endif
David Reissae253582008-03-27 21:42:11 +000052if THRIFT_GEN_rb
53thrift_SOURCES += src/generate/t_rb_generator.cc
54endif
David Reissfdc21aa2008-03-27 21:42:34 +000055if THRIFT_GEN_perl
56thrift_SOURCES += src/generate/t_perl_generator.cc
57endif
David Reissf3b0db32009-02-17 20:28:01 +000058if THRIFT_GEN_erl
59thrift_SOURCES += src/generate/t_erl_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 Reiss782cb672009-02-17 20:28:13 +000073if THRIFT_GEN_xsd
74thrift_SOURCES += src/generate/t_xsd_generator.cc
75endif
David Reissdc0aada2008-10-21 00:09:23 +000076if THRIFT_GEN_html
77thrift_SOURCES += src/generate/t_html_generator.cc
78endif
David Reiss22585732008-02-27 01:55:33 +000079
David Reiss832b2622007-12-28 18:25:33 +000080thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS)
Mark Slee58dfb4f2007-07-06 02:45:25 +000081thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS)
Mark Sleeeb0d0242007-01-25 07:58:55 +000082
83thrift_LDADD = @LEXLIB@
84
David Reiss832b2622007-12-28 18:25:33 +000085EXTRA_DIST = README
David Reissb72d19f2007-09-18 19:46:00 +000086
Mark Sleeeb0d0242007-01-25 07:58:55 +000087clean-local:
David Reiss466b3fa2008-11-20 21:24:32 +000088 $(RM) thriftl.cc thrifty.cc thrifty.h version.h
David Reissdd08f6d2008-06-30 20:24:24 +000089
90src/main.cc: version.h
91
92# Adding this to BUILT_SOURCES will cause version.h to be
93# regenerated on every "make all" or "make check", which is
94# necessary because it changes whenever we "svn up" or similar.
95# Ideally, we would like this to be regenerated whenever the
96# compiler is rebuilt, but every way we could think of to do
97# that caused unnecessary rebuilds of the compiler.
98BUILT_SOURCES += regen_version_h
99
100THRIFT_VERSION=$(shell /bin/sh $(top_srcdir)/print_version.sh -v)
101THRIFT_REVISION=$(shell /bin/sh $(top_srcdir)/print_version.sh -r)
102
103regen_version_h:
David Reiss4d8edc52008-06-30 21:55:52 +0000104 @printf "Regenerating version.h... "
David Reissdd08f6d2008-06-30 20:24:24 +0000105 @TMPFILE=`mktemp ./version_h.tmp_XXXXXX` ; \
106 echo "// AUTOGENERATED, DO NOT EDIT" > $$TMPFILE ; \
David Reissaabfa632008-06-30 22:27:29 +0000107 echo '#define THRIFT_VERSION "$(THRIFT_VERSION)"' >> $$TMPFILE ; \
108 echo '#define THRIFT_REVISION "$(THRIFT_REVISION)"' >> $$TMPFILE ; \
David Reissdd08f6d2008-06-30 20:24:24 +0000109 if cmp $$TMPFILE version.h >/dev/null ; \
110 then \
111 rm -f $$TMPFILE ; \
112 echo "No changes." ; \
113 else \
114 mv $$TMPFILE version.h ; \
115 echo "Updated." ; \
116 fi