copy.mak 644 B

123456789101112131415161718192021222324252627282930
  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. MKDIRS += $(dir $($(LOCAL)-LIST))
  15. $($(LOCAL)-LIST) : $(TO)/% : %
  16. echo Installing $< to $(@D)
  17. cp $< $(@D)
  18. # Clean rule
  19. .PHONY: veryclean/$(LOCAL)
  20. veryclean/$(LOCAL):
  21. -rm -rf $($(@F)-LIST)