blob: 77c9455eedfcb202db97725d4a946ccdb11b2e7c [file] [log] [blame]
David Reiss16f5cd12009-03-30 22:52:51 +00001#
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
pwyckoff99b000b2008-04-03 19:30:55 +000020#define thrift_template
21# $(1) : $(2)
22# $$(THRIFT) $(3) $(4) $(5) $(6) $(7) $(8) $$<
23#endef
24
25define thrift_template
26XTARGET := $(shell perl -e '@val = split("\/","$(2)"); $$last = pop(@val);split("\\.",$$last);print "$(1)/"."gen-cpp/"."@_[0]"."_types.cpp\n"' )
27
28ifneq ($$(XBUILT_SOURCES),)
29 XBUILT_SOURCES := $$(XBUILT_SOURCES) $$(XTARGET)
30else
31 XBUILT_SOURCES := $$(XTARGET)
32endif
33$$(XTARGET) : $(2)
34 $$(THRIFT) -o $1 $3 $$<
35endef
36
37clean-common:
38 rm -rf gen-*