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