summaryrefslogtreecommitdiff
path: root/src/gir/Makefile.am
blob: 860b2f0e83a07e3fd44ea6425a161f1d0d984532 (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
girdir = $(datarootdir)/gir-1.0

dist_gir_DATA = $(srcdir)/%D%/Disfluid-$(DLL_VERSION).gir

AM_G_IR_SCANNER_FLAGS = \
   --format=gir -i GLib-2.0 -I$(abs_top_srcdir)/include

if BUILD_GOBJECT

# The rule to build the .gir file recursively make the libraries. If
# you run "make -j all", and the libraries are not up to date, then
# there is a race to build the libraries by this call, and by the
# recursive calls due to the gir rules.

# The introspection/Makefile.am is executed early and tries to make
# sure that the recursive call is a no-op. However, if you bypass the
# subdir order by executing "make -j src/gir/Disfluid-….gir", with the
# dll version as …, then the race is still there. Automated build
# scripts usually don’t do this, so it’s fine.

%D%/Disfluid-$(DLL_VERSION).gir: $(INTROSPECTION_LISTS) $(INTROSPECTION_SRC)
	$(MAKE) $(AM_MAKEFLAGS) $(INTROSPECTED_LIBS)
	$(AM_V_GEN) $(G_IR_SCANNER) $(AM_G_IR_SCANNER_FLAGS) $(G_IR_SCANNER_FLAGS) --c-include=disfluid.h --c-include=disfluid/cache_entry.h --c-include=disfluid-gobject.h -n Disfluid --nsversion=$(DLL_VERSION) --symbol-prefix=disfluid_ --output=%D%/Disfluid-$(DLL_VERSION).gir-t $$(for lib in $(INTROSPECTED_LIBS) ; do echo "--library=$$lib" ; done) --cflags-begin $(GOBJECT_CFLAGS) --cflags-end $(INTROSPECTED_FILES) && $(SED) 's/shared-library="[^"]*"/shared-library=""/g' %D%/Disfluid-$(DLL_VERSION).gir-t > %D%/Disfluid-$(DLL_VERSION).gir-fixed && rm %D%/Disfluid-$(DLL_VERSION).gir-t && mv %D%/Disfluid-$(DLL_VERSION).gir-fixed $(srcdir)/%D%/Disfluid-$(DLL_VERSION).gir

else # not BUILD_GOBJECT

%D%/Disfluid-$(DLL_VERSION).gir: $(INTROSPECTION_LISTS) $(INTROSPECTION_SRC)
	@>&2 echo "The introspection sources changed, so the gir file must be updated. Please configure with gobject." ; exit 1

endif # not BUILD_GOBJECT