Merge branch 'pkg_mgmt'
[osm/SO.git] / Makefile
1 #
2 # Copyright 2016 RIFT.IO Inc
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 # Author(s): Austin Cormier
17 # Creation Date: 07/27/2016
18 #
19 #
20
21 .PHONY : clean
22
23 makefile.top := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
24 TOP_SRC_PATH := $(makefile.top)
25 TOP_ROOT_PATH := /usr/rift
26 CMAKE_MODULE_PATH := $(TOP_ROOT_PATH)/cmake/modules
27
28 RIFT_BUILD = $(TOP_SRC_PATH)/.build
29 RIFT_ARTIFACTS = $(TOP_ROOT_PATH)/artifacts
30 RIFT_INSTALL = $(TOP_ROOT_PATH)
31 RIFT_SHELL_EXE = $(TOP_ROOT_PATH)/rift-shell -b $(RIFT_BUILD) -i $(RIFT_INSTALL) -a $(RIFT_ARTIFACTS) --standalone-submodule $(TOP_SRC_PATH) --
32
33 CONFD = XML_ONLY
34
35 BUILD_TYPE = Debug
36 NOT_DEVELOPER_TYPE = FALSE
37 COVERAGE_BUILD = FALSE
38 RIFT_AGENT_BUILD = $(CONFD)
39 PROJECT_TOP_DIR = $(TOP_ROOT_PATH)
40
41 all: rw
42
43 cmake::
44 mkdir -p $(RIFT_BUILD)
45 mkdir -p $(RIFT_ARTIFACTS)
46 mkdir -p $(RIFT_INSTALL)
47 cd $(RIFT_BUILD) && $(RIFT_SHELL_EXE) cmake $(TOP_SRC_PATH) -DCMAKE_INSTALL_PREFIX=$(TOP_ROOT_PATH) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DNOT_DEVELOPER_BUILD=$(NOT_DEVELOPER_TYPE) -DCOVERAGE_BUILD=$(COVERAGE_TYPE) -DRIFT_AGENT_BUILD=$(RIFT_AGENT_BUILD) -DPROJECT_TOP_DIR=$(PROJECT_TOP_DIR) -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DRIFT_SUBMODULE_NAME=$(TOP_SRC_PATH)
48
49 rw: cmake
50 $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD)
51
52 install:
53 $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD) install
54
55 uninstall:
56 -xargs -i sh -c '[ -e {} ] && rm -fv {}' < $(RIFT_BUILD)/install_manifest.txt
57
58 unittest:
59 $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD) rw.unittest
60
61 clean:
62 @echo "Cleaning up.."
63 -rm -rf .build
64