Gavin McDonald | 0b75e1a | 2010-10-28 02:12:01 +0000 | [diff] [blame^] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
| 20 | AM_YFLAGS = -d |
| 21 | BUILT_SOURCES = |
| 22 | |
| 23 | bin_PROGRAMS = thrift |
| 24 | |
| 25 | thrift_OBJDIR = obj |
| 26 | |
| 27 | thrift_SOURCES = src/thrifty.yy \ |
| 28 | src/thriftl.ll \ |
| 29 | src/main.cc \ |
| 30 | src/md5.c \ |
| 31 | src/generate/t_generator.cc \ |
| 32 | src/globals.h \ |
| 33 | src/main.h \ |
| 34 | src/platform.h \ |
| 35 | src/md5.h \ |
| 36 | src/parse/t_doc.h \ |
| 37 | src/parse/t_type.h \ |
| 38 | src/parse/t_base_type.h \ |
| 39 | src/parse/t_enum.h \ |
| 40 | src/parse/t_enum_value.h \ |
| 41 | src/parse/t_typedef.h \ |
| 42 | src/parse/t_container.h \ |
| 43 | src/parse/t_list.h \ |
| 44 | src/parse/t_set.h \ |
| 45 | src/parse/t_map.h \ |
| 46 | src/parse/t_struct.h \ |
| 47 | src/parse/t_field.h \ |
| 48 | src/parse/t_service.h \ |
| 49 | src/parse/t_function.h \ |
| 50 | src/parse/t_program.h \ |
| 51 | src/parse/t_scope.h \ |
| 52 | src/parse/t_const.h \ |
| 53 | src/parse/t_const_value.h \ |
| 54 | src/generate/t_generator.h \ |
| 55 | src/generate/t_oop_generator.h |
| 56 | |
| 57 | if THRIFT_GEN_cpp |
| 58 | thrift_SOURCES += src/generate/t_cpp_generator.cc |
| 59 | endif |
| 60 | if THRIFT_GEN_java |
| 61 | thrift_SOURCES += src/generate/t_java_generator.cc |
| 62 | endif |
| 63 | if THRIFT_GEN_csharp |
| 64 | thrift_SOURCES += src/generate/t_csharp_generator.cc |
| 65 | endif |
| 66 | if THRIFT_GEN_py |
| 67 | thrift_SOURCES += src/generate/t_py_generator.cc |
| 68 | endif |
| 69 | if THRIFT_GEN_rb |
| 70 | thrift_SOURCES += src/generate/t_rb_generator.cc |
| 71 | endif |
| 72 | if THRIFT_GEN_perl |
| 73 | thrift_SOURCES += src/generate/t_perl_generator.cc |
| 74 | endif |
| 75 | if THRIFT_GEN_php |
| 76 | thrift_SOURCES += src/generate/t_php_generator.cc |
| 77 | endif |
| 78 | if THRIFT_GEN_erl |
| 79 | thrift_SOURCES += src/generate/t_erl_generator.cc |
| 80 | endif |
| 81 | if THRIFT_GEN_cocoa |
| 82 | thrift_SOURCES += src/generate/t_cocoa_generator.cc |
| 83 | endif |
| 84 | if THRIFT_GEN_st |
| 85 | thrift_SOURCES += src/generate/t_st_generator.cc |
| 86 | endif |
| 87 | if THRIFT_GEN_ocaml |
| 88 | thrift_SOURCES += src/generate/t_ocaml_generator.cc |
| 89 | endif |
| 90 | if THRIFT_GEN_hs |
| 91 | thrift_SOURCES += src/generate/t_hs_generator.cc |
| 92 | endif |
| 93 | if THRIFT_GEN_xsd |
| 94 | thrift_SOURCES += src/generate/t_xsd_generator.cc |
| 95 | endif |
| 96 | if THRIFT_GEN_html |
| 97 | thrift_SOURCES += src/generate/t_html_generator.cc |
| 98 | endif |
| 99 | |
| 100 | thrift_CXXFLAGS = -Wall -I$(srcdir)/src $(BOOST_CPPFLAGS) |
| 101 | thrift_LDFLAGS = -Wall $(BOOST_LDFLAGS) |
| 102 | |
| 103 | thrift_LDADD = @LEXLIB@ |
| 104 | |
| 105 | EXTRA_DIST = README |
| 106 | |
| 107 | clean-local: |
| 108 | $(RM) thriftl.cc thrifty.cc thrifty.h version.h |
| 109 | |
| 110 | src/main.cc: version.h |
| 111 | |
| 112 | # Adding this to BUILT_SOURCES will cause version.h to be |
| 113 | # regenerated on every "make all" or "make check", which is |
| 114 | # necessary because it changes whenever we "svn up" or similar. |
| 115 | # Ideally, we would like this to be regenerated whenever the |
| 116 | # compiler is rebuilt, but every way we could think of to do |
| 117 | # that caused unnecessary rebuilds of the compiler. |
| 118 | BUILT_SOURCES += regen_version_h |
| 119 | |
| 120 | THRIFT_VERSION=$(shell /bin/sh $(top_srcdir)/print_version.sh -v) |
| 121 | THRIFT_REVISION=$(shell /bin/sh $(top_srcdir)/print_version.sh -r) |
| 122 | |
| 123 | regen_version_h: |
| 124 | @printf "Regenerating version.h... " |
| 125 | @TMPFILE=`mktemp ./version_h.tmp_XXXXXX` ; \ |
| 126 | echo "// AUTOGENERATED, DO NOT EDIT" > $$TMPFILE ; \ |
| 127 | echo '#define THRIFT_VERSION "$(THRIFT_VERSION)"' >> $$TMPFILE ; \ |
| 128 | echo '#define THRIFT_REVISION "$(THRIFT_REVISION)"' >> $$TMPFILE ; \ |
| 129 | if cmp $$TMPFILE version.h >/dev/null ; \ |
| 130 | then \ |
| 131 | rm -f $$TMPFILE ; \ |
| 132 | echo "No changes." ; \ |
| 133 | else \ |
| 134 | mv $$TMPFILE version.h ; \ |
| 135 | echo "Updated." ; \ |
| 136 | fi |