summaryrefslogtreecommitdiffstats
path: root/nsframework/framework_unified/client/NativeServices/cfg/config.mk
blob: 5eb23f4fd3c2fe588e1b7e1178b5694ca0cb0379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# Standard Configuration Makefile version 2.0
#

.SUFFIXES:

# Setup configuration exports to make sure other "subprojects" have the correct configuration settings.
# Export shared variables
export DEFS
export LIBS
export LIB_PATHS

# Export setup
export MAKE_DEPS := $(PRJ_ROOT)cfg/depends.mk
export MAKE_CFG := $(TOOLS_CFG)config.mk

# Set the location of build files.  By default all build files become local to the initating location of the build so
#  one doesn't impact a referenced project
# Alteratively a directed path can also be supported.
ifndef PRJ_OUTPUT_ROOT
PRJ_OUTPUT_ROOT = $(PRJ_ROOT)
endif

# Select Compiler Tool by name and select the tool configuration file
# default behavior is to generate for arm
ifeq ($(TARGET),analysis)
export MAKE_TOOLS := $(TOOLS_CFG)analysis.mk
else
ifeq ($(TARGET),x86)
export MAKE_TOOLS := $(TOOLS_CFG)PosixBasedOS001_x86.mk
else
ifeq ($(TARGET),armle)
export MAKE_TOOLS := $(TOOLS_CFG)PosixBasedOS001_arm.mk
else
export MAKE_TOOLS := $(TOOLS_CFG)PosixBasedOS001_armv7.mk
TARGET = armle-v7
endif
endif
endif


# Set specific flags as path suffixes to make sure the right build options are picked up
ifdef DEBUG
BUILD_CFG+=/debug
endif
ifdef PROFILING
BUILD_CFG+=/profile
endif
ifndef BUILD_CFG
BUILD_CFG=/release
endif

# Set File Paths
export BIN_PATH := $(PRJ_OUTPUT_ROOT)bin/$(TARGET)$(BUILD_CFG)/
export BLD_PATH := $(PRJ_OUTPUT_ROOT)bld/$(TARGET)$(BUILD_CFG)/$(COMPONENT_NAME)/
export LIB_PATH := $(PRJ_OUTPUT_ROOT)lib/$(TARGET)$(BUILD_CFG)/
export SLIB_PATH := $(PRJ_OUTPUT_ROOT)dll/$(TARGET)$(BUILD_CFG)/
export BUILD_DIRS = $(BIN_PATH) $(LIB_PATH) $(SLIB_PATH) $(BLD_PATH)
export BUILD_ROOTS := $(addprefix $(PRJ_OUTPUT_ROOT), bin bld lib dll)

# Set Staging Location - set to a default location to prevent accidents
ifndef STAGE_LOCATION
export STAGE_LOCATION = C:/temp/stage/
endif

# Now include the defintions that have been exported
include $(MAKE_TOOLS)

# Add additional configuration includes reflective of project and decisions expressed in include makefiles.
#  So local includes, base infrastructure, and target platform.
#  This is also the variable to add local overriding header file locations for configuration in makefiles
#  prior to spawning to subprojects.  Which means if you want to utilize different header files than those
#  the project you are going to build this will force an early search path to override with.
ifndef CFG_INCS
	export CFG_INCS +=
endif

# Standard Targets (and defaults)
all:

subdirs:

# Building necessary directories
build_dirs: $(BUILD_DIRS)

$(BUILD_DIRS):
	-mkdir -p $(@)

# Stage "public" directories
stage:
	-rm -r $(STAGE_LOCATION)/$(COMPONENT_NAME)
	mkdir -p $(STAGE_LOCATION)/$(COMPONENT_NAME)
	cp -r ../bin ../dll ../lib ../inc ../cfg ../doc $(STAGE_LOCATION)/$(COMPONENT_NAME)/


# Debug Headers
banner:
	@echo Making $(COMPONENT_NAME)
	@echo Bld Roots $(BLD_ROOTS)