Files
vxWorks/h/make/defs.library
2025-08-20 18:25:46 +08:00

149 lines
4.6 KiB
Plaintext

# defs.library - Host independent definitions for making libraries
#
# Copyright 2003, Wind River Systems, Inc.
#
# modification history
# --------------------
# 01k,21jul05,yvp Added _WRS_LIB_BUILD
# 01j,17may04,yvp Split SCGEN_DERIVED_FILES into SCGEN_DERIVED_GENERIC etc.
# 01i,21apr04,dlk Refine below change: do not skip CPU variant submake
# for this directory if DEFS_PAL is defined; but if
# this isn't an option library, don't build the common
# (non-variant) library.
# 01h,15mar04,dlk Do not skip directory if DEFS_PAL is defined.
# 01g,13mar04,dlk Support option builds. Fix mod history.
# 01f,yvp Changed SCGEN_DERIVED_FILES to match ver 02a of scgen.tcl script.
# 01e,.......,yvp Added more files to SCGEN_DERIVED_FILES.
# 01d,.......,yvp Removed genc.* from SCGEN_DERIVED_FILES; added syscallTbl.h
# 01c,.......,kk removed syscall.c from SCGEN_DERIVED_FILES
# 01b,.......,yvp Added SCGEN_DERIVED_FILES.
# 01a,.......,c_c written from rules.library v 02b
#
# DESCRIPTION
# This file is included by every Makefile in the run-time (not BSPs).
# This file contains makefile efinitions that are host independent for creating
# vxWorks libraries.
#
#
# INCLUDES
# $(TGT_DIR)/h/make/defs.option
# $(TGT_DIR)/h/make/defs.default
# $(TGT_DIR)/h/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)
# $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)
# avoid multiple inclusion
ifeq ($(DEFS_LIBRARY),)
DEFS_LIBRARY = TRUE
# By default object files are installed in the toolchain independent object
# directory if LIB_BASE_NAME is set, that is when LIB_COMMON is not set.
ifeq ($(LIB_COMMON),)
LIB_COMMON = true
endif
## New Archive Directory Hierarchy (LIB_BASE_NAME != ""):
ifneq ($(LIB_BASE_NAME),)
# - Object modules are installed in the toolchain dependent directory
# if LIB_COMMON is equal to false, and in the toolchain independent
# directory otherwise.
# - Objects modules populate the archive whose name is selected by
# LIB_BASE_NAME
# - Note that LIB_DIR_TAG is only set when building archive(s) for CPU
# variants.
ifeq ($(LIBDIRBASE),)
ifeq ($(findstring false,$(LIB_COMMON)),false)
LIBDIRBASE = $(VX_CPU_FAMILY)/$(CPU)/$(TOOL)$(LIB_DIR_TAG)
else
LIBDIRBASE = $(VX_CPU_FAMILY)/$(CPU)/$(TOOL_COMMON_DIR)$(LIB_DIR_TAG)
endif
endif
ifeq ($(LIBNAME),)
LIBNAME = $(LIBDIRBASE)/lib$(LIB_BASE_NAME)$(OPT).a
endif
ifeq ($(LIBDIRNAME),)
LIBDIRNAME = $(LIBDIRBASE)/obj$(LIB_BASE_NAME)$(OPT)
endif
endif # ifeq ($(LIB_BASE_NAME),)
## Build of specific target archive(s) via VX_ARCHIVE_LIST:
# If VX_ARCHIVE_LIST is set only the specified target archive(s) are built.
# This means that source directories not contributing to these archive(s)
# are skipped. VX_ARCHIVE_LIST is used with CPU variant builds.
ifneq ($(VX_ARCHIVE_LIST),)
ifeq ($(LIB_BASE_NAME),)
SKIP_DIR = true
else
## For now we assume $(VX_ARCHIVE_LIST) contains library names
# undecorated with $(OPT).
ifneq ($(filter lib$(LIB_BASE_NAME).a, $(VX_ARCHIVE_LIST)), \
lib$(LIB_BASE_NAME).a)
SKIP_DIR = true
endif
endif
endif
include $(TGT_DIR)/h/make/defs.option
## If we are doing an option build, skip directories which
# don't build libraries specified in LIB_BASE_NAMES$(OPT).
# However, src/arch needs to be built to get the variant
# builds of its subdirectories, even though its own Makefile
# doesn't specify LIB_BASE_NAME. More generally, we don't
# skip directories where defs.pal has been included.
# Note, this assumes defs.pal is included before this file.
ifneq ($(OPT),)
ifeq ($(LIB_BASE_NAME),)
SKIP_DIR = true
SKIP_CLEAN = true
else
ifeq ($(filter $(LIB_BASE_NAME),$(LIB_BASE_NAMES$(OPT))),)
SKIP_DIR = true
SKIP_CLEAN = true
endif
endif # ifeq ($(LIB_BASE_NAME),)
# Don't skip if this is the top level of a PAL/cpu-variant build
ifneq ($(DEFS_PAL),)
ifneq ($(NO_RECURSE), TRUE)
# nevertheless, don't build the common library
ifeq ($(SKIP_DIR), true)
SKIP_LIB = true
endif
SKIP_DIR =
SKIP_CLEAN =
endif
endif # ifneq ($(DEFS_PAL),)
endif # ifneq ($(OPT),)
ifeq ($(WIND_HOST_TYPE),x86-win32)
WIND_BASE := $(subst \,/,$(WIND_BASE))
endif
TGT_DIR=$(WIND_BASE)/target
include $(TGT_DIR)/h/make/defs.default
include $(TGT_DIR)/h/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)
include $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)
CC_DEFINES += $(OPTION_DEFINE_MACRO)_WRS_LIB_BUILD
# This should come after including make.$(CPU)$(TOOL)
SCGEN_DERIVED_GENERIC = $(TGT_DIR)/h/syscall.h $(TGT_DIR)/h/syscallTbl.h
SCGEN_DERIVED_ARCH = $(TGT_DIR)/h/arch/$(ARCH_DIR)/syscallArgs$(ABI_SPEC).h
SCGEN_DERIVED_FILES = $(SCGEN_DERIVED_GENERIC) $(SCGEN_DERIVED_ARCH)
endif # ifeq ($DEFS_LIBRARY),)