-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
141 lines (120 loc) · 4.14 KB
/
Makefile.am
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
## Process this file with automake to produce Makefile.in.
#
# Copyright © 2012-2013 Tobias Quathamer
#
# This file is part of libisocodes.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
ACLOCAL_AMFLAGS = -I m4
# This is needed for gettext, it is too much work to rewrite
# po/Makefile.in.in for a non-recursive approach.
SUBDIRS = po
EXTRA_DIST = libisocodes-$(VERSION).gir \
vapi/config.vapi \
libisocodes.vapi \
libisocodes.pc.in \
CHANGELOG.md \
$(codetest_testfiles) \
$(codetest_datafiles)
lib_LTLIBRARIES = libisocodes.la
libisocodes_la_SOURCES = \
src/isocodes.vala \
src/iso_3166.vala \
src/iso_3166_item.vala \
src/iso_3166_2.vala \
src/iso_3166_2_item.vala \
src/iso_639.vala \
src/iso_639_item.vala \
src/iso_639_3.vala \
src/iso_639_3_item.vala \
src/iso_639_5.vala \
src/iso_639_5_item.vala \
src/iso_4217.vala \
src/iso_4217_item.vala \
src/iso_15924.vala \
src/iso_15924_item.vala \
src/exceptions.vala
include_HEADERS = libisocodes.h
libisocodes.h:
touch $@
VALAFLAGS = \
--pkg libxml-2.0 \
--pkg gee-0.8 \
--library=libisocodes \
--vapidir=$(srcdir)/vapi --pkg config \
--header=libisocodes.h \
--gir=libisocodes-$(VERSION).gir
# Here are two quotes needed due to expansion by libtool
libisocodes_la_CPPFLAGS = -include config.h -DLOCALEDIR=\""$(localedir)"\"
libisocodes_la_CFLAGS = $(GOBJECT_CFLAGS) $(GLIB_CFLAGS) $(LIBXML_CFLAGS) $(GEE_CFLAGS)
libisocodes_la_LIBADD = $(GOBJECT_LIBS) $(GLIB_LIBS) $(LIBXML_LIBS) $(GEE_LIBS)
libisocodes_la_LDFLAGS = -version-info $(LIBISOCODES_LT_VERSION)
DISTCLEANFILES = libisocodes.pc
MAINTAINERCLEANFILES = config.h.in~ libisocodes.h libisocodes.vapi libisocodes-$(VERSION).gir
# Create the pkg-config file
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = libisocodes.pc
libisocodes.pc: $(srcdir)/libisocodes.pc.in
sed -e 's![@]prefix[@]!$(prefix)!g' \
-e 's![@]exec_prefix[@]!$(exec_prefix)!g' \
-e 's![@]includedir[@]!$(includedir)!g' \
-e 's![@]libdir[@]!$(libdir)!g' \
-e 's![@]PACKAGE_VERSION[@]!$(PACKAGE_VERSION)!g' \
$(srcdir)/libisocodes.pc.in > $@
# Install libisocodes.vapi
libisocodes.vapi: $(lib_LTLIBRARIES)
vapidir = $(datadir)/vala/vapi
vapi_DATA = libisocodes.vapi
# Generate and install gir and typelib data
libisocodes-$(VERSION).gir: $(lib_LTLIBRARIES)
girdir = $(datadir)/gir-1.0
gir_DATA = libisocodes-$(VERSION).gir
libisocodes-$(VERSION).typelib: libisocodes-$(VERSION).gir
$(G_IR_COMPILER) --shared-library=libisocodes.so --output=$@ $<
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = libisocodes-$(VERSION).typelib
CLEANFILES = $(typelib_DATA)
# All code below is needed for testing the package
codetest_testfiles = \
tests/codetest.vala \
tests/test_iso_3166.vala \
tests/test_iso_3166_2.vala \
tests/test_iso_639.vala \
tests/test_iso_639_3.vala \
tests/test_iso_639_5.vala \
tests/test_iso_4217.vala \
tests/test_iso_15924.vala
codetest_datafiles = \
tests/data/3.x/iso_3166.xml \
tests/data/3.x/iso_3166_2.xml \
tests/data/3.x/iso_639.xml \
tests/data/3.x/iso_639_3.xml \
tests/data/3.x/iso_639_5.xml \
tests/data/3.x/iso_4217.xml \
tests/data/3.x/iso_15924.xml \
tests/data/3.x/no-iso-data.txt
codetest_sources = $(codetest_testfiles) $(libisocodes_la_SOURCES)
codetest_VALAFLAGS = \
--pkg libxml-2.0 \
--pkg gee-0.8 \
--vapidir=$(srcdir)/vapi --pkg config \
-X -I. \
-X -DGETTEXT_PACKAGE=\"libisocodes\" \
-X -DLOCALEDIR=\"$(localedir)\" \
-X -DTESTDIR=\"$(top_srcdir)/tests/data\"
codetest: $(addprefix $(srcdir)/, $(codetest_sources))
$(VALAC) $(codetest_VALAFLAGS) --output=$@ $^
check-local: codetest
gtester --verbose $<
DISTCLEANFILES += codetest