327 lines
11 KiB
Plaintext
327 lines
11 KiB
Plaintext
# rules-lib.unix - Host specific default definitions
|
|
#
|
|
# modification history
|
|
# --------------------
|
|
# 01g,27may15,pee VXW6-84178 reduce size of archive command
|
|
# 01f,18nov11,jph replace the versioned mapping file name with
|
|
# mappingfile.txt
|
|
# 01e,28jul11,jam update mapping file for docs
|
|
# 01d,12may11,jam change mapping file version
|
|
# 01c,06jan11,jph check if mapping file exists
|
|
# 01b,08nov10,jph add mapping file
|
|
# 01a,25oct10,jph remove version
|
|
# 01a,19oct10,??? change version
|
|
# 01e,18oct10,??? change version
|
|
# 01d,13apr10,pee fix to basic ipnet build
|
|
# 01c,23mar10,mze allow -basic for SMP
|
|
# 01b,03feb10,mze fix for -basic libraries
|
|
# 01a,01feb10,mze allow -basic for LP64
|
|
# 02z,06jul09,??? Updating version number for VxWorks 6.8
|
|
# 02y,17dec08,pee WIND00137359
|
|
# 02x,05nov08,mze Pass VSB_DIR down in submakes
|
|
# 02w,27oct08,pee WIND00137359
|
|
# 02v,17sep08,mze add logic to stop building basic for _WRS_CONFIG_SMP case
|
|
# 02u,20jun08,pee VSB
|
|
# 02t,04jun08,kkz Use variables for doc version number
|
|
# 02s,15may08,pee blocking basic build for OPT and FEATURE_SET
|
|
# 02r,02may08,kkz Adding explicit archive instruction, in addition to *.o
|
|
# 02r,23apr08,pee vsb
|
|
# 02q,17sep07,pee cleaning up messages.
|
|
# 02p,22jun07,kkz Updating apidoc version number
|
|
# 02o,10may07,pch refine -basic automation to apply only to normal builds
|
|
# (null VXBUILD)
|
|
# 02n,03may07,pch automate -basic build step
|
|
# 02m,30mar07,mmg update for parallel make operation
|
|
# 02l,07dec06,kkz Updating apidoc version number to 6.5
|
|
# 02l,22may06,pee Adding support for multiple libraries
|
|
# Cleaned up obsolete code.
|
|
# 02k,09mar06,kkz Updating version number for API docs
|
|
# 02j,15sep05,kkz Updating version number for API docs
|
|
# 02i,18aug05,pee Filtering object list for dependency generation
|
|
# 02h,31may05,md,pee move dependencies to object directory
|
|
# 02k,29apr05,kkz Changing doc directory path
|
|
# 02j,26apr05,pee Forcing library update with MAKE_LIBDIR
|
|
# 02i,07apr05,h_a LIB_ROOT to replace $(TGT_DIR)/lib for building components
|
|
# 02h,18apr05,pee added support for precomp objects.
|
|
# 02g,22apr05,h_a LIB_ROOT changes for external lib targets
|
|
# 02f,14feb05,bpn Removed shell command directory from doc link rule.
|
|
# 02e,14oct04,job Set KERNEL condition when building docs
|
|
# 02d,26may04,dgp modify default output directory for docs build
|
|
# 02c,13mar04,dlk When library exists, do not archive an empty set of
|
|
# objects newer than the library.
|
|
# 02b,04mar04,c_c Fixed library build introduced by the SPR 92805 fix.
|
|
# 02a,25feb04,c_c Fixed SPR 92805
|
|
# 01z,20feb04,c_c Dependencies rework.
|
|
# 01y,12jan04,bjl changed refgen to apigen.
|
|
# 01x,26dec03,dat ignore errors during dependency generation
|
|
# 01w,28nov03,c_c Use dependencies processing macro.
|
|
# 01v,07nov03,c_c Unified build rules with WIN32 hosts.
|
|
# 01u,01sep03,fle SPR#84899 : do not use make -C anymore, rather change
|
|
# directory first, and call make
|
|
# 01t,19aug03,fle SPR#88802 : modified depend.tcl use since it now takes
|
|
# output file as an argument
|
|
# 01s,12nov01,dbs fix dependency-build warnings for C++ source
|
|
# 01r,01nov01,jab added LIBDIR directory creation
|
|
# 01q,24oct01,jab fixed dependency generation
|
|
# 01p,23oct01,jab cleaned up dependency rules
|
|
# 01o,27aug01,wsl add man pages and other doc niceties
|
|
# 01n,24jul01,r_s changing the make 'ifeq' conditional to work with 'gnu',
|
|
# 'sfgnu', 'sfgnule' etc for TOOL
|
|
# 01m,24jul01,r_s diab specific rules added
|
|
# 01l,05jan99,fle added the DOC_OPTS_XXX flags
|
|
# + made synopsis rule use refLib (refgen)
|
|
# 01k,25nov98,fle doc : made man rule use variables DOC_BOOK and DOC_CHAPTER
|
|
# 01j,10nov98,fle doc : made doc generated in DOC_DIR, and not in a hard
|
|
# coded destination, so we can over write it
|
|
# 01i,08sep98,fle changed refgen options format since refgen.tcl
|
|
# 01h,02sep98,fle doc : replaced mangen with refgen
|
|
# 01g,31aug98,ms fixed LIBNAME creation rule when no objects exist
|
|
# 01f,28jul98,pr added "/" to LIBDIR path
|
|
# 01e,02apr98,pcn Removed Objcopy changes from Tempest view
|
|
# 01d,02dec97,jmp added synopsis rules.
|
|
# 01c,04oct96,yp added LOCAL_CLEAN to clean objs
|
|
# 01b,17may96,yp brought clean rule here
|
|
# 01a,07may96,yp created
|
|
#
|
|
# DESCRIPTION
|
|
# This file contains the makefile rules that are specific to unix to build
|
|
# vxWorks libraries. It is included by rules.library where rules common to
|
|
# all hosts and the default rule exist. This file contains rules for managing
|
|
# archives on Unix hosts using sub-shells. If the archive is write-able we
|
|
# update it. If not we assume that it is a link you want to break or that it
|
|
# doesn't exist. The archive are created from where the object files exist to
|
|
# avoid including paths in the archive.
|
|
#
|
|
# The dependency list is generated by target depend.$(BUILD_EXT)
|
|
# which creates a dependency list for all files c,s and cpp suffixes.
|
|
#
|
|
# Sub directories to be built are expected to be defined in the SUBDIRS macro.
|
|
# if it not defined the subdirs target is not seen.
|
|
#
|
|
# We build the man pages in the directories specified in the macro SUBDIRS
|
|
# before we deal with DOC_FILES in the current directory
|
|
|
|
include $(WIND_BASE)/target/h/make/config/defs.version
|
|
|
|
# Check if mapping file exists
|
|
ifneq ($(wildcard $(DOCS_ROOT)/mappingfile.txt),)
|
|
-include $(wildcard $(DOCS_ROOT)/mappingfile.txt)
|
|
endif
|
|
|
|
ifeq ($(LIBNAME),)
|
|
LIBNAME = lib$(CPU)$(TOOL)vx.a
|
|
endif
|
|
|
|
LIBOBJS_DIRS = $(foreach base, $(LIB_BASE_NAMES), $(LIBDIR_$(base)))
|
|
|
|
ifneq ($(strip $(LIBOBJS_PRECOMP)),)
|
|
LIBOBJS_DIRS += $(foreach base, $(LIB_BASE_NAMES), $(PRECOMPDIR_$(base)))
|
|
endif
|
|
|
|
.PHONY : lib clean arupdate libupdate parobjs objs objsonly conf
|
|
|
|
lib: | $(PRECOMP_DIRS) $(LIBOBJS_DIRS)
|
|
|
|
ifneq ($(strip $(PARAMAKE)),)
|
|
lib: preobjs parobjs arupdate
|
|
else
|
|
lib: conf objs libupdate
|
|
endif
|
|
|
|
clean:
|
|
$(RM) $(LIBOBJS) $(LIBOBJS:.o=.d) $(LOCAL_CLEAN)
|
|
|
|
parobjs :
|
|
$(MAKE) -j $(PARAMAKE) objsonly
|
|
|
|
conf : $(VSB_CONFIG_FILE)
|
|
|
|
objs: | $(PRECOMP_DIRS) $(LIBOBJS_DIRS)
|
|
|
|
objs: objsonly
|
|
|
|
objsonly :
|
|
|
|
arupdate:
|
|
|
|
libupdate:
|
|
|
|
# this internal rule is required to avoid a deficiency in make 3.80. WIll not be required with version 3.81
|
|
define librule_internal
|
|
|
|
$$(subst //,/,$$(LIB_ROOT)/$$(LIBDIRBASE)/$(1)) : $(2)
|
|
|
|
endef
|
|
|
|
define librules
|
|
|
|
objsonly : objsonly_$(2)
|
|
|
|
objsonly_$(2): | $$(LIBDIR_$(2))
|
|
|
|
objsonly_$(2): $$(LIBOBJS_$(2))
|
|
|
|
libupdate: $$(subst //,/,$$(LIB_ROOT)/$$(LIBDIRBASE)/$(1))
|
|
|
|
arupdate: arupdate_$(2)
|
|
|
|
arupdate_$(2): $$(LIBDIR_$(2))
|
|
@ $(AR) crusv $$(subst //,/,$$(LIB_ROOT)/$$(LIBDIRBASE)/$(1)) $$(LIBOBJS_$(2))
|
|
|
|
|
|
.PHONY : $$(subst //,/,$$(LIB_ROOT)/$$(LIBDIRBASE)/$(1))
|
|
|
|
# $$(subst //,/,$$(LIB_ROOT)/$$(LIBDIRBASE)/$(1)) : $$(LIBDIR_$(2)) $$(LIBOBJS_$(2))
|
|
$(foreach obj, $(LIBOBJS_$(2)), $(call librule_internal,$(1),$(obj)))
|
|
|
|
$$(subst //,/,$$(LIB_ROOT)/$$(LIBDIRBASE)/$(1)) : $$(LIBDIR_$(2))
|
|
$$(if $$(strip $$(LIBOBJS_$(2))), \
|
|
$$(if $$(wildcard $$@),\
|
|
@ (cd $$(LIBDIR_$(2)); \
|
|
echo updating $$@; \
|
|
$$(AR) crusv $$@ $$(LIBOBJS_$(2)); \
|
|
),\
|
|
@ (cd $$(LIBDIR_$(2)); \
|
|
echo creating $$@; \
|
|
$$(AR) crusv $$@ *.o; \
|
|
) \
|
|
))
|
|
|
|
endef
|
|
|
|
$(eval $(foreach base, $(LIB_BASE_NAMES), $(call librules,$(call libbase2libname,$(base)),$(base))))
|
|
|
|
LIBOBJS_DEPEND = $(filter-out $(foreach file, $(NODEPENDOBJS), $(LIBDIR)/$(file)), $(LIBOBJS))
|
|
|
|
depend: $(filter %.dummy_d, $(LIBOBJS_DEPEND:.o=.dummy_d))
|
|
- @ :
|
|
|
|
# Dependency list generation. We generate dependencies for the intersection of
|
|
# files listed in OBJS and file present in the local directory, and remove those
|
|
# specified in the NODEPENDOBJS list
|
|
|
|
# If SUBDIRS is not null we need to build the subdirectories before building
|
|
# the current directory. If COMMON_BASIC_SUBDIRS is also not null -- and
|
|
# _WRS_CONFIG_BUILD_BASIC_IPNET is defined -- we then need to rebuild those
|
|
# subdirectories with the additional specification of OPT=-basic
|
|
# -basic now allowed for MSP, UP, SMP, LP64
|
|
|
|
# if we have SUBDIRS
|
|
ifneq ($(SUBDIRS),)
|
|
|
|
BASIC_SUBDIRS = $(filter $(COMMON_BASIC_SUBDIRS),$(SUBDIRS))
|
|
|
|
subdirs : $(SUBDIRS)
|
|
|
|
$(SUBDIRS)::
|
|
cd $@ && $(MAKE) CPU=$(CPU) TOOL=$(TOOL) _WRS_CONFIG_FP=$(_WRS_CONFIG_FP) $(TARGET)
|
|
|
|
ifneq ($(BASIC_SUBDIRS),)
|
|
ifeq ($(OPT),)
|
|
ifneq ($(_WRS_CONFIG_BUILD_BASIC_IPNET),)
|
|
|
|
$(BASIC_SUBDIRS)::
|
|
cd $@ && $(MAKE) CPU=$(CPU) TOOL=$(TOOL) OPT=-basic $(TARGET)
|
|
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
# No SUBDIRS
|
|
else
|
|
subdirs:
|
|
|
|
endif
|
|
|
|
########
|
|
#
|
|
# doc rules
|
|
|
|
# re-define the DOC_DIR for the libraries as the default DOC_DIR is for BSPs
|
|
|
|
DOC_DIR = $(DOCS_ROOT)/$(DOC_KERNEL_API)
|
|
PLUGIN_DIR = $(shell echo $(DOC_KERNEL_API) | cut -d / -f 1)
|
|
DOC_OPTS = -mg -nostrict -missingok
|
|
|
|
# When the desired set of directories to be documented is different from the
|
|
# directories whose software must be built (common for component products),
|
|
# set DOCSUBDIRS to the subdirectories to be documented.
|
|
|
|
ifeq ($(DOCSUBDIRS),)
|
|
DOCSUBDIRS = $(SUBDIRS)
|
|
endif
|
|
|
|
ifneq ($(DOCSUBDIRS),)
|
|
|
|
# define the man target and the default output directory for libraries
|
|
|
|
man:
|
|
-for DIR in $(DOCSUBDIRS) ; \
|
|
do ( cd $$DIR; $(MAKE) CPU=$(CPU) TOOL=$(TOOL) man ) ; \
|
|
done
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/apigen $(DOC_OPTS) \
|
|
-book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(DOC_DIR) \
|
|
-set $(DOC_KERNEL) $(DOC_FILES)
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/apigen $(DOC_OPTS) \
|
|
-book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(DOC_DIR) \
|
|
-set $(DOC_KERNEL) -format xml $(DOC_FILES)
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/apigen $(MAN_PAGE_OPTS) \
|
|
-book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(MAN_PAGE_DIR) \
|
|
-set $(DOC_KERNEL) $(DOC_FILES)
|
|
@date
|
|
|
|
link ::
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/htmlLink -R \
|
|
$(DOCS_ROOT)/$(PLUGIN_DIR)
|
|
|
|
synopsis ::
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/syngen \
|
|
-d $(WIND_BASE)/host/resource/synopsis $(DOC_FILES)
|
|
for DIR in $(DOCSUBDIRS) ; \
|
|
do ( cd $$DIR; $(MAKE) CPU=$(CPU) TOOL=$(TOOL) synopsis ) ; \
|
|
done
|
|
@date
|
|
|
|
clean_synopsis ::
|
|
for DIR in $(DOCSUBDIRS) ; \
|
|
do ( cd $$DIR; $(MAKE) CPU=$(CPU) TOOL=$(TOOL) clean_synopsis ) ; \
|
|
done
|
|
ifneq ($(DOC_FILES),)
|
|
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/syngen -clean \
|
|
-d $(WIND_BASE)/host/resource/synopsis
|
|
endif
|
|
|
|
# No DOCSUBDIRS
|
|
else
|
|
|
|
man:
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/apigen $(DOC_OPTS) \
|
|
-book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(DOC_DIR) \
|
|
-set $(DOC_KERNEL) $(DOC_FILES)
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/apigen $(DOC_OPTS) \
|
|
-book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(DOC_DIR) \
|
|
-set $(DOC_KERNEL) -format xml $(DOC_FILES)
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/apigen $(MAN_PAGE_OPTS) \
|
|
-book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(MAN_PAGE_DIR) \
|
|
-set $(DOC_KERNEL) $(DOC_FILES)
|
|
@date
|
|
|
|
synopsis ::
|
|
ifneq ($(DOC_FILES),)
|
|
-$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/syngen \
|
|
-d $(WIND_BASE)/host/resource/synopsis $(DOC_FILES)
|
|
@date
|
|
endif
|
|
|
|
clean_synopsis ::
|
|
ifneq ($(DOC_FILES),)
|
|
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/syngen -clean \
|
|
-d $(WIND_BASE)/host/resource/synopsis
|
|
endif
|
|
endif
|
|
|
|
# end doc rules
|
|
#
|
|
######
|
|
|