modules.mk 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #
  2. # FreeType 2 modules sub-Makefile
  3. #
  4. # Copyright (C) 1996-2019 by
  5. # David Turner, Robert Wilhelm, and Werner Lemberg.
  6. #
  7. # This file is part of the FreeType project, and may only be used, modified,
  8. # and distributed under the terms of the FreeType project license,
  9. # LICENSE.TXT. By continuing to use, modify, or distribute this file you
  10. # indicate that you have read the license and understand and accept it
  11. # fully.
  12. # DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY
  13. # OTHER MAKEFILES.
  14. # This file is in charge of handling the generation of the modules list
  15. # file.
  16. # Build the modules list.
  17. #
  18. $(FTMODULE_H): $(MODULES_CFG)
  19. $(FTMODULE_H_INIT)
  20. $(FTMODULE_H_CREATE)
  21. $(FTMODULE_H_DONE)
  22. ifneq ($(findstring $(PLATFORM),dos windows os2),)
  23. OPEN_MODULE := @echo$(space)
  24. CLOSE_MODULE := >> $(subst /,$(SEP),$(FTMODULE_H))
  25. REMOVE_MODULE := @-$(DELETE) $(subst /,$(SEP),$(FTMODULE_H))
  26. else
  27. OPEN_MODULE := @echo "
  28. CLOSE_MODULE := " >> $(FTMODULE_H)
  29. REMOVE_MODULE := @-$(DELETE) $(FTMODULE_H)
  30. endif
  31. define FTMODULE_H_INIT
  32. $(REMOVE_MODULE)
  33. $(info Generating modules list in $(FTMODULE_H)...)
  34. $(OPEN_MODULE)/* This is a generated file. */$(CLOSE_MODULE)
  35. endef
  36. # It is no mistake that the final closing parenthesis is on the
  37. # next line -- it produces proper newlines during the expansion
  38. # of `foreach'.
  39. #
  40. define FTMODULE_H_CREATE
  41. $(foreach COMMAND,$(FTMODULE_H_COMMANDS),$($(COMMAND))
  42. )
  43. endef
  44. define FTMODULE_H_DONE
  45. $(OPEN_MODULE)/* EOF */$(CLOSE_MODULE)
  46. $(info done.)
  47. endef
  48. # $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver
  49. # in the `module.mk' rules file.
  50. #
  51. OPEN_DRIVER := $(OPEN_MODULE)FT_USE_MODULE(
  52. CLOSE_DRIVER := )$(CLOSE_MODULE)
  53. ECHO_DRIVER := @echo "* module:$(space)
  54. ECHO_DRIVER_DESC := (
  55. ECHO_DRIVER_DONE := )"
  56. # Each `module.mk' in the `src/*' subdirectories adds a variable with
  57. # commands to $(FTMODULE_H_COMMANDS). Note that we can't use SRC_DIR here.
  58. #
  59. -include $(patsubst %,$(TOP_DIR)/src/%/module.mk,$(MODULES))
  60. # EOF