os161.man.mk 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #
  2. # OS/161 build environment: install man pages
  3. #
  4. # Usage:
  5. # TOP=../..
  6. # .include "$(TOP)/mk/os161.config.mk"
  7. # [defs go here]
  8. # .include "$(TOP)/mk/os161.man.mk"
  9. # [any extra rules go here]
  10. #
  11. # Variables controlling this file:
  12. #
  13. # MANFILES Files to install.
  14. #
  15. # MANDIR Directory under $(OSTREE) to install into,
  16. # e.g. /man/bin. Should have a leading slash.
  17. #
  18. # We may want these directories created. (Used by os161.baserules.mk.)
  19. # We don't use the build directory because we don't currently generate
  20. # anything for man pages.
  21. #MKDIRS+=$(MYBUILDDIR)
  22. MKDIRS+=$(INSTALLTOP)$(MANDIR)
  23. MKDIRS+=$(OSTREE)$(MANDIR)
  24. # Default rule: do nothing.
  25. # (In make the first rule found is the default.)
  26. all: ;
  27. #
  28. # Install: we can install into either $(INSTALLTOP) or $(OSTREE).
  29. # When building the whole system, we always install into the staging
  30. # area. However, if you're working on a particular program it is
  31. # usually convenient to be able to install it directly to $(OSTREE)
  32. # instead of doing a complete top-level install.
  33. #
  34. # Note that we make a hard link instead of a copy by default to reduce
  35. # overhead.
  36. #
  37. install-staging: $(INSTALLTOP)$(MANDIR) .WAIT
  38. .for _F_ in $(MANFILES)
  39. install-staging: $(INSTALLTOP)$(MANDIR)/$(_F_)
  40. $(INSTALLTOP)$(MANDIR)/$(_F_): $(_F_)
  41. rm -f $(.TARGET)
  42. ln $(_F_) $(.TARGET) || cp $(_F_) $(.TARGET)
  43. .endfor
  44. install: $(OSTREE)$(MANDIR) .WAIT installmanpages
  45. installmanpages:
  46. .for _F_ in $(MANFILES)
  47. rm -f $(OSTREE)$(MANDIR)/$(_F_)
  48. ln $(_F_) $(OSTREE)$(MANDIR)/$(_F_) || \
  49. cp $(_F_) $(OSTREE)$(MANDIR)/$(_F_)
  50. .endfor
  51. # Mark targets that don't represent files PHONY, to prevent various
  52. # lossage if files by those names appear.
  53. .PHONY: all install-staging install installmanpages
  54. # Finally, get the shared definitions for the most basic rules.
  55. .include "$(TOP)/mk/os161.baserules.mk"
  56. # End.