[ansible][fedora] Update package name
[barometer.git] / src / librdkafka / Makefile
1 # makefile to manage collectd package
2 # Copyright 2016-2019 Intel Corporation and OPNFV. All rights reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 #
18 # Contributors:
19 #   Aihua Li, Huawei Technologies.
20 #   Maryam Tahhan, Intel Corporation.
21
22 include ../mk/master.mk
23 include ../package-list.mk
24
25 WORK_DIR = librdkafka
26 TAG_DONE_FLAG = $(WORK_DIR)/.$(KAFKA_TAG).done
27 CONFIG_CMD =
28 CONFIG_CMD += ./configure
29 CONFIG_CMD += --prefix=/usr
30
31 .PHONY: install force_install force_make
32
33 # install depends on make
34 force_install: force_make
35
36 all: force_make
37         @echo "Finished making $(WORK_DIR) "
38
39 INSTALL_TARGET = force_install force_make
40
41 force_make: $(WORK_DIR)
42         $(AT)cd $(WORK_DIR); git checkout -b $(KAFKA_TAG) $(KAFKA_TAG); $(CONFIG_CMD); cd -
43         $(AT)$(MAKE) -C $(WORK_DIR)
44         @echo "Make done"
45
46 force_install:
47         $(AT)sudo $(MAKE) -C $(WORK_DIR) install
48
49 install: $(INSTALL_TARGET)
50
51 # hard way to clean and clobber
52 clean:
53         $(AT)cd $(WORK_DIR) && git clean -xfd *.o
54 clobber:
55         $(AT)rm -rf $(WORK_DIR)
56
57 # distclean is for developer who would like to keep the
58 # clone git repo, saving time to fetch again from url
59 distclean:
60         $(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
61
62 test:
63         @echo "Make test in $(WORK_DIR) (stub) "
64
65 sanity:
66         @echo "Make sanity in $(WORK_DIR) (stub) "
67
68 $(WORK_DIR):
69         $(AT)git clone $(KAFKA_URL)
70
71 $(TAG_DONE_FLAG): $(WORK_DIR)
72         $(AT)cd $(WORK_DIR); git checkout $(KAFKA_TAG)
73 ifneq ($(PATCH_FILE),)
74         $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE)
75 endif
76         $(AT)touch $@