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