summaryrefslogtreecommitdiffstats
path: root/accessible/interfaces/ia2/Makefile.in
blob: 36110d08fe7c9dcdc6654acae0351300ff2bf3cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

IA2DIR        = $(topsrcdir)/other-licenses/ia2

GARBAGE       += $(MIDL_GENERATED_FILES) \
                 $(MIDL_UNUSED_GENERATED_FILES) \
                 $(NULL)

# Please keep this list in sync with the moz.build file until the rest of this
# Makefile is ported over.
MIDL_INTERFACES = \
  Accessible2.idl \
  Accessible2_2.idl \
  Accessible2_3.idl \
  AccessibleAction.idl \
  AccessibleApplication.idl \
  AccessibleComponent.idl \
  AccessibleDocument.idl \
  AccessibleEditableText.idl \
  AccessibleHyperlink.idl \
  AccessibleHypertext.idl \
  AccessibleHypertext2.idl \
  AccessibleImage.idl \
  AccessibleRelation.idl \
  AccessibleTable.idl \
  AccessibleTable2.idl \
  AccessibleTableCell.idl \
  AccessibleText.idl \
  AccessibleText2.idl \
  AccessibleValue.idl \
  $(NULL)

# Please keep this list in sync with the moz.build file until the rest of this
# Makefile is ported over.
MIDL_ENUMS = \
  AccessibleEventId.idl \
  AccessibleRole.idl \
  AccessibleStates.idl \
  IA2CommonTypes.idl \
  $(NULL)

MIDL_LIBRARIES = \
  IA2Typelib.idl \
  $(NULL)

CSRCS = \
  dlldata.c \
  $(MIDL_INTERFACES:%.idl=%_p.c) \
  $(MIDL_INTERFACES:%.idl=%_i.c) \
  $(NULL)

MIDL_GENERATED_FILES = \
  dlldata.c \
  $(MIDL_INTERFACES:%.idl=%_p.c) \
  $(MIDL_INTERFACES:%.idl=%_i.c) \
  $(MIDL_INTERFACES:%.idl=%.h) \
  $(MIDL_ENUMS:%.idl=%.h) \
  $(NULL)

# We want to generate a .tlb from MIDL_LIBRARIES, but midl also generates
# a bunch of .h and .c files that we're not interested in.
MIDL_UNUSED_GENERATED_FILES = \
  $(MIDL_LIBRARIES:%.idl=%_p.c) \
  $(MIDL_LIBRARIES:%.idl=%_i.c) \
  $(MIDL_LIBRARIES:%.idl=%.h) \
  $(MIDL_LIBRARIES:%.idl=%.c) \
  $(NULL)

EMBED_MANIFEST_AT = 2

INSTALL_TARGETS += midl
midl_FILES := $(filter %.h %_i.c,$(MIDL_GENERATED_FILES))
midl_DEST = $(DIST)/include
midl_TARGET := export

include $(topsrcdir)/config/rules.mk

# generate list of to-be-generated files that are missing
# but ignore special file dlldata.c
missing:=$(strip $(foreach onefile,$(strip $(subst dlldata.c,,$(MIDL_GENERATED_FILES))),$(if $(wildcard $(onefile)),,$(onefile))))

missing_base:=$(sort $(basename $(subst _p.c,,$(subst _i.c,,$(missing)))))

$(MIDL_GENERATED_FILES) : midl_done typelib_done

ifneq ("$(missing)","")
midl_done : FORCE
endif

midl_done : $(addprefix $(IA2DIR)/,$(MIDL_INTERFACES) $(MIDL_ENUMS))
	for idl in $(sort $(subst FORCE,,$?) $(addsuffix .idl,$(addprefix $(IA2DIR)/,$(missing_base)))); do \
	  $(MIDL) $(MIDL_FLAGS) -app_config -I $(IA2DIR) -Oicf $$idl; \
	done
	touch $@

# The intent of this rule is to generate the .tlb file that is referenced in the
# .rc file for IA2Marshal.dll
typelib_done : $(MIDL_LIBRARIES)
	for idl in $?; do \
		$(MIDL) $(MIDL_FLAGS) -app_config -I $(IA2DIR) -D _MIDL_DECLARE_WIREM_HANDLE -dlldata `basename $$idl .idl`.c -Oicf $$idl; \
	done
	touch $@

# This marshall dll is NOT registered in the installer (agreed to by IA2 participants)
register::
	regsvr32 -s $(DIST)/bin/$(SHARED_LIBRARY)