1# Copyright (c) 2016-2020 Intel Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15tbb_root?=..
16BUILDING_PHASE:=0
17include $(tbb_root)/build/common.inc
18.PHONY: all release test install test-install
19
20export TBBROOT=$(abspath $(tbb_root))
21SRC=$(tbb_root)/python/*.py $(tbb_root)/python/tbb/*
22PY_SETUP=python $(tbb_root)/python/setup.py
23
24all: install test
25
26clean:
27	$(PY_SETUP) clean -b$(work_dir)_release
28
29release: CC=$(compiler)
30release: $(SRC) rml
31	$(PY_SETUP) build -b$(work_dir)_release -f check
32
33install: CC=$(compiler)
34install: $(SRC) rml
35	$(PY_SETUP) build -b$(work_dir)_release build_ext -f -I$(tbb_root)/include -L$(work_dir)_release install -f
36
37test:
38	python -m tbb test
39
40rml:
41ifeq (linux,$(tbb_os))
42	$(MAKE) -C "$(work_dir)_release" -rf $(tbb_root)/python/rml/Makefile cfg=release rml
43rml_%:
44	$(MAKE) -C "$(work_dir)_release" -rf $(tbb_root)/python/rml/Makefile cfg=release $(subst rml_,,$@)
45endif
46