copy.mak 609 B

12345678910111213141516171819202122232425262728
  1. # -*- make -*-
  2. # This installs arbitary files into a directory
  3. # Input
  4. # $(SOURCE) - The documents to use
  5. # $(TO) - The directory to put them in
  6. # All output is writtin to files in the build/$(TO) directory
  7. # See defaults.mak for information about LOCAL
  8. # Some local definitions
  9. LOCAL := copy-$(firstword $(SOURCE))
  10. $(LOCAL)-LIST := $(addprefix $(TO)/,$(SOURCE))
  11. # Install generation hooks
  12. doc: $($(LOCAL)-LIST)
  13. veryclean: veryclean/$(LOCAL)
  14. $($(LOCAL)-LIST) : $(TO)/% : %
  15. echo Installing $< to $(@D)
  16. cp $< $(@D)
  17. # Clean rule
  18. .PHONY: veryclean/$(LOCAL)
  19. veryclean/$(LOCAL):
  20. -rm -rf $($(@F)-LIST)