home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Makefiles / pb_makefiles / installhdrs.make < prev    next >
Text File  |  1996-12-13  |  3KB  |  103 lines

  1. #
  2. # installhdrs.make
  3. #
  4. # Rules for installing public and private header files of a project.  This
  5. # target is invoked automatically from the install target.
  6. #
  7. # PUBLIC TARGETS
  8. #    installhdrs: copies public and private header files to their
  9. #        final destination
  10. #
  11. # IMPORTED VARIABLES
  12. #    BEFORE_INSTALLHDRS: targets to build before installing headers for a subproject
  13. #    AFTER_INSTALLHDRS: targets to build after installing headers for a subproject
  14. #
  15. # EXPORTED VARIABLES
  16. #    PUBLIC_HDR_INSTALLDIR:  where to install public headers.  Don't forget
  17. #        to prefix this with DSTROOT when you use it.
  18. #    PRIVATE_HDR_INSTALLDIR:  where to install private headers.  Don't forget
  19. #     to prefix this with DSTROOT when you use it.
  20. #
  21.  
  22. .PHONY: installhdrs local-installhdrs recursive-installhdrs
  23. .PHONY: install-public-headers install-private-headers
  24.  
  25. #
  26. # Variable definitions
  27. #
  28.  
  29. ACTUAL_INSTALLHDRS = install-public-headers install-private-headers
  30.  
  31. #
  32. # First we do local installation, then we recurse
  33. #
  34.  
  35. ifneq "YES" "$(SUPPRESS_BUILD)"
  36. installhdrs: local-installhdrs recursive-installhdrs
  37. recursive-installhdrs: $(ALL_SUBPROJECTS:%=installhdrs@%) local-installhdrs
  38. $(ALL_SUBPROJECTS:%=installhdrs@%): local-installhdrs
  39. endif
  40.  
  41. #
  42. # Local installation
  43. #
  44.  
  45. local-installhdrs: announce-installhdrs $(BEFORE_INSTALLHDRS) $(ACTUAL_INSTALLHDRS) $(AFTER_INSTALLHDRS)
  46. $(AFTER_INSTALLHDRS): announce-installhdrs $(BEFORE_INSTALLHDRS) $(ACTUAL_INSTALLHDRS)
  47. $(ACTUAL_INSTALLHDRS): announce-installhdrs $(BEFORE_INSTALLHDRS)
  48. $(BEFORE_INSTALLHDRS): announce-installhdrs
  49.  
  50. #
  51. # Before we do anything we must announce our intentions
  52. # We don't announce our intentions if we were hooked in from the
  53. # postinstall recursion, since the postinstall has already been announced
  54. #
  55.  
  56. announce-installhdrs:
  57. ifeq "installhdrs" "$(RECURSING_ON_TARGET)"
  58. ifndef RECURSING
  59.     $(SILENT) $(ECHO) Installing header files...
  60. else
  61.     $(SILENT) $(ECHO) $(RECURSIVE_ELLIPSIS)in $(NAME)
  62. endif
  63. endif
  64.  
  65. #
  66. # Ensure that important directories exist
  67. #
  68.  
  69. installhdrs-directories: $(SFILE_DIR)
  70.  
  71. #
  72. # If there are any public headers we must copy them to the destination directory
  73. #
  74.  
  75. ifneq "" "$(PUBLIC_HEADERS)$(OTHER_PUBLIC_HEADERS)"
  76. install-public-headers: installhdrs-directories $(DSTROOT)$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS)
  77. ifneq "$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)" ""
  78.     $(SILENT) $(FASTCP) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS) $(DSTROOT)$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)
  79. else
  80.     $(SILENT) $(ECHO) Must set a public header directory to install public headers. ;  exit 1
  81. endif
  82. endif
  83.  
  84. #
  85. # The same goes for private headers
  86. #
  87.  
  88. ifneq "" "$(PRIVATE_HEADERS)$(OTHER_PRIVATE_HEADERS)"
  89. install-private-headers: installhdrs-directories $(DSTROOT)$(PRIVATE_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(PRIVATE_HEADERS) $(OTHER_PRIVATE_HEADERS)
  90. ifneq "$(PRIVATE_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)" ""
  91.     $(SILENT) $(FASTCP) $(PRIVATE_HEADERS) $(OTHER_PRIVATE_HEADERS) $(DSTROOT)$(PRIVATE_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX)
  92. else
  93.     $(SILENT) $(ECHO) Must set a private header directory to install private headers. ;  exit 1
  94. endif
  95. endif
  96.  
  97. #
  98. # Rules for creating directories
  99. #
  100.  
  101. $(DSTROOT)$(PUBLIC_HDR_INSTALLDIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(DSTROOT)$(PRIVATE_HDR_INSTALLDIR)$(PRIVATE_HEADER_DIR_SUFFIX):
  102.     $(MKDIRS) $@
  103.