1# Makefile for libiconv/lib
2
3#### Start of system configuration section. ####
4
5# Directories used by "make":
6srcdir = @srcdir@
7
8# Directories used by "make install":
9prefix = @prefix@
10local_prefix = /usr/local
11exec_prefix = @exec_prefix@
12libdir = @libdir@
13
14# Programs used by "make":
15CC = @CC@
16CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@
17CPPFLAGS = @CPPFLAGS@
18LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@)
19LDFLAGS_yes = -Wl,--export-all-symbols
20LDFLAGS_no =
21INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include -I.. -I$(srcdir)/..
22# -DBUILDING_LIBICONV: Change expansion of LIBICONV_DLL_EXPORTED macro.
23# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
24DEFS = -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBICONV -DBUILDING_DLL \
25-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
26-Dset_relocation_prefix=libiconv_set_relocation_prefix \
27-Drelocate=libiconv_relocate @DEFS@
28LIBTOOL = @LIBTOOL@
29LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
30LIBTOOL_LINK = $(LIBTOOL) --mode=link
31LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
32LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
33# Windows resource compiler (windres). Used via libtool.
34RC = @RC@
35CP = cp
36MV = mv
37LN = @LN@
38LN_S = @LN_S@
39RM = rm -f
40
41# Programs used by "make install":
42INSTALL = @INSTALL@
43INSTALL_PROGRAM = @INSTALL_PROGRAM@
44INSTALL_DATA = @INSTALL_DATA@
45mkinstalldirs = $(SHELL) @top_srcdir@/build-aux/mkinstalldirs
46
47#### End of system configuration section. ####
48
49SHELL = /bin/sh
50
51# Before making a release, change this according to the libtool documentation,
52# section "Library interface versions".
53LIBICONV_VERSION_INFO = 7:1:5
54
55PACKAGE_VERSION = @VERSION@
56
57# Needed by $(LIBTOOL).
58top_builddir = ..
59
60SOURCES = $(srcdir)/iconv.c $(srcdir)/../libcharset/lib/localcharset.c $(srcdir)/relocatable.c
61
62OBJECTS = iconv.lo localcharset.lo relocatable.lo $(OBJECTS_EXP_@WOE32DLL@) $(OBJECTS_RES_@WOE32@)
63OBJECTS_EXP_yes = iconv-exports.lo
64OBJECTS_EXP_no =
65OBJECTS_RES_yes = libiconv.res.lo
66OBJECTS_RES_no =
67
68all : libiconv.la
69
70libiconv.la : $(OBJECTS)
71	$(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(CFLAGS) -o libiconv.la -rpath $(libdir) -version-info $(LIBICONV_VERSION_INFO) -no-undefined $(OBJECTS)
72
73iconv.lo : $(srcdir)/iconv.c $(srcdir)/converters.h \
74           $(srcdir)/encodings.def $(srcdir)/encodings_aix.def $(srcdir)/encodings_osf1.def $(srcdir)/encodings_dos.def $(srcdir)/encodings_local.def \
75           $(srcdir)/aliases.h $(srcdir)/aliases_sysaix.h $(srcdir)/aliases_syshpux.h $(srcdir)/aliases_sysosf1.h $(srcdir)/aliases_syssolaris.h \
76           $(srcdir)/aliases_aix.h $(srcdir)/aliases_aix_sysaix.h \
77           $(srcdir)/aliases_osf1.h $(srcdir)/aliases_osf1_sysosf1.h \
78           $(srcdir)/aliases_dos.h \
79           $(srcdir)/aliases_extra.h \
80           $(srcdir)/flags.h $(srcdir)/translit.h
81	$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $(srcdir)/iconv.c
82
83localcharset.lo : $(srcdir)/../libcharset/lib/localcharset.c $(srcdir)/relocatable.h
84	$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $(srcdir)/../libcharset/lib/localcharset.c
85
86relocatable.lo : $(srcdir)/relocatable.c $(srcdir)/relocatable.h
87	$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $(srcdir)/relocatable.c
88
89iconv-exports.lo : $(srcdir)/../woe32dll/iconv-exports.c
90	$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $(srcdir)/../woe32dll/iconv-exports.c
91
92libiconv.res.lo : $(srcdir)/../windows/libiconv.rc
93	$(LIBTOOL_COMPILE) --tag=RC $(RC) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/libiconv.rc -o libiconv.res.lo --output-format=coff
94
95# Installs the library and include files only. Typically called with only
96# $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here.
97install-lib : all force
98	if [ ! -d $(libdir) ] ; then $(mkinstalldirs) $(libdir) ; fi
99	$(LIBTOOL_INSTALL) $(INSTALL_DATA) libiconv.la $(libdir)/libiconv.la
100
101# On AIX, libiconv.a must include the object files of /lib/libiconv.a,
102# otherwise the setlocale() call fails when invoked from executables linked
103# with -rpath $(libdir), even if linked without -liconv.
104install : all force
105	if [ ! -d $(DESTDIR)$(libdir) ] ; then $(mkinstalldirs) $(DESTDIR)$(libdir) ; fi
106	$(LIBTOOL_INSTALL) $(INSTALL_DATA) libiconv.la $(DESTDIR)$(libdir)/libiconv.la
107	case "@host_os@" in \
108	  aix*) (cd $(DESTDIR)$(libdir) && \
109	         objects=`ar t libiconv.a`" "`ar t /lib/libiconv.a` && \
110	         ar x libiconv.a && ar x /lib/libiconv.a && \
111	         ar q libiconv.new.a $$objects && \
112	         rm -f $$objects && \
113	         mv -f libiconv.new.a libiconv.a) ;; \
114	esac
115
116install-strip : install
117
118installdirs : force
119	if [ ! -d $(DESTDIR)$(libdir) ] ; then $(mkinstalldirs) $(DESTDIR)$(libdir) ; fi
120
121uninstall : force
122	$(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(libdir)/libiconv.la
123
124check : all
125
126mostlyclean : clean
127
128clean : force
129	$(RM) *.o *.lo *.a *.la core *.stackdump so_locations
130	$(RM) -r .libs _libs
131
132distclean : clean
133	$(RM) Makefile config.h libtool
134
135maintainer-clean : distclean
136
137force :
138
139