rules-lib.unix
资源名称:ixp425BSP.rar [点击查看]
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:6k
源码类别:
VxWorks
开发平台:
C/C++
- # rules-lib.unix - Host specific default definitions
- #
- # modification history
- # --------------------
- # 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.$(CPU)$(TOOL) 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
- lib: $(TGT_DIR)/lib/$(LIBNAME)
- clean:
- $(RM) $(LIBOBJS) $(LOCAL_CLEAN)
- $(RM) depend.$(CPU)$(TOOL)
- # This is believed to be obsolete. If it is needed we can bring it back
- # ifneq ($(CLEANTAIL),)
- # $(MAKE) -f Makefile CPU=$(CPU) TOOL=$(TOOL)
- # $(CLEANTAIL)
- # CLEANTAIL='')
- # endif
- $(TGT_DIR)/lib/$(LIBNAME): $(MAKE_LIBDIR) $(LIBOBJS)
- @ - if [ -w $@ ] ; then
- (cd $(LIBDIR);
- echo "$(AR) crus " $@ $?;
- $(AR) crus $@ $(notdir $?));
- else
- (cd $(LIBDIR);
- $(RM) ../$(LIBNAME);
- echo "$(AR) crus " $@ $(LIBDIR)/"*.o";
- $(AR) crus $@ *.o);
- fi
- #dependency list generation
- depend.$(CPU)$(TOOL) : Makefile
- @ $(RM) $@
- @ echo "Creating depend.$(CPU)$(TOOL)"
- ifneq ($(wildcard *.c),)
- @ for FILE in $(filter-out $(NODEPENDOBJS), $(wildcard *.c));
- do
- $(CC) $(OPTION_DEPEND) $(CFLAGS) $$FILE
- | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@;
- done
- endif
- ifneq ($(wildcard *.s),)
- @ for FILE in $(filter-out $(NODEPENDOBJS), $(wildcard *.s));
- do
- $(CPP) $(OPTION_DEPEND) $(CASFLAGS) $$FILE
- | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@;
- done
- endif
- ifneq ($(wildcard *.cpp),)
- @ for FILE in $(filter-out $(NODEPENDOBJS), $(wildcard *.cpp));
- do
- $(CXX) $(OPTION_DEPEND) $(CFLAGS) $$FILE
- | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@ ;
- done
- endif
- # if SUBDIRS is not null we need to build the subdirectories before building
- # the current directory.
- # if we have SUBDIRS
- ifneq ($(SUBDIRS),)
- subdirs : $(SUBDIRS)
- $(SUBDIRS)::
- $(MAKE) -C $@ CPU=$(CPU) TOOL=$(TOOL) $(TARGET)
- # 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)/vxworks/ref
- # 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/refgen $(DOC_OPTS)
- -book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(DOC_DIR)
- $(DOC_FILES)
- -$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/refgen $(MAN_PAGE_OPTS)
- -book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(MAN_PAGE_DIR)
- $(DOC_FILES)
- @date
- link ::
- -$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/htmlLink -R
- $(DOCS_ROOT)/vxworks/ref
- 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/refgen $(DOC_OPTS)
- -book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(DOC_DIR)
- $(DOC_FILES)
- -$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/refgen $(MAN_PAGE_OPTS)
- -book $(DOC_BOOK) -chapter $(DOC_CHAPTER) -out $(MAN_PAGE_DIR)
- $(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
- #
- ######