blob: 7a356fd21d94400b1ece62a86ea3b4ae14501cc5 [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 Sleeefd37f12007-11-20 05:13:09 +000013 src/globals.h \
14 src/main.h \
David Reiss204420f2008-01-11 20:59:03 +000015 src/platform.h \
Mark Sleeefd37f12007-11-20 05:13:09 +000016 src/md5.h \
17 src/parse/t_doc.h \
18 src/parse/t_type.h \
19 src/parse/t_base_type.h \
20 src/parse/t_enum.h \
21 src/parse/t_enum_value.h \
22 src/parse/t_typedef.h \
23 src/parse/t_container.h \
24 src/parse/t_list.h \
25 src/parse/t_set.h \
26 src/parse/t_map.h \
27 src/parse/t_struct.h \
28 src/parse/t_field.h \
29 src/parse/t_service.h \
30 src/parse/t_function.h \
31 src/parse/t_program.h \
32 src/parse/t_scope.h \
33 src/parse/t_const.h \
34 src/parse/t_const_value.h \
35 src/generate/t_generator.h \
David Reissbba69282009-02-17 20:28:28 +000036 src/generate/t_oop_generator.h
iproctor9a41a0c2007-07-16 21:59:24 +000037
David Reiss22585732008-02-27 01:55:33 +000038if THRIFT_GEN_cpp
39thrift_SOURCES += src/generate/t_cpp_generator.cc
40endif
David Reisse8a87de2008-02-27 02:39:25 +000041if THRIFT_GEN_java
42thrift_SOURCES += src/generate/t_java_generator.cc
43endif
David Reissce4f4f02008-03-27 21:41:31 +000044if THRIFT_GEN_csharp
45thrift_SOURCES += src/generate/t_csharp_generator.cc
46endif
David Reissbfd26dc2008-03-27 21:41:49 +000047if THRIFT_GEN_py
48thrift_SOURCES += src/generate/t_py_generator.cc
49endif
David Reissae253582008-03-27 21:42:11 +000050if THRIFT_GEN_rb
51thrift_SOURCES += src/generate/t_rb_generator.cc
52endif
David Reissfdc21aa2008-03-27 21:42:34 +000053if THRIFT_GEN_perl
54thrift_SOURCES += src/generate/t_perl_generator.cc
55endif
David Reiss32272d92009-02-17 20:28:30 +000056if THRIFT_GEN_php
57thrift_SOURCES += src/generate/t_php_generator.cc
58endif
David Reissf3b0db32009-02-17 20:28:01 +000059if THRIFT_GEN_erl
60thrift_SOURCES += src/generate/t_erl_generator.cc
61endif
David Reiss4b349aa2008-03-27 21:41:02 +000062if THRIFT_GEN_cocoa
63thrift_SOURCES += src/generate/t_cocoa_generator.cc
64endif
David Reissb3ac8a62008-03-27 21:40:42 +000065if THRIFT_GEN_st
66thrift_SOURCES += src/generate/t_st_generator.cc
67endif
David Reiss3d671b52008-03-27 21:40:11 +000068if THRIFT_GEN_ocaml
69thrift_SOURCES += src/generate/t_ocaml_generator.cc
70endif
David Reiss22812f82008-03-27 21:40:26 +000071if THRIFT_GEN_hs
72thrift_SOURCES += src/generate/t_hs_generator.cc
73endif
David Reiss782cb672009-02-17 20:28:13 +000074if THRIFT_GEN_xsd
75thrift_SOURCES += src/generate/t_xsd_generator.cc
76endif
David Reissdc0aada2008-10-21 00:09:23 +000077if THRIFT_GEN_html
78thrift_SOURCES += src/generate/t_html_generator.cc
79endif
David Reiss22585732008-02-27 01:55:33 +000080
David Reiss832b2622007-12-28 18:25:33 +000081thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS)
Mark Slee58dfb4f2007-07-06 02:45:25 +000082thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS)
Mark Sleeeb0d0242007-01-25 07:58:55 +000083
84thrift_LDADD = @LEXLIB@
85
David Reiss832b2622007-12-28 18:25:33 +000086EXTRA_DIST = README
David Reissb72d19f2007-09-18 19:46:00 +000087
Mark Sleeeb0d0242007-01-25 07:58:55 +000088clean-local:
David Reiss466b3fa2008-11-20 21:24:32 +000089 $(RM) thriftl.cc thrifty.cc thrifty.h version.h
David Reissdd08f6d2008-06-30 20:24:24 +000090
91src/main.cc: version.h
92
93# Adding this to BUILT_SOURCES will cause version.h to be
94# regenerated on every "make all" or "make check", which is
95# necessary because it changes whenever we "svn up" or similar.
96# Ideally, we would like this to be regenerated whenever the
97# compiler is rebuilt, but every way we could think of to do
98# that caused unnecessary rebuilds of the compiler.
99BUILT_SOURCES += regen_version_h
100
101THRIFT_VERSION=$(shell /bin/sh $(top_srcdir)/print_version.sh -v)
102THRIFT_REVISION=$(shell /bin/sh $(top_srcdir)/print_version.sh -r)
103
104regen_version_h:
David Reiss4d8edc52008-06-30 21:55:52 +0000105 @printf "Regenerating version.h... "
David Reissdd08f6d2008-06-30 20:24:24 +0000106 @TMPFILE=`mktemp ./version_h.tmp_XXXXXX` ; \
107 echo "// AUTOGENERATED, DO NOT EDIT" > $$TMPFILE ; \
David Reissaabfa632008-06-30 22:27:29 +0000108 echo '#define THRIFT_VERSION "$(THRIFT_VERSION)"' >> $$TMPFILE ; \
109 echo '#define THRIFT_REVISION "$(THRIFT_REVISION)"' >> $$TMPFILE ; \
David Reissdd08f6d2008-06-30 20:24:24 +0000110 if cmp $$TMPFILE version.h >/dev/null ; \
111 then \
112 rm -f $$TMPFILE ; \
113 echo "No changes." ; \
114 else \
115 mv $$TMPFILE version.h ; \
116 echo "Updated." ; \
117 fi