20
20
# We distribute the generated sources err-sources.h and err-codes.h,
21
21
# because they are needed to build the po directory, and they don't
22
22
# depend on the configuration anyway.
24
localedir = $(datadir)/locale
25
bin_PROGRAMS = gpg-error
26
lib_LTLIBRARIES = libgpg-error.la
27
include_HEADERS = gpg-error.h
28
bin_SCRIPTS = gpg-error-config
29
m4datadir = $(datadir)/aclocal
30
m4data_DATA = gpg-error.m4
23
33
EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \
24
34
mkerrnos.awk errnos.in \
25
35
mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \
26
36
mkheader.awk gpg-error.h.in \
27
err-sources.h err-codes.h gpg-error-config.in gpg-error.m4
37
err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \
38
gpg-error.def versioninfo.rc.in
28
40
BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
29
41
err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h
43
tmp_files = _mkerrcodes.h
30
45
CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
31
46
gpg-error.h mkerrcodes mkerrcodes.h \
32
err-sources-sym.h err-codes-sym.h errnos-sym.h
34
bin_SCRIPTS = gpg-error-config
35
m4datadir = $(datadir)/aclocal
36
m4data_DATA = gpg-error.m4
38
include_HEADERS = gpg-error.h
40
lib_LTLIBRARIES = libgpg-error.la
42
libgpg_error_la_LDFLAGS = -version-info \
43
@LIBGPG_ERROR_LT_CURRENT@:@LIBGPG_ERROR_LT_REVISION@:@LIBGPG_ERROR_LT_AGE@
45
libgpg_error_la_SOURCES = gpg-error.h gettext.h \
46
strsource.c strerror.c code-to-errno.c code-from-errno.c
48
libgpg_error_la_LIBADD = @LTLIBINTL@
50
bin_PROGRAMS = gpg-error
51
gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
52
gpg_error_LDADD = ./libgpg-error.la
47
err-sources-sym.h err-codes-sym.h errnos-sym.h $(tmp_files)
51
arch_sources = w32-gettext.h w32-gettext.c
53
LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
54
`echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
55
sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
58
$(LTRCCOMPILE) -i $< -o $@
60
gpg_error_res = versioninfo.o
61
gpg_error_res_ldflag = -Wl,$(gpg_error_res)
62
no_undefined = -no-undefined
63
export_symbols = -export-symbols $(srcdir)/gpg-error.def
66
$(INSTALL) gpg-error.def $(DESTDIR)$(libdir)/gpg-error-.def
69
-rm $(DESTDIR)$(libdir)/gpg-error.def
71
libgpg_error_la_DEPENDENCIES = $(gpg_error_res) gpg-error.def
77
gpg_error_res_ldflag =
83
intllibs = @LTLIBINTL@
88
libgpg_error_la_LDFLAGS = $(gpg_error_res_ldflag) -version-info \
89
@LIBGPG_ERROR_LT_CURRENT@:@LIBGPG_ERROR_LT_REVISION@:@LIBGPG_ERROR_LT_AGE@ \
90
$(no_undefined) $(export_symbols)
92
libgpg_error_la_SOURCES = gpg-error.h gettext.h $(arch_sources) \
93
init.c strsource.c strerror.c code-to-errno.c code-from-errno.c
95
libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I../intl
96
libgpg_error_la_LIBADD = $(intllibs)
98
gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c $(arch_sources)
99
gpg_error_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I../intl
100
gpg_error_LDADD = ./libgpg-error.la @LTLIBINTL@
54
102
err-sources.h: Makefile mkstrtable.awk err-sources.h.in
55
103
$(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=3 \
73
121
# It is correct to use $(CPP). We want the host's idea of the error codes.
74
122
mkerrcodes.h: Makefile mkerrcodes.awk
75
$(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in \
76
| $(CPP) - | grep GPG_ERR_ | $(AWK) -f $(srcdir)/mkerrcodes.awk >$@
123
$(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in >_$@
124
$(CPP) _$@ | grep GPG_ERR_ | $(AWK) -f $(srcdir)/mkerrcodes.awk >$@
78
127
# It is correct to use $(CC_FOR_BUILD) here. We want to run the
79
128
# program at build time.
80
129
mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
81
$(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $<
130
$(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
83
132
code-from-errno.h: mkerrcodes Makefile
84
./$< | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
133
./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
86
135
errnos-sym.h: Makefile mkstrtable.awk errnos.in
87
136
$(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \