Updates/Fix on Legal/License Headers
[barometer.git] / src / libpqos / Makefile
1 # makefile to manage collectd package
2 #
3
4 # Copyright 2016-2019 Intel Corporation and OPNFV. All rights reserved.
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # 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, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18
19 #
20 # Contributors:
21 #   Aihua Li, Huawei Technologies.
22 #   Maryam Tahhan, Intel Corporation.
23
24 include ../mk/master.mk
25 include ../package-list.mk
26
27 WORK_DIR = intel-cmt-cat
28 TAG_DONE_FLAG = $(WORK_DIR)/.$(LIBPQOS_TAG).done
29 BUILD_CMD =
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 pull $(LIBPQOS_URL) $(LIBPQOS_TAG)
43         @echo "git pull done"
44         $(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS)
45         @echo "Make done"
46
47 force_install:
48         $(AT)sudo $(MAKE) -C $(WORK_DIR) install PREFIX=/usr
49 ifndef DOCKER
50         $(AT)sudo modprobe msr
51 endif
52
53 install: $(INSTALL_TARGET)
54
55 # hard way to clean and clobber
56 clean:
57         $(AT)cd $(WORK_DIR) && git clean -xfd *.o
58 clobber:
59         $(AT)rm -rf $(WORK_DIR)
60
61 # distclean is for developer who would like to keep the
62 # clone git repo, saving time to fetch again from url
63 distclean:
64         $(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
65
66 test:
67         @echo "Make test in $(WORK_DIR) (stub) "
68
69 sanity:
70         @echo "Make sanity in $(WORK_DIR) (stub) "
71
72 $(WORK_DIR):
73         $(AT)git clone $(LIBPQOS_URL)
74
75 $(TAG_DONE_FLAG): $(WORK_DIR)
76         $(AT)cd $(WORK_DIR); git checkout $(LIBPQOS_TAG)
77 ifneq ($(PATCH_FILE),)
78         $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE)
79 endif
80         $(AT)touch $@