Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame^] | 1 | # Common Makefile configuration |
| 2 | # |
| 3 | |
| 4 | # The following variables must be set |
| 5 | # MOD_NAME - module name. Depending on MOD_TYPE can be encapsulated (e.g., MOD_NAME=os --> libos.a) |
| 6 | # MOD_TYPE - module type. Supported types currently are "lib", "app", "linux_module", "linux_lib", "shared_lib" |
| 7 | # Note: |
| 8 | # For library module it is possible to specify "unitest" target in |
| 9 | # mk/$(SUBSYSTEM)/modules.core / .apps |
| 10 | # In this case unitest.c is compiled and linked with its module library. |
| 11 | # However, MOD_TYPE remains a "lib". |
| 12 | # |
| 13 | # The following variables are optional |
| 14 | # srcs - list of .c source files relative to SRC_DIR |
| 15 | # as_srcs - list of .s (lower case s) source files relative to SRC_DIR |
| 16 | # AS_srcs - list of .S (upper case .S) source files relative to SRC_DIR |
| 17 | # gen_bal_srcs - list of .c that have to be generated as part of the build from bal.objset |
| 18 | # gen_bal_hdrs - list of .h that have to be generated as part of the build from bal.objset |
| 19 | # gen_omci_srcs - list of .c that have to be generated as part of the build from omci.objset |
| 20 | # gen_omci_hdrs - list of .h that have to be generated as part of the build from omci.objset |
| 21 | # gen_omci_stack_srcs - list of .c that have to be generated as part of the build from omci_me_datamodel.csv |
| 22 | # gen_omci_stack_hdrs - list of .h that have to be generated as part of the build from omci_me_datamodel.csv |
| 23 | # MOD_DEPS - list of modules the "current" module depends on. OS abstraction layer dependency |
| 24 | # (module "os") is always present implicitly. For example, api_cli module's Makefile |
| 25 | # includes the following line: |
| 26 | # MOD_DEPS = cli api utils model |
| 27 | # MOD_DEPS_OPT - similar to MOD_DEPS, but dependencies are optional and might not be present in the source tree. |
| 28 | # MOD_INC_DIRS - used when module exports includes in directory(s) other than the module directory |
| 29 | # MOD_DEFS - additional defines, including -D. the defines are added when compiling "this" module |
| 30 | # and all modules depending on it |
| 31 | # MOD_LIBS - additional libraries required by the module, including -l and -L |
| 32 | # MOD_CUSTOM - if set "y", default rule for building the module is NOT provided. |
| 33 | # In this case the rule for building $(MOD_TARGET) must be provided in module's Makefile |
| 34 | # MOD_POST_BUILD - optional commands that should be executed after successful module build |
| 35 | # |
| 36 | # The following variables are not required in most cases, but supported nonetheless |
| 37 | # EXTRA_CFLAGS - extra CFLAGS the module requires for compilation |
| 38 | # EXTRA_INCLUDES - extra include directories the module requires for compilation (with -I) |
| 39 | # EXTRA_LIBS_PATH - additional library search paths |
| 40 | # EXTRA_LIBS additional libraries to link with |
| 41 | # |
| 42 | # The following variables are pre-set and can be used in module-specific Makefile |
| 43 | # TOP_DIR - fully qualified top directory |
| 44 | # MOD_DIR - module directory relative to the top directory |
| 45 | # OUT_DIR_BASE - output directory base |
| 46 | # ALL_MODULES - list of all modules in the current subsystem (core/apps) |
| 47 | # ALL_LIB_MODULES - list of all lib modules in the current subsystem (core/apps) |
| 48 | # ALL_APP_MODULES - list of all app modules in the current subsystem (core/apps) |
| 49 | # SIMULATION_BUILD - set "y" for simulation build (CROSS_COMPILE is empty) |
| 50 | # OS - OS |
| 51 | # ENABLE_EPON - set "y" if EPON mode is included |
| 52 | # ENABLE_GPON - set "y" if GPON mode is included |
| 53 | # ENABLE_XGPON - set "y" if XGPON mode is included |
| 54 | # ENABLE_GPON_OR_XGPON - set "y" if GPON or XGPON mode is included |
| 55 | # ENABLE_CLI - set "n" if CLI support is not required |
| 56 | # ENABLE_LOG - set "n" if logger support is not required |
| 57 | # |
| 58 | # USE_CLANG - set "y" to enable CLANG code pass for improved diagnostic |
| 59 | # |
| 60 | # The following variables are pre-set and can be used and/or overwritten in module-specific Makefile |
| 61 | # SRC_DIR - fully-qualified source directory |
| 62 | # OUT_DIR - module output directory |
| 63 | # TARGET_LIB - library name for "lib" or "shared_lib" module. By default it is $(MOD_NAME) |
| 64 | # TARGET_LIB_FNAME - module library file name including path. |
| 65 | # By default it is $(OUT_DIR)/lib$(TARGET_LIB).a for "lib" module and |
| 66 | # $(OUT_DIR)/lib$(TARGET_LIB).so for "shared_lib" |
| 67 | # MOD_TARGET - module target name, including path. By default it is |
| 68 | # $(OUT_DIR)/$(MOD_NAME) for "app" modules |
| 69 | # $(TARGET_LIB_FNAME) for "lib" and "shared_lib" modules |
| 70 | # CODEGEN_OUTPUT_DIR - output directory containing generated files |
| 71 | |
| 72 | TOOLCHAIN ?= gcc |
| 73 | OS ?= posix |
| 74 | DEBUG ?= y |
| 75 | BLD_DEP ?= gcc |
| 76 | USE_CLANG ?= n |
| 77 | |
| 78 | export SHELL := /bin/bash |
| 79 | |
| 80 | export BOARD |
| 81 | export TOOLCHAIN |
| 82 | export OS |
| 83 | export DEBUG |
| 84 | export BLD_DEP |
| 85 | export OS_KERNEL |
| 86 | |
| 87 | V ?= 0 |
| 88 | ifeq (x"$(V)", x"0") |
| 89 | SILENT_BUILD = @ |
| 90 | endif |
| 91 | |
| 92 | SRC_DIR = $(TOP_DIR)/$(MOD_DIR) |
| 93 | OUT_DIR_BASE ?= $(TOP_DIR)/build/$(SUBSYSTEM) |
| 94 | OUT_DIR := $(OUT_DIR_BASE)/$(MOD_DIR) |
| 95 | |
| 96 | # |
| 97 | # Compiler warning configuration |
| 98 | # Some extra warnings are always enabled. Others must be opted in on the module level |
| 99 | # |
| 100 | ENABLE_EXTRA_WARNINGS ?= y |
| 101 | export ENABLE_EXTRA_WARNINGS |
| 102 | |
| 103 | ifneq ("$(BUILD_NC_AGENT)", "y") |
| 104 | override NC_AGENT := none |
| 105 | endif |
| 106 | |
| 107 | # Include optional subsystem-specific configuration |
| 108 | -include mk/$(SUBSYSTEM)/Makefile.$(SUBSYSTEM).config |
| 109 | |
| 110 | ENABLE_EPON ?= y |
| 111 | ENABLE_GPON ?= y |
| 112 | ENABLE_XGPON ?= y |
| 113 | |
| 114 | ENABLE_GPON_OR_XGPON = n |
| 115 | ifeq ("$(ENABLE_GPON)", "y") |
| 116 | ENABLE_GPON_OR_XGPON = y |
| 117 | endif |
| 118 | ifeq ("$(ENABLE_XGPON)", "y") |
| 119 | ENABLE_GPON_OR_XGPON = y |
| 120 | endif |
| 121 | export ENABLE_EPON |
| 122 | export ENABLE_GPON |
| 123 | export ENABLE_XGPON |
| 124 | export ENABLE_GPON_OR_XGPON |
| 125 | |
| 126 | CONFIG_DIR = src/common/config |
| 127 | OS_PLATFORM_DIR = src/$(SUBSYSTEM)/platform |
| 128 | |
| 129 | # CLI and logger support |
| 130 | ENABLE_CLI ?= y |
| 131 | ENABLE_LOG ?= y |
| 132 | BAL_MONOLITHIC ?= y |
| 133 | |
| 134 | export ENABLE_CLI |
| 135 | export ENABLE_LOG |
| 136 | export BAL_MONOLITHIC |
| 137 | |
| 138 | # |
| 139 | ### Include module Makefile |
| 140 | # For MOD_CUSTOM only will be included in Makefile.rules second time for propagate custom rules |
| 141 | # |
| 142 | include $(SRC_DIR)/Makefile |
| 143 | |
| 144 | # Code-generator - related parameters |
| 145 | CODEGEN_INPUT_DIR = $(SRC_DIR)/codegen_templates |
| 146 | CODEGEN_OUTPUT_DIR = $(OUT_DIR) |
| 147 | CODEGEN_DIR = $(TOP_DIR)/src/datamodel/bin/codegen |
| 148 | CODEGEN_EXE = $(CODEGEN_DIR)/Teknovus.MetaStructure.CodeGenerator.exe |
| 149 | |
| 150 | OMCI_STACK_CODEGEN_INPUT_DIR = $(SRC_DIR)/me_codegen |
| 151 | OMCI_STACK_CODEGEN_EXE = $(OUT_DIR)/omci_me_codegen |
| 152 | |
| 153 | BAL_MODEL_FILE = $(TOP_DIR)/src/datamodel/bal.objset |
| 154 | OMCI_MODEL_FILE = $(TOP_DIR)/src/datamodel/omci.objset |
| 155 | OMCI_STACK_MODEL_FILE = $(TOP_DIR)/src/datamodel/omci_me_datamodel.csv |
| 156 | MONO_VER ?= 4.3.2.467 |
| 157 | MONO_PATH ?= /opt/mono-$(MONO_VER)/bin/mono |
| 158 | |
| 159 | export SRC_DIR |
| 160 | export OUT_DIR_BASE |
| 161 | export OUT_DIR |
| 162 | export MODEL_OUT_DIR |
| 163 | |
| 164 | ifeq ("$(wildcard $(MONO_PATH))", "") |
| 165 | # If we can't find Mono installed in the correct path, default to the current PATH version. |
| 166 | # In the future, we should always use Mono from a common tools directory. |
| 167 | # TODO: change this once the compiler/toolchain paths are better defined. |
| 168 | MONO_PATH = mono |
| 169 | endif |
| 170 | |
| 171 | # Treat "yes" and "y" the same |
| 172 | ifeq ("$(USE_CLANG)", "yes") |
| 173 | USE_CLANG := y |
| 174 | endif |
| 175 | ifeq ("$(USE_CLANG)", "y") |
| 176 | include $(MAKE_DIR)/clang.opts |
| 177 | endif |
| 178 | |
| 179 | # Disable code generation in release build |
| 180 | ifeq ("$(RELEASE_BUILD)", "y") |
| 181 | srcs := $(srcs) $(gen_bal_srcs) $(gen_omci_srcs) |
| 182 | gen_bal_hdrs := |
| 183 | gen_bal_srcs := |
| 184 | gen_omci_hdrs := |
| 185 | gen_omci_srcs := |
| 186 | # Disable LINT and CLANG |
| 187 | USE_LINT = n |
| 188 | USE_CLANG = n |
| 189 | endif |
| 190 | |
| 191 | SRCS = $(strip $(srcs:%=$(SRC_DIR)/%)) |
| 192 | |
| 193 | # In COMPILE_ALL_IN_ONE_GO mode all .c files of a module are compiled in |
| 194 | # a single invocation of BLD_CC compiler. In result, objects files are created |
| 195 | # in OUT_DIR even if module's .c files are spread in sub-directories |
| 196 | ifeq ("$(COMPILE_ALL_IN_ONE_GO)", "y") |
| 197 | srcs_no_dir = $(notdir $(srcs)) |
| 198 | _OBJS = $(srcs_no_dir:%.c=$(OUT_DIR)/%.o) |
| 199 | else |
| 200 | _OBJS = $(srcs:%.c=$(OUT_DIR)/%.o) |
| 201 | endif |
| 202 | |
| 203 | as_SRCS = $(strip $(as_srcs:%=$(SRC_DIR)/%)) |
| 204 | as_OBJS = $(as_srcs:%.s=$(OUT_DIR)/%.o) |
| 205 | _OBJS += $(as_OBJS) |
| 206 | |
| 207 | AS_SRCS = $(strip $(AS_srcs:%=$(SRC_DIR)/%)) |
| 208 | AS_OBJS = $(AS_srcs:%.S=$(OUT_DIR)/%.o) |
| 209 | _OBJS += $(AS_OBJS) |
| 210 | |
| 211 | ifneq ("$(gen_bal_srcs)", "") |
| 212 | GEN_BAL_SRCS = $(strip $(gen_bal_srcs:%=$(CODEGEN_OUTPUT_DIR)/%)) |
| 213 | _OBJS += $(GEN_BAL_SRCS:%.c=%.o) |
| 214 | endif |
| 215 | ifneq ("$(gen_bal_hdrs)", "") |
| 216 | GEN_BAL_HDRS = $(strip $(gen_bal_hdrs:%=$(CODEGEN_OUTPUT_DIR)/%)) |
| 217 | endif |
| 218 | |
| 219 | ifneq ("$(gen_omci_srcs)", "") |
| 220 | GEN_OMCI_SRCS = $(strip $(gen_omci_srcs:%=$(CODEGEN_OUTPUT_DIR)/%)) |
| 221 | _OBJS += $(GEN_OMCI_SRCS:%.c=%.o) |
| 222 | endif |
| 223 | ifneq ("$(gen_omci_hdrs)", "") |
| 224 | GEN_OMCI_HDRS = $(strip $(gen_omci_hdrs:%=$(CODEGEN_OUTPUT_DIR)/%)) |
| 225 | endif |
| 226 | |
| 227 | ifneq ("$(gen_omci_stack_srcs)", "") |
| 228 | GEN_OMCI_STACK_SRCS = $(strip $(gen_omci_stack_srcs:%=$(CODEGEN_OUTPUT_DIR)/%)) |
| 229 | _OBJS += $(GEN_OMCI_STACK_SRCS:%.c=%.o) |
| 230 | endif |
| 231 | ifneq ("$(gen_omci_stack_hdrs)", "") |
| 232 | GEN_OMCI_STACK_HDRS = $(strip $(gen_omci_stack_hdrs:%=$(CODEGEN_OUTPUT_DIR)/%)) |
| 233 | endif |
| 234 | |
| 235 | OBJS = $(strip $(_OBJS)) |
| 236 | |
| 237 | GEN_SRCS = $(GEN_BAL_SRCS) $(GEN_OMCI_SRCS) $(GEN_OMCI_STACK_SRCS) |
| 238 | GEN_HDRS = $(GEN_BAL_HDRS) $(GEN_OMCI_HDRS) $(GEN_OMCI_STACK_HDRS) |
| 239 | |
| 240 | # Add default dependency on OS abstraction |
| 241 | ifeq ("$(MOD_NAME)", "") |
| 242 | ifneq (x"$(V)", x"0") |
| 243 | $(info MOD_NAME is not set for $(SRC_DIR)/Makefile. Skipping..) |
| 244 | endif |
| 245 | MOD_TYPE = _skip_ |
| 246 | endif |
| 247 | |
| 248 | # Add default dependency on OS abstraction |
| 249 | ifneq ("$(MOD_SUPPRESS_OS_DEP), "y) |
| 250 | ifeq ("$(MOD_TYPE)", "linux_module") |
| 251 | _kernel = y |
| 252 | endif |
| 253 | ifeq ("$(MOD_TYPE)", "linux_lib") |
| 254 | _kernel = y |
| 255 | endif |
| 256 | ifeq ("$(_kernel)", "y") |
| 257 | MOD_DEPS := os_linux $(MOD_DEPS) |
| 258 | else |
| 259 | MOD_DEPS := os $(MOD_DEPS) |
| 260 | endif |
| 261 | endif |
| 262 | |
| 263 | # Extra types filter |
| 264 | ifneq ("$(EXTRA_TYPES)", "") |
| 265 | EXTRA_TYPES := $(shell echo -n $(EXTRA_TYPES) | sed -e 's/ /\\|/g') |
| 266 | GEN_EXTRA_TYPES := -typeNameFilter=\^\($(EXTRA_TYPES)\)\$$ |
| 267 | endif |
| 268 | |
| 269 | OS_KERNEL ?= $(OS) |
| 270 | UC_PLATFORM = $(shell echo $(PLATFORM) | tr a-z A-Z) |
| 271 | UC_SUBSYSTEM = $(shell echo $(SUBSYSTEM) | tr a-z A-Z) |
| 272 | UC_OS = $(shell echo $(OS) | tr a-z A-Z) |
| 273 | UC_OS_KERNEL = $(shell echo $(OS_KERNEL) | tr a-z A-Z) |
| 274 | |
| 275 | EXTRA_DEFINES += -DBCM_SUBSYSTEM_$(UC_SUBSYSTEM) -DBCM_PLATFORM_$(UC_PLATFORM) -DBCM_OS_$(UC_OS) |
| 276 | EXTRA_DEFINES += -DBCM_SUBSYSTEM_HOST |
| 277 | EXTRA_DEFINES += -D$(UC_OS_KERNEL)_KERNEL_SPACE |
| 278 | ifeq ("$(ENABLE_EPON)", "y") |
| 279 | EXTRA_DEFINES += -DBCM_EPON |
| 280 | endif |
| 281 | ifeq ("$(ENABLE_GPON)", "y") |
| 282 | EXTRA_DEFINES += -DBCM_GPON |
| 283 | endif |
| 284 | ifeq ("$(ENABLE_XGPON)", "y") |
| 285 | EXTRA_DEFINES += -DBCM_XGPON |
| 286 | endif |
| 287 | |
| 288 | ifneq ("$(CONFIG_MAC_RPC)", "n") |
| 289 | EXTRA_DEFINES += -DCONFIG_MAC_RPC |
| 290 | endif |
| 291 | |
| 292 | ifneq ("$(CONFIG_SWITCH_RPC)", "n") |
| 293 | EXTRA_DEFINES += -DCONFIG_SWITCH_RPC |
| 294 | endif |
| 295 | |
| 296 | ifneq ("$(BOARD)", "") |
| 297 | EXTRA_DEFINES += -DBOARD=$(BOARD) |
| 298 | endif |
| 299 | |
| 300 | ifeq ("$(BOARD)", "wrx") |
| 301 | EXTRA_DEFINES += -DWRX_BUILD |
| 302 | endif |
| 303 | |
| 304 | ifeq ("$(BUILD_OF_AGENT)", "y") |
| 305 | EXTRA_DEFINES += -DBUILD_OF_AGENT |
| 306 | endif |
| 307 | |
| 308 | ifeq ("$(FORCE_PKTIN_SND)", "y") |
| 309 | EXTRA_DEFINES += -DFORCE_PKTIN_SND |
| 310 | endif |
| 311 | |
| 312 | # Build unitests for simulation and from Jenkins jobs |
| 313 | UNITEST ?= n |
| 314 | |
| 315 | ifeq ("$(SIMULATION_BUILD)", "y") |
| 316 | EXTRA_DEFINES += -DSIMULATION_BUILD |
| 317 | UNITEST = y |
| 318 | endif |
| 319 | |
| 320 | ifeq ("$(JENKINS_BUILD)", "y") |
| 321 | UNITEST = y |
| 322 | endif |
| 323 | |
| 324 | ifeq ("$(BAL_MONOLITHIC)", "y") |
| 325 | EXTRA_DEFINES += -DBAL_MONOLITHIC |
| 326 | endif |
| 327 | |
| 328 | EXTRA_INCLUDES += -I$(SRC_DIR) |
| 329 | EXTRA_INCLUDES += -I$(TOP_SRC_DIR)/common/include -I$(OUT_DIR_BASE)/src/common/include |
| 330 | |
| 331 | OPT_DISABLE_$(UC_SUBSYSTEM) ?=n |
| 332 | OPT_DISABLE := $(OPT_DISABLE_$(UC_SUBSYSTEM)) |
| 333 | |
| 334 | ARCH_CFLAGS = $(ARCH_FLAGS) |
| 335 | ifeq ("$(OPT_DISABLE)", "y") |
| 336 | ARCH_CFLAGS += $(DEBUG_O_CFLAGS) |
| 337 | EXTRA_LFLAGS += $(DEBUG_O_LFLAGS) |
| 338 | EXTRA_ASFLAGS += $(DEBUG_O_ASFLAGS) |
| 339 | EXTRA_asFLAGS += $(DEBUG_O_asLAGS) |
| 340 | else |
| 341 | ARCH_CFLAGS += $(RELEASE_O_CFLAGS) |
| 342 | EXTRA_LFLAGS += $(RELEASE_O_LFLAGS) |
| 343 | EXTRA_ASFLAGS += $(RELEASE_O_ASFLAGS) |
| 344 | EXTRA_asFLAGS += $(RELEASE_O_asFLAGS) |
| 345 | endif |
| 346 | |
| 347 | # 3rd party packages install location |
| 348 | INSTALL_DIR ?= $(OUT_DIR_BASE) |
| 349 | export INSTALL_DIR |
| 350 | EXTRA_INCLUDES += -I$(INSTALL_DIR)/include |
| 351 | |
| 352 | PATH := $(INSTALL_DIR)/bin:$(PATH) |
| 353 | export PATH |
| 354 | |
| 355 | # Shared library location |
| 356 | SHARED_LIB_DIR ?= $(INSTALL_DIR)/lib |
| 357 | export SHARED_LIB_DIR |
| 358 | |
| 359 | # Treat lib as shared lib if BUILD_SHARED_LIBS is y |
| 360 | ifeq ("$(BUILD_SHARED_LIBS)", "y") |
| 361 | export BUILD_SHARED_LIBS |
| 362 | ifeq ("$(MOD_TYPE)", "lib") |
| 363 | MOD_TYPE = shared_lib |
| 364 | endif |
| 365 | EXTRA_LIBS_PATH += -L$(TOP_DIR)/$(LOCAL_MAPLE_SDK_DIR)/build/shared_libs |
| 366 | endif |
| 367 | EXTRA_LIBS_PATH += -L$(SHARED_LIB_DIR) |
| 368 | |
| 369 | # Calculate MOD_TARGET based on MOD_TYPE |
| 370 | ifeq ("$(MOD_TYPE)", "lib") |
| 371 | ifneq ("$(OBJS)", "") |
| 372 | TARGET_LIB ?= $(MOD_NAME) |
| 373 | TARGET_LIB_FNAME ?= $(OUT_DIR)/lib$(TARGET_LIB).a |
| 374 | endif |
| 375 | MOD_TARGET ?= $(TARGET_LIB_FNAME) |
| 376 | else ifeq ("$(MOD_TYPE)", "shared_lib") |
| 377 | ifneq ("$(OBJS)", "") |
| 378 | TARGET_LIB ?= $(MOD_NAME) |
| 379 | TARGET_LIB_FNAME ?= $(OUT_DIR)/lib$(TARGET_LIB).so |
| 380 | endif |
| 381 | MOD_TARGET ?= $(TARGET_LIB_FNAME) |
| 382 | else ifeq ("$(MOD_TYPE)", "app") |
| 383 | MOD_TARGET ?= $(OUT_DIR)/$(MOD_NAME) |
| 384 | else ifeq ("$(MOD_TYPE)", "linux_module") |
| 385 | ifeq ("$(KERNELDIR)", "") |
| 386 | $(error KERNELDIR must be set in board profile) |
| 387 | endif |
| 388 | ifeq ("$(KERNEL_ARCH)", "") |
| 389 | $(error KERNEL_ARCH must be set in board profile) |
| 390 | endif |
| 391 | ifeq ("$(KERNEL_OUTDIR)", "") |
| 392 | KERNEL_OUTDIR := $(KERNELDIR) |
| 393 | endif |
| 394 | MOD_TARGET ?= $(SRC_DIR)/$(MOD_NAME).ko |
| 395 | else ifeq ("$(MOD_TYPE)", "linux_lib") |
| 396 | MOD_TARGET ?= $(OUT_DIR_BASE)/$(MOD_NAME).linuxlib |
| 397 | else ifeq ("$(MOD_TYPE)", "_skip_") |
| 398 | MOD_TARGET = .dummy |
| 399 | else |
| 400 | $(error MOD_TYPE $(MOD_TYPE) is incorrect for module $(MOD_NAME). Must be lib or app) |
| 401 | endif |
| 402 | |
| 403 | ifeq ("$(MOD_TARGET)", "") |
| 404 | MOD_TARGET = $(MOD_NAME) |
| 405 | endif |
| 406 | |
| 407 | ifeq ("$(OS)", "posix") |
| 408 | EXTRA_DEFINES += -D_XOPEN_SOURCE=600 |
| 409 | LIBS = -lrt -lpthread -lm |
| 410 | endif |
| 411 | |
| 412 | # Make sure that paths in EXTRA_INCLUDES are absolute |
| 413 | ifneq ("$(EXTRA_INCLUDES)", "") |
| 414 | # Make sure that each directory is an absolute path |
| 415 | EXTRA_INCS = $(addprefix -I, $(abspath $(subst -I,,$(subst $(TOP_DIR)/,,$(EXTRA_INCLUDES))))) |
| 416 | endif |
| 417 | ifneq ("$(EXTRA_ASINCLUDES)", "") |
| 418 | # Make sure that each directory is an absolute path |
| 419 | EXTRA_ASINCS = $(addprefix -I, $(abspath $(subst -I,,$(subst $(TOP_DIR)/,,$(EXTRA_ASINCLUDES))))) |
| 420 | endif |
| 421 | ifneq ("$(EXTRA_asINCLUDES)", "") |
| 422 | # Make sure that each directory is an absolute path |
| 423 | EXTRA_asINCS = $(addprefix -I, $(abspath $(subst -I,,$(subst $(TOP_DIR)/,,$(EXTRA_asINCLUDES))))) |
| 424 | endif |
| 425 | ifeq ("$(USE_LINT)", "y") |
| 426 | USE_LINT := yes |
| 427 | endif |
| 428 | ifeq ("$(USE_LINT)", "yes") |
| 429 | EXTRA_DEFINES += -DUSE_LINT |
| 430 | endif |
| 431 | |
| 432 | EXTRA_DEFINES += $(USER_EXTRA_DEFINES) $(USER_EXTRA_$(UC_SUBSYSTEM)_DEFINES) |
| 433 | EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) $(USER_EXTRA_$(UC_SUBSYSTEM)_CFLAGS) |
| 434 | CFLAGS += $(ARCH_CFLAGS) $(EXTRA_CFLAGS) $(EXTRA_INCS) $(EXTRA_DEFINES) |
| 435 | ASFLAGS += $(ARCH_FLAGS) $(EXTRA_ASFLAGS) $(EXTRA_ASINCS) $(EXTRA_ASDEFINES) |
| 436 | asFLAGS += $(ARCH_FLAGS) $(EXTRA_asFLAGS) $(EXTRA_asINCS) $(EXTRA_asDEFINES) |
| 437 | LFLAGS += $(ARCH_FLAGS) $(EXTRA_LFLAGS) |
| 438 | DEP_FLAGS += $(EXTRA_CFLAGS) $(EXTRA_INCS) $(EXTRA_DEFINES) |
| 439 | CLANG_FLAGS += $(EXTRA_CFLAGS) $(EXTRA_INCS) $(EXTRA_DEFINES) $(CLANG_OPTS) |