Makefile 800 B

123456789101112131415161718192021222324252627282930313233343536
  1. MODULE_TOPDIR = ../..
  2. include $(MODULE_TOPDIR)/include/Make/Other.make
  3. DSTDIR = $(GUIDIR)/images
  4. # images
  5. IMGSRC := $(wildcard *.png)
  6. IMGDST := $(patsubst %,$(DSTDIR)/%,$(IMGSRC))
  7. # symbols
  8. CATEGORIES = basic demo extra geology legend n_arrows
  9. SYMSRC := $(foreach dir,$(CATEGORIES),$(wildcard symbols/$(dir)/*.png))
  10. SYMDST := $(patsubst symbols/%,$(DSTDIR)/symbols/%,$(SYMSRC))
  11. default: $(IMGDST) $(SYMDST)
  12. define symbols_rule
  13. $(DSTDIR)/symbols/$(1)/%.png: symbols/$(1)/%.png | $(DSTDIR)/symbols/$(1)
  14. $(INSTALL_DATA) $$< $$@
  15. $(DSTDIR)/symbols/$(1): | $(DSTDIR)/symbols
  16. $(MKDIR) $$@
  17. endef
  18. $(foreach category,$(CATEGORIES),$(eval $(call symbols_rule,$(category))))
  19. $(DSTDIR)/%.png: %.png | $(DSTDIR)
  20. $(INSTALL_DATA) $< $@
  21. $(DSTDIR):
  22. $(MKDIR) $@
  23. $(DSTDIR)/symbols: $(DSTDIR)
  24. $(MKDIR) $@