1# Makefile for libcharset/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@ 19INCLUDES = -I. -I$(srcdir) -I.. -I$(srcdir)/.. -I../include 20# -DBUILDING_LIBCHARSET: Change expansion of LIBCHARSET_DLL_EXPORTED macro. 21# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. 22DEFS = -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBCHARSET -DBUILDING_DLL \ 23-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ 24-Dset_relocation_prefix=libcharset_set_relocation_prefix \ 25-Drelocate=libcharset_relocate @DEFS@ 26LIBTOOL = @LIBTOOL@ 27LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile 28LIBTOOL_LINK = $(LIBTOOL) --mode=link 29LIBTOOL_INSTALL = $(LIBTOOL) --mode=install 30LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall 31RM = rm -f 32 33# Programs used by "make install": 34INSTALL = @INSTALL@ 35INSTALL_DATA = @INSTALL_DATA@ 36mkinstalldirs = $(SHELL) @top_srcdir@/build-aux/mkinstalldirs 37 38#### End of system configuration section. #### 39 40PACKAGE = @PACKAGE@ 41VERSION = @VERSION@ 42 43SHELL = /bin/sh 44 45# Before making a release, change this according to the libtool documentation, 46# section "Library interface versions". 47LIBCHARSET_VERSION_INFO = 1:0:0 48 49# Needed by $(LIBTOOL). 50top_builddir = .. 51 52SOURCES = $(srcdir)/localcharset.c $(srcdir)/relocatable.c 53 54OBJECTS = localcharset.lo relocatable.lo 55 56all : libcharset.la charset.alias ref-add.sed ref-del.sed 57 58libcharset.la : $(OBJECTS) 59 $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(CFLAGS) -o libcharset.la -rpath $(libdir) -version-info $(LIBCHARSET_VERSION_INFO) -no-undefined $(OBJECTS) 60 61localcharset.lo : $(srcdir)/localcharset.c 62 $(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $(srcdir)/localcharset.c 63 64relocatable.lo : $(srcdir)/relocatable.c $(srcdir)/relocatable.h 65 $(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $(srcdir)/relocatable.c 66 67charset.alias: $(srcdir)/config.charset 68 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ 69 mv t-$@ $@ 70 71ref-add.sed : $(srcdir)/ref-add.sin 72 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-$@ 73 mv t-$@ $@ 74 75ref-del.sed : $(srcdir)/ref-del.sin 76 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-$@ 77 mv t-$@ $@ 78 79# Installs the library and include files only. Typically called with only 80# $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here. 81install-lib : all force 82 $(mkinstalldirs) $(libdir) 83 $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcharset.la $(libdir)/libcharset.la 84 test -f $(libdir)/charset.alias && orig=$(libdir)/charset.alias \ 85 || orig=charset.alias; \ 86 sed -f ref-add.sed $$orig > $(libdir)/t-charset.alias; \ 87 $(INSTALL_DATA) $(libdir)/t-charset.alias $(libdir)/charset.alias; \ 88 rm -f $(libdir)/t-charset.alias 89 90# The following is needed in order to install a simple file in $(libdir) 91# which is shared with other installed packages. We use a list of referencing 92# packages so that "make uninstall" will remove the file if and only if it 93# is not used by another installed package. 94# On systems with glibc-2.1 or newer, the file is redundant, therefore we 95# avoid installing it. 96 97install : all force 98 if test @GLIBC21@ = no; then \ 99 case '@host_os@' in \ 100 darwin[56]*) \ 101 need_charset_alias=true ;; \ 102 darwin* | cygwin* | mingw* | pw32* | cegcc*) \ 103 need_charset_alias=false ;; \ 104 *) \ 105 need_charset_alias=true ;; \ 106 esac ; \ 107 else \ 108 need_charset_alias=false ; \ 109 fi ; \ 110 $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ 111 $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcharset.la $(DESTDIR)$(libdir)/libcharset.la 112 if test -f $(DESTDIR)$(libdir)/charset.alias; then \ 113 sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ 114 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ 115 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ 116 else \ 117 if $$need_charset_alias; then \ 118 sed -f ref-add.sed charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ 119 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ 120 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ 121 fi ; \ 122 fi 123 124install-strip : install 125 126installdirs : force 127 $(mkinstalldirs) $(DESTDIR)$(libdir) 128 129uninstall : force 130 $(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(libdir)/libcharset.la 131 if test -f $(DESTDIR)$(libdir)/charset.alias; then \ 132 sed -f ref-del.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ 133 if grep '^# Packages using this file: $$' $(DESTDIR)$(libdir)/t-charset.alias > /dev/null; then \ 134 rm -f $(DESTDIR)$(libdir)/charset.alias; \ 135 else \ 136 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ 137 fi; \ 138 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ 139 fi 140 141check : all 142 143mostlyclean : clean 144 145clean : force 146 $(RM) *.o *.lo *.a *.la *.o.lock core *.stackdump charset.alias ref-add.sed ref-del.sed 147 $(RM) -r .libs _libs 148 149distclean : clean 150 $(RM) config.status config.log config.cache Makefile libtool 151 152maintainer-clean : distclean 153 154force : 155 156