b10924a78e4ed36e20c056e306ac16dc4d775ab4
[platform/upstream/freetype2.git] / builds / exports.mk
1 #
2 # FreeType 2 exports sub-Makefile
3 #
4
5
6 # Copyright (C) 2005-2023 by
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 sub-Makefile is used to compute the list of exported symbols whenever
21 # the EXPORTS_LIST variable is defined by one of the platform or compiler
22 # specific build files.
23 #
24 # EXPORTS_LIST contains the name of the `list' file, for example a Windows
25 # .DEF file.
26 #
27 ifneq ($(EXPORTS_LIST),)
28
29   # CCexe is the compiler used to compile the `apinames' tool program
30   # on the host machine.  This isn't necessarily the same as the compiler
31   # which can be a cross-compiler for a different architecture, for example.
32   #
33   ifeq ($(CCexe),)
34     CCexe := $(CC)
35   endif
36
37   # TE acts like T, but for executables instead of object files.
38   ifeq ($(TE),)
39     TE := $T
40   endif
41
42   # The list of public headers we're going to parse.
43   PUBLIC_HEADERS := $(filter-out $(PUBLIC_DIR)/ftmac.h, \
44                                  $(wildcard $(PUBLIC_DIR)/*.h))
45   ifneq ($(ftmac_c),)
46     PUBLIC_HEADERS += $(PUBLIC_DIR)/ftmac.h
47   endif
48
49   # The `apinames' source and executable.  We use $E_BUILD as the host
50   # executable suffix, which *includes* the final dot.
51   #
52   # Note that $(APINAMES_OPTIONS) is empty, except for Windows compilers.
53   #
54   APINAMES_SRC := $(subst /,$(SEP),$(TOP_DIR)/src/tools/apinames.c)
55   APINAMES_EXE := $(subst /,$(SEP),$(OBJ_DIR)/apinames$(E_BUILD))
56
57   $(APINAMES_EXE): $(APINAMES_SRC)
58           $(CCexe) $(CCexe_CFLAGS) $(TE)$@ $< $(CCexe_LDFLAGS)
59
60   .PHONY: symbols_list
61
62   symbols_list: $(EXPORTS_LIST)
63
64   # We manually add TT_New_Context and TT_RunIns, which are needed by TT
65   # debuggers, to the EXPORTS_LIST.
66   #
67   $(EXPORTS_LIST): $(APINAMES_EXE) $(PUBLIC_HEADERS)
68           $(subst /,$(SEP),$(APINAMES_EXE)) -o$@ $(APINAMES_OPTIONS) $(PUBLIC_HEADERS)
69           @echo TT_New_Context >> $(EXPORTS_LIST)
70           @echo TT_RunIns >> $(EXPORTS_LIST)
71
72   $(PROJECT_LIBRARY): $(EXPORTS_LIST)
73
74   CLEAN += $(EXPORTS_LIST) \
75            $(APINAMES_EXE)
76
77 endif
78
79
80 # EOF