blob: c4a882cbdb57446aba7c2d3adb98b22022f50f37 [file] [log] [blame]
David Turner74043012000-07-08 00:22:20 +00001#
2# FreeType 2 modules sub-Makefile
3#
4
Werner Lemberg47a5f412000-10-17 03:38:43 +00005
Werner Lemberg744dd452008-02-11 08:22:40 +00006# Copyright 1996-2000, 2003, 2006, 2008 by
David Turner74043012000-07-08 00:22:20 +00007# 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 Turner74043012000-07-08 00:22:20 +000023
Werner Lemberg59939242006-01-31 20:17:42 +000024# Build the modules list.
David Turner74043012000-07-08 00:22:20 +000025#
Werner Lemberg59939242006-01-31 20:17:42 +000026$(FTMODULE_H): $(MODULES_CFG)
27 $(FTMODULE_H_INIT)
28 $(FTMODULE_H_CREATE)
29 $(FTMODULE_H_DONE)
Werner Lemberg389acc62001-01-01 17:25:21 +000030
31ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
32 OPEN_MODULE := @echo$(space)
Werner Lemberg744dd452008-02-11 08:22:40 +000033 CLOSE_MODULE := >> $(subst /,$(SEP),$(FTMODULE_H))
34 REMOVE_MODULE := @-$(DELETE) $(subst /,$(SEP),$(FTMODULE_H))
Werner Lemberg389acc62001-01-01 17:25:21 +000035else
36 OPEN_MODULE := @echo "
Werner Lemberg59939242006-01-31 20:17:42 +000037 CLOSE_MODULE := " >> $(FTMODULE_H)
38 REMOVE_MODULE := @-$(DELETE) $(FTMODULE_H)
Werner Lemberg389acc62001-01-01 17:25:21 +000039endif
40
41
Werner Lemberg59939242006-01-31 20:17:42 +000042define FTMODULE_H_INIT
43$(REMOVE_MODULE)
44@-echo Generating modules list in $(FTMODULE_H)...
45$(OPEN_MODULE)/* This is a generated file. */$(CLOSE_MODULE)
46endef
David Turner74043012000-07-08 00:22:20 +000047
Werner Lemberg59939242006-01-31 20:17:42 +000048# 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#
52define FTMODULE_H_CREATE
53$(foreach COMMAND,$(FTMODULE_H_COMMANDS),$($(COMMAND))
54)
55endef
56
57define FTMODULE_H_DONE
58$(OPEN_MODULE)/* EOF */$(CLOSE_MODULE)
59@echo done.
60endef
61
David Turner74043012000-07-08 00:22:20 +000062
David Turner74043012000-07-08 00:22:20 +000063# $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver
64# in the `module.mk' rules file.
65#
66OPEN_DRIVER := $(OPEN_MODULE)FT_USE_MODULE(
67CLOSE_DRIVER := )$(CLOSE_MODULE)
68
Werner Lemberg33d02362000-12-06 16:31:30 +000069ECHO_DRIVER := @echo "* module:$(space)
David Turner74043012000-07-08 00:22:20 +000070ECHO_DRIVER_DESC := (
71ECHO_DRIVER_DONE := )"
72
Werner Lemberg59939242006-01-31 20:17:42 +000073# 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 Turner74043012000-07-08 00:22:20 +000075#
Werner Lemberg59939242006-01-31 20:17:42 +000076-include $(patsubst %,$(TOP_DIR)/src/%/module.mk,$(MODULES))
David Turner74043012000-07-08 00:22:20 +000077
Werner Lemberg858f3102003-06-09 04:46:30 +000078
David Turner74043012000-07-08 00:22:20 +000079# EOF