1 # Makefile for libiconv/src
3 #### Start of system configuration section. ####
5 # Directories used by "make":
8 # Directories used by "make install":
10 local_prefix = /usr/local
11 exec_prefix = @exec_prefix@
15 localedir = $(datadir)/locale
17 # Programs used by "make":
22 INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include
24 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
25 LIBTOOL_LINK = $(LIBTOOL) --mode=link
26 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
27 LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
31 # Programs used by "make install":
33 INSTALL_PROGRAM = @INSTALL_PROGRAM@
34 INSTALL_DATA = @INSTALL_DATA@
36 #### End of system configuration section. ####
40 # Needed by $(LIBTOOL).
43 # We cannot link with libintl until libiconv is installed. (When we call
44 # libtool with arguments "../lib/libiconv.la -lintl", libtool will call ld
45 # with "../lib/.libs/libiconv.so $libdir/libintl.so $libdir/libiconv.so",
46 # (remember that $libdir/libintl.la lists $libdir/libiconv.so as a dependency),
47 # and this gives a fatal linker error on Solaris because the two libiconv.so
48 # files are different but have the same soname.
49 # So we can link the iconv executable only after we have installed libiconv,
50 # i.e. during "make install". The intermediate 'iconv' executable is built
51 # without internationalization and not linked with libintl.
53 all : iconv_no_i18n iconv.@OBJEXT@
56 # This is the temporary iconv executable, without internationalization.
57 iconv_no_i18n : iconv_no_i18n.@OBJEXT@ ../lib/libiconv.la
58 $(LIBTOOL_LINK) $(CC) $(LDFLAGS) iconv_no_i18n.@OBJEXT@ ../lib/libiconv.la -o $@
60 iconv_no_i18n.@OBJEXT@ : $(srcdir)/iconv_no_i18n.c $(srcdir)/iconv.c
61 $(CC) -c $(INCLUDES) -I../lib $(CFLAGS) $(CPPFLAGS) -DLOCALEDIR=\"$(localedir)\" $(srcdir)/iconv_no_i18n.c
63 iconv.@OBJEXT@ : $(srcdir)/iconv.c
64 $(CC) -c $(INCLUDES) -I../lib $(CFLAGS) $(CPPFLAGS) -DLOCALEDIR=\"$(localedir)\" $(srcdir)/iconv.c
66 # The following rule is necessary to avoid a toplevel "make -n check" failure.
68 cd ../lib && $(MAKE) libiconv.la
70 # During "make install", we can build the final iconv executable.
71 # On HP-UX, in order to ensure that the new libiconv.sl will override the old
72 # one that is hardcoded in libintl.sl, we need to mention libiconv.sl before
73 # libintl.sl on the link command line. We have to bypass libtool in order to
76 if [ ! -d $(DESTDIR)$(prefix) ] ; then mkdir $(DESTDIR)$(prefix) ; fi
77 if [ ! -d $(DESTDIR)$(exec_prefix) ] ; then mkdir $(DESTDIR)$(exec_prefix) ; fi
78 if [ ! -d $(DESTDIR)$(bindir) ] ; then mkdir $(DESTDIR)$(bindir) ; fi
80 hpux*) $(CC) $(LDFLAGS) iconv.@OBJEXT@ -L$(libdir) -liconv @LIBINTL@ -o iconv;; \
81 *) $(LIBTOOL_LINK) $(CC) $(LDFLAGS) iconv.@OBJEXT@ $(libdir)/libiconv.la @LTLIBINTL@ -o iconv;; \
83 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) iconv $(DESTDIR)$(bindir)/iconv
86 if [ ! -d $(DESTDIR)$(prefix) ] ; then mkdir $(DESTDIR)$(prefix) ; fi
87 if [ ! -d $(DESTDIR)$(exec_prefix) ] ; then mkdir $(DESTDIR)$(exec_prefix) ; fi
88 if [ ! -d $(DESTDIR)$(bindir) ] ; then mkdir $(DESTDIR)$(bindir) ; fi
91 $(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(bindir)/iconv
98 $(RM) *.@OBJEXT@ *.lo iconv_no_i18n iconv core
102 $(RM) Makefile config.h
104 maintainer-clean : distclean