os161.includes.mk 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #
  2. # OS/161 build environment: include file installation.
  3. #
  4. # Set INCLUDES to a list of pairs:
  5. #
  6. # source-dir destination-dir
  7. #
  8. # where the destination dir should begin with include/.
  9. # All header files in each dir are copied.
  10. #
  11. # Optionally set INCLUDELINKS to a list of pairs
  12. #
  13. # target linkname
  14. #
  15. # This will create symlinks target <- linkname. linkname
  16. # should begin with include/. target usually won't.
  17. #
  18. #
  19. # If you forcibly make install, header files are copied to $(OSTREE).
  20. #
  21. all depend install-staging clean distclean tags: ;
  22. .for _SRC_ _DEST_ in $(INCLUDES)
  23. MKDIRS+=$(INSTALLTOP)/$(_DEST_)
  24. includes: $(INSTALLTOP)/$(_DEST_)
  25. MKDIRS+=$(OSTREE)/$(_DEST_)
  26. install: $(OSTREE)/$(_DEST_)
  27. .endfor
  28. includes:
  29. .for _SRC_ _DEST_ in $(INCLUDES)
  30. $(TOP)/mk/installheaders.sh $(_SRC_) $(INSTALLTOP)/$(_DEST_)
  31. .endfor
  32. .for _TGT_ _LINK_ in $(INCLUDELINKS)
  33. ln -sf $(_TGT_) $(INSTALLTOP)/$(_LINK_)
  34. .endfor
  35. install:
  36. .for _SRC_ _DEST_ in $(INCLUDES)
  37. $(TOP)/mk/installheaders.sh $(_SRC_) $(OSTREE)/$(_DEST_)
  38. .endfor
  39. .for _TGT_ _LINK_ in $(INCLUDELINKS)
  40. ln -sf $(_TGT_) $(INSTALLTOP)/$(_LINK_)
  41. .endfor
  42. .PHONY: all depend install-staging clean distclean tags
  43. .PHONY: includes install
  44. .include "$(TOP)/mk/os161.baserules.mk"
  45. foo:
  46. echo $(OSTREE)