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) -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 $(mkinstalldirs) $(DESTDIR)$(libdir) 99 $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcharset.la $(DESTDIR)$(libdir)/libcharset.la 100 if test -f $(DESTDIR)$(libdir)/charset.alias; then \ 101 sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ 102 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ 103 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ 104 else \ 105 if test @GLIBC21@ = no; then \ 106 sed -f ref-add.sed charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ 107 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ 108 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ 109 fi ; \ 110 fi 111 112installdirs : force 113 $(mkinstalldirs) $(DESTDIR)$(libdir) 114 115uninstall : force 116 $(LIBTOOL_UNINSTALL) $(RM) $(DESTDIR)$(libdir)/libcharset.la 117 if test -f $(DESTDIR)$(libdir)/charset.alias; then \ 118 sed -f ref-del.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ 119 if grep '^# Packages using this file: $$' $(DESTDIR)$(libdir)/t-charset.alias > /dev/null; then \ 120 rm -f $(DESTDIR)$(libdir)/charset.alias; \ 121 else \ 122 $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ 123 fi; \ 124 rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ 125 fi 126 127check : all 128 129mostlyclean : clean 130 131clean : force 132 $(RM) *.o *.lo *.a *.la *.o.lock core *.stackdump charset.alias ref-add.sed ref-del.sed 133 $(RM) -r .libs _libs 134 135distclean : clean 136 $(RM) config.status config.log config.cache Makefile libtool 137 138maintainer-clean : distclean 139 140force : 141 142