+# Makefile for the libiberty library.
+# Originally written by K. Richard Pixley <rich@cygnus.com>.
#
-# Makefile
-# Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-# Free Software Foundation
+# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
+# Foundation
#
# This file is part of the libiberty library.
# Libiberty is free software; you can redistribute it and/or
# License along with libiberty; see the file COPYING.LIB. If not,
# write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
# Boston, MA 02110-1301, USA.
-#
-
-# This file was written by K. Richard Pixley <rich@cygnus.com>.
-
-#
-# Makefile for libiberty directory
-#
libiberty_topdir = @libiberty_topdir@
srcdir = @srcdir@
CC = @CC@
CFLAGS = @CFLAGS@
-LIBCFLAGS = $(CFLAGS)
+CPPFLAGS = @CPPFLAGS@
RANLIB = @RANLIB@
MAKEINFO = @MAKEINFO@
PERL = @PERL@
-PICFLAG =
+PICFLAG = @PICFLAG@
MAKEOVERRIDES =
"AR_FLAGS=$(AR_FLAGS)" \
"CC=$(CC)" \
"CFLAGS=$(CFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
"DESTDIR=$(DESTDIR)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
"EXTRA_OFILES=$(EXTRA_OFILES)" \
"HDEFINES=$(HDEFINES)" \
"INSTALL=$(INSTALL)" \
SUBDIRS = testsuite
# FIXME: add @BUILD_INFO@ once we're sure it works for everyone.
-all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir
- @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
+all: stamp-picdir $(TARGETLIB) required-list all-subdir
+ @: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
.PHONY: check installcheck
check: check-subdir
INCDIR=$(srcdir)/$(MULTISRCTOP)../include
-COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@
+COMPILE.c = $(CC) -c @DEFS@ $(CFLAGS) $(CPPFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@
# Just to make sure we don't use a built-in rule with VPATH
.c.o:
CFILES = alloca.c argv.c asprintf.c atexit.c \
basename.c bcmp.c bcopy.c bsearch.c bzero.c \
calloc.c choose-temp.c clock.c concat.c cp-demangle.c \
- cp-demint.c cplus-dem.c \
+ cp-demint.c cplus-dem.c crc32.c \
dyn-string.c \
- fdmatch.c ffs.c fibheap.c floatformat.c fnmatch.c \
- fopen_unlocked.c \
+ fdmatch.c ffs.c fibheap.c filename_cmp.c floatformat.c \
+ fnmatch.c fopen_unlocked.c \
getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \
gettimeofday.c \
hashtab.c hex.c \
lbasename.c \
lrealpath.c \
make-relative-prefix.c \
- make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \
- mempcpy.c memset.c mkstemps.c \
+ make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmem.c \
+ memmove.c mempcpy.c memset.c mkstemps.c \
objalloc.c obstack.c \
partition.c pexecute.c \
pex-common.c pex-djgpp.c pex-msdos.c pex-one.c \
pex-unix.c pex-win32.c \
physmem.c putenv.c \
random.c regex.c rename.c rindex.c \
- safe-ctype.c setenv.c sigsetmask.c snprintf.c sort.c spaces.c \
- splay-tree.c stpcpy.c stpncpy.c strcasecmp.c strchr.c strdup.c \
- strerror.c strncasecmp.c strncmp.c strrchr.c strsignal.c \
- strstr.c strtod.c strtol.c strtoul.c strndup.c strverscmp.c \
- ternary.c tmpnam.c \
+ safe-ctype.c setenv.c sha1.c sigsetmask.c snprintf.c sort.c \
+ spaces.c splay-tree.c stpcpy.c stpncpy.c strcasecmp.c \
+ strchr.c strdup.c strerror.c strncasecmp.c strncmp.c \
+ strrchr.c strsignal.c strstr.c strtod.c strtol.c strtoul.c \
+ strndup.c strverscmp.c \
+ tmpnam.c \
unlink-if-ordinary.c \
vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \
waitpid.c \
# These are always included in the library. The first four are listed
# first and by compile time to optimize parallel builds.
-REQUIRED_OFILES = ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o \
+REQUIRED_OFILES = \
+ ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./sha1.o \
./alloca.o ./argv.o \
- ./choose-temp.o ./concat.o ./cp-demint.o \
+ ./choose-temp.o ./concat.o ./cp-demint.o ./crc32.o \
./dyn-string.o \
- ./fdmatch.o ./fibheap.o ./floatformat.o ./fnmatch.o \
- ./fopen_unlocked.o \
+ ./fdmatch.o ./fibheap.o ./filename_cmp.o ./floatformat.o \
+ ./fnmatch.o ./fopen_unlocked.o \
./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o \
./hashtab.o ./hex.o \
./lbasename.o ./lrealpath.o \
./pex-common.o ./pex-one.o @pexecute@ \
./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o \
./strsignal.o \
- ./ternary.o \
./unlink-if-ordinary.o \
./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o \
./xstrerror.o ./xstrndup.o
./ffs.o \
./getcwd.o ./getpagesize.o ./gettimeofday.o \
./index.o ./insque.o \
- ./memchr.o ./memcmp.o ./memcpy.o ./memmove.o ./mempcpy.o \
- ./memset.o ./mkstemps.o \
+ ./memchr.o ./memcmp.o ./memcpy.o ./memmem.o ./memmove.o \
+ ./mempcpy.o ./memset.o ./mkstemps.o \
./pex-djgpp.o ./pex-msdos.o \
./pex-unix.o ./pex-win32.o \
./putenv.o \
$(INCDIR)/partition.h \
$(INCDIR)/safe-ctype.h \
$(INCDIR)/sort.h \
- $(INCDIR)/splay-tree.h \
- $(INCDIR)/ternary.h
+ $(INCDIR)/splay-tree.h
$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
-rm -f $(TARGETLIB) pic/$(TARGETLIB)
install-info: install-info-subdir
clean-info: clean-info-subdir
dvi: libiberty.dvi dvi-subdir
-pdf: libiberty.pdf pdf-subdir
+
+LIBIBERTY_PDFFILES = libiberty.pdf
+
+pdf: $(LIBIBERTY_PDFFILES) pdf-subdir
+
+.PHONY: install-pdf
+
+pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-pdf: $(LIBIBERTY_PDFFILES)
+ @$(NORMAL_INSTALL)
+ test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)"
+ @list='$(LIBIBERTY_PDFFILES)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(pdf__strip_dir) \
+ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \
+ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \
+ done
# html, install-html targets
HTMLS = libiberty.html
html: $(HTMLS)
-.PHONY: install-html install-html-am install-html-recursive
+.PHONY: install-html install-html-am
NORMAL_INSTALL = :
mkdir_p = mkdir -p --
html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-install-html: install-html-recursive install-html-am
+install-html: install-html-am
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
fi; \
done
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
TEXISRC = \
$(srcdir)/libiberty.texi \
$(srcdir)/copying-lib.texi \
INSTALL_DEST = @INSTALL_DEST@
install: install_to_$(INSTALL_DEST) install-subdir
+# This is tricky. Even though CC in the Makefile contains
+# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
+# default multilib, so we have to take CFLAGS into account as well,
+# since it will be passed the multilib flags.
+MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
install_to_libdir: all
- ${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR)
- $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n
- ( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n )
- mv -f $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)
+ ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
+ $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
+ ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n )
+ mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)
if test -n "${target_header_dir}"; then \
case "${target_header_dir}" in \
/*) thd=${target_header_dir};; \
- *) thd=${includedir}${MULTISUBDIR}/${target_header_dir};; \
+ *) thd=${includedir}/${target_header_dir};; \
esac; \
${mkinstalldirs} $(DESTDIR)$${thd}; \
for h in ${INSTALLED_HEADERS}; do \
fi
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-# This is tricky. Even though CC in the Makefile contains
-# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
-# default multilib, so we have to take LIBCFLAGS into account as well,
-# since it will be passed the multilib flags.
-MULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory`
install_to_tooldir: all
${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n
mv -f $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/$(MULTIOSDIR)/$(TARGETLIB)
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-# needed-list is used by libstdc++. NEEDED is the list of functions
-# to include there. Do not add anything LGPL to this list; libstdc++
-# can't use anything encumbering.
-NEEDED = atexit calloc memchr memcmp memcpy memmove memset rename strchr \
- strerror strncmp strrchr strstr strtol strtoul tmpnam vfprintf vprintf \
- vfork waitpid bcmp bcopy bzero
-needed-list: Makefile
- rm -f needed-list; touch needed-list; \
- for f in $(NEEDED); do \
- for g in $(LIBOBJS) $(EXTRA_OFILES); do \
- case "$$g" in \
- *$$f*) echo $$g >> needed-list ;; \
- esac; \
- done; \
- done
-
# required-list was used when building a shared bfd/opcodes/libiberty
# library. I don't know if it used by anything currently.
required-list: Makefile
etags `for i in $(CFILES); do echo $(srcdir)/$$i ; done`
# The standalone demangler (c++filt) has been moved to binutils.
-demangle:
+# But make this target work anyway for demangler hacking.
+demangle: $(ALL) $(srcdir)/cp-demangle.c
@echo "The standalone demangler, now named c++filt, is now"
@echo "a part of binutils."
- @false
+ $(CC) @DEFS@ $(CFLAGS) $(CPPFLAGS) -I. -I$(INCDIR) $(HDEFINES) \
+ $(srcdir)/cp-demangle.c -DSTANDALONE_DEMANGLER $(TARGETLIB) -o $@
ls:
@echo Makefile $(CFILES)
# multiple times, hence our explicit recursion with an empty SUBDIRS.
mostlyclean: mostlyclean-subdir
-rm -rf *.o pic core errs \#* *.E a.out
- -rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-*
- -rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir
+ -rm -f errors dummy config.h stamp-*
+ -rm -f $(CONFIG_H) stamp-picdir
-rm -f libiberty.aux libiberty.cp libiberty.cps libiberty.fn libiberty.ky
-rm -f libiberty.log libiberty.tmp libiberty.tps libiberty.pg
-rm -f libiberty.pgs libiberty.toc libiberty.tp libiberty.tpl libiberty.vr
config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
+AUTOCONF = autoconf
+configure_deps = $(srcdir)/aclocal.m4 \
+ $(srcdir)/../config/acx.m4 \
+ $(srcdir)/../config/no-executables.m4 \
+ $(srcdir)/../config/override.m4 \
+ $(srcdir)/../config/warnings.m4 \
+
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+
# Depending on config.h makes sure that config.status has been re-run
# if needed. This prevents problems with parallel builds, in case
# subdirectories need to run config.status also.
else true; fi
$(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)
+./crc32.o: $(srcdir)/crc32.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/crc32.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/crc32.c $(OUTPUT_OPTION)
+
./dyn-string.o: $(srcdir)/dyn-string.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
else true; fi
$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
+./filename_cmp.o: $(srcdir)/filename_cmp.c config.h $(INCDIR)/filenames.h \
+ $(INCDIR)/safe-ctype.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/filename_cmp.c $(OUTPUT_OPTION)
+
./floatformat.o: $(srcdir)/floatformat.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/floatformat.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
./lbasename.o: $(srcdir)/lbasename.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h
+ $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/lbasename.c -o pic/$@; \
else true; fi
else true; fi
$(COMPILE.c) $(srcdir)/memcpy.c $(OUTPUT_OPTION)
+./memmem.o: $(srcdir)/memmem.c config.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/memmem.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/memmem.c $(OUTPUT_OPTION)
+
./memmove.o: $(srcdir)/memmove.c $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/memmove.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/setenv.c $(OUTPUT_OPTION)
+./sha1.o: $(srcdir)/sha1.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/sha1.h
+ if [ x"$(PICFLAG)" != x ]; then \
+ $(COMPILE.c) $(PICFLAG) $(srcdir)/sha1.c -o pic/$@; \
+ else true; fi
+ $(COMPILE.c) $(srcdir)/sha1.c $(OUTPUT_OPTION)
+
./sigsetmask.o: $(srcdir)/sigsetmask.c $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/sigsetmask.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/strverscmp.c $(OUTPUT_OPTION)
-./ternary.o: $(srcdir)/ternary.c config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ternary.h
- if [ x"$(PICFLAG)" != x ]; then \
- $(COMPILE.c) $(PICFLAG) $(srcdir)/ternary.c -o pic/$@; \
- else true; fi
- $(COMPILE.c) $(srcdir)/ternary.c $(OUTPUT_OPTION)
-
./tmpnam.o: $(srcdir)/tmpnam.c
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/tmpnam.c -o pic/$@; \