blob: eb46a53e629fb972a75b44e78cce3f8242b486b8 [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 \
Mark Sleeefd37f12007-11-20 05:13:09 +000041 src/generate/t_xsd_generator.h \
David Reiss9f2a5d72008-06-11 01:15:45 +000042 src/generate/t_erl_generator.h
iproctor9a41a0c2007-07-16 21:59:24 +000043
David Reiss22585732008-02-27 01:55:33 +000044if THRIFT_GEN_cpp
45thrift_SOURCES += src/generate/t_cpp_generator.cc
46endif
David Reisse8a87de2008-02-27 02:39:25 +000047if THRIFT_GEN_java
48thrift_SOURCES += src/generate/t_java_generator.cc
49endif
David Reissce4f4f02008-03-27 21:41:31 +000050if THRIFT_GEN_csharp
51thrift_SOURCES += src/generate/t_csharp_generator.cc
52endif
David Reissbfd26dc2008-03-27 21:41:49 +000053if THRIFT_GEN_py
54thrift_SOURCES += src/generate/t_py_generator.cc
55endif
David Reissae253582008-03-27 21:42:11 +000056if THRIFT_GEN_rb
57thrift_SOURCES += src/generate/t_rb_generator.cc
58endif
David Reissfdc21aa2008-03-27 21:42:34 +000059if THRIFT_GEN_perl
60thrift_SOURCES += src/generate/t_perl_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 Reissdc0aada2008-10-21 00:09:23 +000074if THRIFT_GEN_html
75thrift_SOURCES += src/generate/t_html_generator.cc
76endif
David Reiss22585732008-02-27 01:55:33 +000077
David Reiss832b2622007-12-28 18:25:33 +000078thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS)
Mark Slee58dfb4f2007-07-06 02:45:25 +000079thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS)
Mark Sleeeb0d0242007-01-25 07:58:55 +000080
81thrift_LDADD = @LEXLIB@
82
David Reiss832b2622007-12-28 18:25:33 +000083EXTRA_DIST = README
David Reissb72d19f2007-09-18 19:46:00 +000084
Mark Sleeeb0d0242007-01-25 07:58:55 +000085clean-local:
David Reiss2ca456a2008-02-24 16:42:18 +000086 $(RM) thriftl.cc thrifty.cc thrifty.h
David Reissdd08f6d2008-06-30 20:24:24 +000087
88src/main.cc: version.h
89
90# Adding this to BUILT_SOURCES will cause version.h to be
91# regenerated on every "make all" or "make check", which is
92# necessary because it changes whenever we "svn up" or similar.
93# Ideally, we would like this to be regenerated whenever the
94# compiler is rebuilt, but every way we could think of to do
95# that caused unnecessary rebuilds of the compiler.
96BUILT_SOURCES += regen_version_h
97
98THRIFT_VERSION=$(shell /bin/sh $(top_srcdir)/print_version.sh -v)
99THRIFT_REVISION=$(shell /bin/sh $(top_srcdir)/print_version.sh -r)
100
101regen_version_h:
David Reiss4d8edc52008-06-30 21:55:52 +0000102 @printf "Regenerating version.h... "
David Reissdd08f6d2008-06-30 20:24:24 +0000103 @TMPFILE=`mktemp ./version_h.tmp_XXXXXX` ; \
104 echo "// AUTOGENERATED, DO NOT EDIT" > $$TMPFILE ; \
David Reissaabfa632008-06-30 22:27:29 +0000105 echo '#define THRIFT_VERSION "$(THRIFT_VERSION)"' >> $$TMPFILE ; \
106 echo '#define THRIFT_REVISION "$(THRIFT_REVISION)"' >> $$TMPFILE ; \
David Reissdd08f6d2008-06-30 20:24:24 +0000107 if cmp $$TMPFILE version.h >/dev/null ; \
108 then \
109 rm -f $$TMPFILE ; \
110 echo "No changes." ; \
111 else \
112 mv $$TMPFILE version.h ; \
113 echo "Updated." ; \
114 fi