rules.unix
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:5k
源码类别:

VxWorks

开发平台:

C/C++

  1. # rules.unix - host specific rules
  2. #
  3. # Copyright 1984-2001, Wind River Systems, Inc.
  4. #
  5. # modification history
  6. # --------------------
  7. # 02g,12mar02,wsl  change BSP_Reference to VxWorks_BSP_Reference
  8. # 02f,27nov01,wsl  allow target.ref files but keep target.nr backward
  9. #                  compatibility
  10. # 02e,29oct01,jab  removed ld script rules
  11. # 02d,25oct01,dat  more gnu-diab changes
  12. # 02c,18oct01,jab  made dependency generation toolchain independent
  13. # 02b,01oct01,dat  consistent use of BSP_NAME macro
  14. # 02a,27aug01,wsl  add man pages
  15. # 01z,24jul01,r_s  diab specific rules added
  16. # 01y,28jun00,jab  force creation of LECFs.
  17. # 01x,17feb00,jab  added LECF generation rules. See notes at rules.
  18. # 01w,02feb99,sjw  use -M -MG in dependency generation so generated files
  19. #    can be included in BSP files.
  20. # 01v,26oct98,ms   made dependency generation overridable from make.CPUTOOL
  21. # 01u,15oct98,fle  doc : renamed book for BSP and put boards reference into
  22. #                  board library
  23. # 01t,05oct98,ms   remove romInit.s dependeny generation for simulators
  24. # 01s,23sep98,fle  doc : adapted -preproc refgen new option
  25. # 01r,23sep98,fle  doc : changed bsp book name
  26. # 01r,22sep98,fle  doc : now use refgen instead of mangen
  27. # 01q,02jan97,dat  added DOC_FLAGS
  28. # 01p,21nov96,p_m  removed unwanted @ in bsp.1 rule
  29. # 01o,21nov96,p_m  changed bsp.1 mode prior to copy target.nr
  30. # 01n,19nov96,dat  mangen error output not dropped.  target.txt made in
  31. #    bsp directory. SPRs 7507 and 7508.
  32. # 01m,15oct96,yp   made rule for include of dependency list silent SPR 4483
  33. # 01l,03oct96,dbt  added backslashes in the sed expressions (HPUX10 port).
  34. # 01k,30jul96,pad  undo change 01j, introduced here by mistake.
  35. # 01j,26jul96,pad  backslashed the $ in the sed expressions (AIX port).
  36. # 01i,10may96,dat  added -DINCLUDE_SCSI for man pages (SPR3941) added copyright
  37. # 01h,18mar96,dat  fixed cpp command for building man pages
  38. # 01g,06mar96,dat  added sed command to insert $TGT_DIR into depend output
  39. # 01f,08feb96,dat  used CONFIG_ALL in making dependency list
  40. # 01e,04nov95,p_m  took care of missing files in docs rule
  41. # 01d,06jul95,jcf  made sed script global.
  42. # 01c,21jun95,yp   added sed script to prevent hardwiring depend. list.
  43. # 01b,10jun95,yp   changed TARGET_DIR to BSP_NAME
  44. # 01a,01jun95,yp   created
  45. #
  46. # DESCRIPTION
  47. # This file contains rules that are host specific to the unix platform.
  48. ## documentation build targets
  49. man : target.html docs
  50. docs :
  51. @- (doc_files="$(DOC_FILES)" ; 
  52. echo -n "Processing " ; 
  53. for file in $$doc_files ; do 
  54.     if [ -f $$file.c ];
  55.     then 
  56. echo -n "$$file " ; 
  57. $(CPP) $(CASFLAGS) $(OPTION_PP_COMMENT) $(DOC_FLAGS) $$file.c 1> 
  58.     $$file.i ; 
  59. $(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/refgen -mg 
  60.     -book VxWorks_BSP_Reference -chapter $(BSP_NAME) 
  61.     -category $(BSP_NAME) 
  62.     -out $(DOCS_ROOT)/vxworks/bsp/$(BSP_NAME) $$file.i ;
  63. $(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/refgen -mg 
  64.     -book VxWorks_BSP_Reference -chapter $(BSP_NAME) 
  65.     -category $(BSP_NAME) -config Auto2txt 
  66.     -out $(MAN_PAGE_DIR)/$(BSP_NAME) $$file.i ;
  67. $(RM) $$file.i ;
  68.     fi  
  69. done ; 
  70. echo -n "Linking " ; 
  71. $(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/htmlLink 
  72.     $(DOCS_ROOT)/vxworks/bsp/$(BSP_NAME) ; 
  73. echo "complete." )
  74. @date
  75. # The following variable assignment selects target.ref over target.nr, and
  76. # exists only to facilitate the transition from nroff markup to refgen
  77. # markup.  When target.nr joins its dinosaur brethren, this should be removed.
  78. TARGET_REF = target.ref
  79. ifeq (,$(wildcard target.ref))
  80.   TARGET_REF = target.nr
  81. endif
  82. target.html:
  83. -$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/refgen -mg -config bsp2html 
  84.     -book VxWorks_BSP_Reference -chapter $(BSP_NAME) 
  85.     -out $(DOCS_ROOT)/vxworks/bsp/$(BSP_NAME) $(TARGET_REF)
  86. -$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/refgen -mg -config bsp2txt 
  87.     -book VxWorks_BSP_Reference -chapter $(BSP_NAME) 
  88.     -out $(MAN_PAGE_DIR)/$(BSP_NAME) $(TARGET_REF)
  89. #
  90. # It is possible to generate dependency lists automatically by depending on 
  91. # a make include file:
  92. #
  93. #     with:  GNU make, SunOS 4.x/5.x make.
  94. #     but not with:  clearmake, HPUX 9.x make, and probably plenty of others.
  95. #
  96. # If depend.$(BSP_NAME) has been removed and you are haplessly without
  97. # a copy of GNU make:
  98. #
  99. # % # In the BSP in question...
  100. # % touch depend.$(BSP_NAME)
  101. # % make depend.$(BSP_NAME)
  102. # % make
  103. #
  104. # Order in the Universe should be restored.
  105. #
  106. depend.$(BSP_NAME) :
  107. ifeq ($(DEPEND_GEN_UTIL),)
  108. $(CC)  $(OPTION_DEPEND_C) $(CFLAGS) *.c $(CONFIG_ALL)/*.c 
  109. | sed -e "s:$(CONFIG_ALL):\$$(CONFIG_ALL):g" 
  110. -e "s:$(TGT_DIR):\$$(TGT_DIR):g" 
  111. -e "s:$(WIND_BASE):\$$(WIND_BASE):g" > $@
  112. ifneq ($(CPU),SIMSPARCSOLARIS)
  113. ifneq ($(CPU),SIMHPPA)
  114. $(CPP) $(OPTION_DEPEND_AS) $(CASFLAGS) romInit.s 
  115. | sed -e "s:$(CONFIG_ALL):\$$(CONFIG_ALL):g" 
  116. -e "s:$(TGT_DIR):\$$(TGT_DIR):g" 
  117. -e "s:$(WIND_BASE):\$$(WIND_BASE):g" >> $@
  118. endif
  119. endif
  120. $(CPP) $(OPTION_DEPEND_AS) $(CASFLAGS) sysALib.s 
  121. | sed -e "s:$(CONFIG_ALL):\$$(CONFIG_ALL):g" 
  122. -e "s:$(TGT_DIR):\$$(TGT_DIR):g" 
  123. -e "s:$(WIND_BASE):\$$(WIND_BASE):g" >> $@
  124. else
  125. $(DEPEND_GEN_UTIL) $(CC_INCLUDE) $(CC_DEFINES) *.c *.s > $@
  126. $(TCL) $(WIND_BASE)/host/src/hutils/bspDepend.tcl $@
  127. endif
  128. # XXX generic rule for assembly files forthcoming
  129. ifneq ($(IS_PRJ),TRUE)
  130. BSP2PRJ=FALSE
  131. ifeq ($(BSP2PRJ),FALSE)
  132. -include depend.$(BSP_NAME)
  133. endif
  134. endif