michael@0: # michael@0: # FreeType 2 modules sub-Makefile michael@0: # michael@0: michael@0: michael@0: # Copyright 1996-2000, 2003, 2006, 2008, 2014 by michael@0: # David Turner, Robert Wilhelm, and Werner Lemberg. michael@0: # michael@0: # This file is part of the FreeType project, and may only be used, modified, michael@0: # and distributed under the terms of the FreeType project license, michael@0: # LICENSE.TXT. By continuing to use, modify, or distribute this file you michael@0: # indicate that you have read the license and understand and accept it michael@0: # fully. michael@0: michael@0: michael@0: # DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY michael@0: # OTHER MAKEFILES. michael@0: michael@0: michael@0: # This file is in charge of handling the generation of the modules list michael@0: # file. michael@0: michael@0: michael@0: # Build the modules list. michael@0: # michael@0: $(FTMODULE_H): $(MODULES_CFG) michael@0: $(FTMODULE_H_INIT) michael@0: $(FTMODULE_H_CREATE) michael@0: $(FTMODULE_H_DONE) michael@0: michael@0: ifneq ($(findstring $(PLATFORM),dos windows os2),) michael@0: OPEN_MODULE := @echo$(space) michael@0: CLOSE_MODULE := >> $(subst /,$(SEP),$(FTMODULE_H)) michael@0: REMOVE_MODULE := @-$(DELETE) $(subst /,$(SEP),$(FTMODULE_H)) michael@0: else michael@0: OPEN_MODULE := @echo " michael@0: CLOSE_MODULE := " >> $(FTMODULE_H) michael@0: REMOVE_MODULE := @-$(DELETE) $(FTMODULE_H) michael@0: endif michael@0: michael@0: michael@0: define FTMODULE_H_INIT michael@0: $(REMOVE_MODULE) michael@0: @-echo Generating modules list in $(FTMODULE_H)... michael@0: $(OPEN_MODULE)/* This is a generated file. */$(CLOSE_MODULE) michael@0: endef michael@0: michael@0: # It is no mistake that the final closing parenthesis is on the michael@0: # next line -- it produces proper newlines during the expansion michael@0: # of `foreach'. michael@0: # michael@0: define FTMODULE_H_CREATE michael@0: $(foreach COMMAND,$(FTMODULE_H_COMMANDS),$($(COMMAND)) michael@0: ) michael@0: endef michael@0: michael@0: define FTMODULE_H_DONE michael@0: $(OPEN_MODULE)/* EOF */$(CLOSE_MODULE) michael@0: @echo done. michael@0: endef michael@0: michael@0: michael@0: # $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver michael@0: # in the `module.mk' rules file. michael@0: # michael@0: OPEN_DRIVER := $(OPEN_MODULE)FT_USE_MODULE( michael@0: CLOSE_DRIVER := )$(CLOSE_MODULE) michael@0: michael@0: ECHO_DRIVER := @echo "* module:$(space) michael@0: ECHO_DRIVER_DESC := ( michael@0: ECHO_DRIVER_DONE := )" michael@0: michael@0: # Each `module.mk' in the `src/*' subdirectories adds a variable with michael@0: # commands to $(FTMODULE_H_COMMANDS). Note that we can't use SRC_DIR here. michael@0: # michael@0: -include $(patsubst %,$(TOP_DIR)/src/%/module.mk,$(MODULES)) michael@0: michael@0: michael@0: # EOF