3 # Copyright (C) 1990, 91-99, 2000, 2001, 2002
4 # Free Software Foundation
6 # This file is part of the libiberty library.
7 # Libiberty is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Library General Public
9 # License as published by the Free Software Foundation; either
10 # version 2 of the License, or (at your option) any later version.
12 # Libiberty is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Library General Public License for more details.
17 # You should have received a copy of the GNU Library General Public
18 # License along with libiberty; see the file COPYING.LIB. If not,
19 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 # Boston, MA 02111-1307, USA.
23 # This file was written by K. Richard Pixley <rich@cygnus.com>.
26 # Makefile for libiberty directory
34 exec_prefix = @
exec_prefix@
37 includedir = @
includedir@
38 target_header_dir
= @target_header_dir@
42 # Multilib support variables.
51 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
52 INSTALL_DATA
= @INSTALL_DATA@
53 mkinstalldirs
= $(SHELL
) $(srcdir)/..
/mkinstalldirs
55 # Some compilers can't handle cc -c blah.c -o foo/blah.o.
56 OUTPUT_OPTION
= @OUTPUT_OPTION@
72 TARGETLIB
= libiberty.a
77 # A configuration can specify extra .o files that should be included,
78 # even if they are in libc. (Perhaps the libc version is buggy.)
81 # Flags to pass to a recursive make.
84 "AR_FLAGS=$(AR_FLAGS)" \
87 "LIBCFLAGS=$(LIBCFLAGS)" \
88 "EXTRA_OFILES=$(EXTRA_OFILES)" \
89 "HDEFINES=$(HDEFINES)" \
90 "INSTALL=$(INSTALL)" \
91 "INSTALL_DATA=$(INSTALL_DATA)" \
92 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
93 "LDFLAGS=$(LDFLAGS)" \
94 "LOADLIBES=$(LOADLIBES)" \
98 "exec_prefix=$(exec_prefix)" \
100 "libsubdir=$(libsubdir)" \
103 # Subdirectories to recurse into. We need to override this during cleaning
106 # FIXME: add @BUILD_INFO@ once we're sure it works for everyone.
107 all: stamp-picdir
$(TARGETLIB
) needed-list required-list all-subdir
108 @
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=all
110 .PHONY
: check installcheck
112 installcheck: installcheck-subdir
116 INCDIR
=$(srcdir)/$(MULTISRCTOP
)..
/include
118 COMPILE.c
= $(CC
) -c @DEFS@
$(LIBCFLAGS
) -I.
-I
$(INCDIR
) $(HDEFINES
) @ac_libiberty_warn_cflags@
120 if
[ x
"$(PICFLAG)" != x
]; then \
121 $(COMPILE.c
) $(PICFLAG
) $< -o pic
/$@
; \
123 $(COMPILE.c
) $< $(OUTPUT_OPTION
)
125 # NOTE: If you add new files to the library, add them to this list
126 # (alphabetical), and add them to REQUIRED_OFILES, or
127 # CONFIGURED_OFILES and funcs in configure.in.
128 CFILES
= alloca.c argv.c asprintf.c atexit.c \
129 basename.c bcmp.c bcopy.c bsearch.c bzero.c \
130 calloc.c choose-temp.c clock.c concat.c cp-demangle.c \
133 fdmatch.c ffs.c fibheap.c floatformat.c fnmatch.c \
134 getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \
138 make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \
139 memset.c mkstemps.c \
140 objalloc.c obstack.c \
141 partition.c pexecute.c putenv.c \
142 random.c regex.c rename.c rindex.c \
143 safe-ctype.c setenv.c sigsetmask.c
sort.c spaces.c \
144 splay-tree.c strcasecmp.c strchr.c strdup.c strerror.c \
145 strncasecmp.c strncmp.c strrchr.c strsignal.c strstr.c \
146 strtod.c strtol.c strtoul.c \
148 vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c \
150 xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c
152 # These are always included in the library. The first four are listed
153 # first and by compile time to optimize parallel builds.
154 REQUIRED_OFILES
= regex.o cplus-dem.o cp-demangle.o md5.o \
156 choose-temp.o concat.o \
158 fdmatch.o fibheap.o floatformat.o fnmatch.o \
159 getopt.o getopt1.o getpwd.o getruntime.o \
163 objalloc.o obstack.o \
164 partition.o pexecute.o \
165 safe-ctype.o
sort.o spaces.o splay-tree.o strerror.o \
168 xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o
170 # These are all the objects that configure may add to the library via
171 # $funcs or EXTRA_OFILES. This list exists here only for "make
172 # maint-missing" and "make check".
173 CONFIGURED_OFILES
= asprintf.o atexit.o \
174 basename.o bcmp.o bcopy.o bsearch.o bzero.o \
175 calloc.o clock.o copysign.o \
178 getcwd.o getpagesize.o \
180 memchr.o memcmp.o memcpy.o memmove.o memset.o mkstemps.o \
182 random.o rename.o rindex.o \
183 setenv.o sigsetmask.o strcasecmp.o strchr.o strdup.o \
184 strncasecmp.o strncmp.o strrchr.o strstr.o strtod.o strtol.o \
187 vasprintf.o vfork.o vfprintf.o vprintf.o vsprintf.o \
190 # These files are installed if the library has been configured to do so.
191 INSTALLED_HEADERS
= \
192 $(INCDIR
)/ansidecl.h \
193 $(INCDIR
)/demangle.h \
194 $(INCDIR
)/dyn-string.h \
195 $(INCDIR
)/fibheap.h \
196 $(INCDIR
)/floatformat.h \
197 $(INCDIR
)/hashtab.h \
198 $(INCDIR
)/libiberty.h \
199 $(INCDIR
)/objalloc.h \
200 $(INCDIR
)/partition.h \
201 $(INCDIR
)/safe-ctype.h \
203 $(INCDIR
)/splay-tree.h \
206 $(TARGETLIB
): $(REQUIRED_OFILES
) $(EXTRA_OFILES
) $(LIBOBJS
)
207 -rm -f
$(TARGETLIB
) pic
/$(TARGETLIB
)
208 $(AR
) $(AR_FLAGS
) $(TARGETLIB
) \
209 $(REQUIRED_OFILES
) $(EXTRA_OFILES
) $(LIBOBJS
)
210 $(RANLIB
) $(TARGETLIB
)
211 if
[ x
"$(PICFLAG)" != x
]; then \
213 $(AR
) $(AR_FLAGS
) $(TARGETLIB
) \
214 $(REQUIRED_OFILES
) $(EXTRA_OFILES
) $(LIBOBJS
); \
215 $(RANLIB
) $(TARGETLIB
); \
219 $(TESTLIB
): $(REQUIRED_OFILES
) $(CONFIGURED_OFILES
)
221 $(AR
) $(AR_FLAGS
) $(TESTLIB
) \
222 $(REQUIRED_OFILES
) $(CONFIGURED_OFILES
)
225 info: libiberty.
info info-subdir
226 install-info
: install-info-subdir
227 clean-info
: clean-info-subdir
228 dvi: libiberty.
dvi dvi-subdir
232 $(srcdir)/libiberty.texi \
233 $(srcdir)/copying-lib.texi \
234 $(srcdir)/obstacks.texi \
235 $(srcdir)/functions.texi
237 # Additional files that have texi snippets that need to be collected
238 # and sorted. Some are here because the sources are imported from
239 # elsewhere. Others represent headers in ../include.
240 TEXIFILES
= fnmatch.txh
242 libiberty.
info : $(srcdir)/libiberty.texi
$(TEXISRC
)
243 $(MAKEINFO
) -I
$(srcdir) $(srcdir)/libiberty.texi
245 libiberty.
dvi : $(srcdir)/libiberty.texi
$(TEXISRC
)
246 texi2dvi $(srcdir)/libiberty.texi
248 libiberty.html
: $(srcdir)/libiberty.texi
$(TEXISRC
)
249 $(MAKEINFO
) --html
-I
$(srcdir) $(srcdir)/libiberty.texi
251 @MAINT@
$(srcdir)/functions.texi
: stamp-functions
254 @MAINT@stamp-functions
: $(CFILES
) $(TEXIFILES
) $(srcdir)/gather-docs Makefile
255 @MAINT@@HAVE_PERL@
$(PERL
) $(srcdir)/gather-docs
$(srcdir) $(srcdir)/functions.texi
$(CFILES
) $(TEXIFILES
)
256 @MAINT@ echo stamp
> stamp-functions
258 INSTALL_DEST
= @INSTALL_DEST@
259 install: install_to_
$(INSTALL_DEST
) install-subdir
261 install_to_libdir
: all
262 $(INSTALL_DATA
) $(TARGETLIB
) $(DESTDIR
)$(libdir)$(MULTISUBDIR
)/$(TARGETLIB
)n
263 ( cd
$(DESTDIR
)$(libdir)$(MULTISUBDIR
) ; $(RANLIB
) $(TARGETLIB
)n
)
264 mv
-f
$(DESTDIR
)$(libdir)$(MULTISUBDIR
)/$(TARGETLIB
)n
$(DESTDIR
)$(libdir)$(MULTISUBDIR
)/$(TARGETLIB
)
265 if
test -n
"${target_header_dir}"; then \
266 case
"${target_header_dir}" in \
267 /*) thd
=${target_header_dir};; \
268 *) thd
=${includedir}${MULTISUBDIR}/${target_header_dir};; \
270 ${mkinstalldirs} $(DESTDIR
)$${thd}; \
271 for h in
${INSTALLED_HEADERS}; do \
272 ${INSTALL_DATA} $$h $(DESTDIR
)$${thd}; \
275 @
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=install
277 install_to_tooldir
: all
278 $(INSTALL_DATA
) $(TARGETLIB
) $(DESTDIR
)$(tooldir
)/lib
$(MULTISUBDIR
)/$(TARGETLIB
)n
279 ( cd
$(DESTDIR
)$(tooldir
)/lib
$(MULTISUBDIR
) ; $(RANLIB
) $(TARGETLIB
)n
)
280 mv
-f
$(DESTDIR
)$(tooldir
)/lib
$(MULTISUBDIR
)/$(TARGETLIB
)n
$(DESTDIR
)$(tooldir
)/lib
$(MULTISUBDIR
)/$(TARGETLIB
)
281 @
$(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=install
283 # needed-list is used by libstdc++. NEEDED is the list of functions
284 # to include there. Do not add anything LGPL to this list; libstdc++
285 # can't use anything encumbering.
286 NEEDED
= atexit calloc memchr memcmp memcpy memmove memset rename strchr \
287 strerror strncmp strrchr strstr strtol strtoul tmpnam vfprintf vprintf \
288 vfork waitpid bcmp bcopy bzero
289 needed-list
: Makefile
290 rm -f needed-list
; touch needed-list
; \
291 for f in
$(NEEDED
); do \
292 for g in
$(LIBOBJS
) $(EXTRA_OFILES
); do \
294 *$$f*) echo
$$g >> needed-list
;; \
299 # required-list was used when building a shared bfd/opcodes/libiberty
300 # library. I don't know if it used by anything currently.
301 required-list
: Makefile
302 echo
$(REQUIRED_OFILES
) > required-list
305 if
[ x
"$(PICFLAG)" != x
] && [ ! -d pic
]; then \
310 .PHONY
: all etags
tags ls
clean stage1 stage2
312 etags
tags: TAGS etags-subdir
315 etags
`for i in $(CFILES); do echo $(srcdir)/$$i ; done`
317 # The standalone demangler (c++filt) has been moved to binutils.
319 @echo
"The standalone demangler, now named c++filt, is now"
320 @echo
"a part of binutils."
324 @echo Makefile
$(CFILES
)
326 # Various targets for maintainers.
329 @
$(PERL
) $(srcdir)/maint-tool
-s
$(srcdir) missing
$(CFILES
) $(REQUIRED_OFILES
) $(CONFIGURED_OFILES
)
331 maint-buildall
: $(REQUIRED_OFILES
) $(CONFIGURED_OFILES
)
334 maint-undoc
: $(srcdir)/functions.texi
335 @
$(PERL
) $(srcdir)/maint-tool
-s
$(srcdir) undoc
338 @
$(PERL
) $(srcdir)/maint-tool
-s
$(srcdir) deps
$(INCDIR
)
340 # Need to deal with profiled libraries, too.
342 # Cleaning has to be done carefully to ensure that we don't clean our SUBDIRS
343 # multiple times, hence our explicit recursion with an empty SUBDIRS.
344 mostlyclean: mostlyclean-subdir
345 -rm -rf
*.o pic core errs \
#* *.E a.out
346 -rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-
*
347 -rm -f
$(CONFIG_H
) $(NEEDED_LIST
) stamp-picdir
348 -rm -f libiberty.aux libiberty.cp libiberty.cps libiberty.fn libiberty.ky
349 -rm -f libiberty.log libiberty.tmp libiberty.tps libiberty.pg
350 -rm -f libiberty.pgs libiberty.toc libiberty.tp libiberty.tpl libiberty.vr
352 @
$(MULTICLEAN
) multi-clean DO
=mostlyclean
354 $(MAKE
) SUBDIRS
="" mostlyclean
355 -rm -f
*.a required-list tmpmulti.out
356 -rm -f libiberty.
dvi libiberty.
info* libiberty.html
357 @
$(MULTICLEAN
) multi-clean DO
=clean
358 distclean: distclean-subdir
359 $(MAKE
) SUBDIRS
="" clean
360 @
$(MULTICLEAN
) multi-clean DO
=distclean
361 -rm -f
*~ Makefile config.status xhost-mkfrag TAGS multilib.out
363 -rmdir testsuite
2>/dev
/null
364 maintainer-clean
realclean: maintainer-clean-subdir
365 $(MAKE
) SUBDIRS
="" distclean
369 Makefile
: $(srcdir)/Makefile.in config.status
370 CONFIG_FILES
=Makefile CONFIG_HEADERS
= $(SHELL
) .
/config.status
372 # Depending on Makefile makes sure that config.status has been re-run
373 # if needed. This prevents problems with parallel builds.
374 config.h
: stamp-h
; @true
375 stamp-h
: config.in config.status Makefile
376 CONFIG_FILES
= CONFIG_HEADERS
=config.h
:config.in
$(SHELL
) .
/config.status
378 config.status
: $(srcdir)/configure
$(srcdir)/config.table
379 $(SHELL
) .
/config.status
--recheck
381 # Depending on config.h makes sure that config.status has been re-run
382 # if needed. This prevents problems with parallel builds, in case
383 # subdirectories need to run config.status also.
384 all-subdir check-subdir installcheck-subdir info-subdir \
385 install-info-subdir clean-info-subdir dvi-subdir install-subdir \
386 etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
387 maintainer-clean-subdir
: config.h
388 @subdirs
='$(SUBDIRS)'; \
389 target
=`echo $@ | sed -e 's/-subdir//'`; \
390 for
dir in
$$subdirs ; do \
391 cd
$$dir && $(MAKE
) $$target; \
394 $(REQUIRED_OFILES
) $(EXTRA_OFILES
) $(LIBOBJS
): stamp-picdir
395 $(CONFIGURED_OFILES
): stamp-picdir
397 # The dependencies in the remainder of this file are automatically
398 # generated by "make maint-deps". Manual edits will be lost.
400 _doprnt.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/safe-ctype.h
401 alloca.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
402 argv.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
403 asprintf.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
405 basename.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h \
406 $(INCDIR
)/safe-ctype.h
407 bsearch.o
: config.h
$(INCDIR
)/ansidecl.h
408 calloc.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
409 choose-temp.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
411 concat.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
412 copysign.o
: $(INCDIR
)/ansidecl.h
413 cp-demangle.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/demangle.h \
414 $(INCDIR
)/dyn-string.h
$(INCDIR
)/getopt.h
$(INCDIR
)/libiberty.h
415 cplus-dem.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/demangle.h \
416 $(INCDIR
)/getopt.h
$(INCDIR
)/libiberty.h
$(INCDIR
)/safe-ctype.h
417 dyn-string.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/dyn-string.h \
418 $(INCDIR
)/libiberty.h
419 fdmatch.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
420 fibheap.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/fibheap.h \
421 $(INCDIR
)/libiberty.h
422 floatformat.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/floatformat.h
423 fnmatch.o
: config.h
$(INCDIR
)/fnmatch.h
$(INCDIR
)/safe-ctype.h
425 getopt.o
: config.h
$(INCDIR
)/getopt.h
426 getopt1.o
: config.h
$(INCDIR
)/getopt.h
427 getpagesize.o
: config.h
428 getpwd.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
429 getruntime.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
430 hashtab.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/hashtab.h \
431 $(INCDIR
)/libiberty.h
432 hex.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
433 lbasename.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h \
434 $(INCDIR
)/safe-ctype.h
435 make-temp-file.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
436 md5.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/md5.h
437 memchr.o
: $(INCDIR
)/ansidecl.h
438 memcmp.o
: $(INCDIR
)/ansidecl.h
439 memcpy.o
: $(INCDIR
)/ansidecl.h
440 memmove.o
: $(INCDIR
)/ansidecl.h
441 memset.o
: $(INCDIR
)/ansidecl.h
442 mkstemps.o
: config.h
$(INCDIR
)/ansidecl.h
443 objalloc.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/objalloc.h
444 obstack.o
: config.h
$(INCDIR
)/obstack.h
445 partition.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h \
446 $(INCDIR
)/partition.h
447 pexecute.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h \
448 $(INCDIR
)/safe-ctype.h
449 putenv.o
: config.h
$(INCDIR
)/ansidecl.h
450 random.o
: $(INCDIR
)/ansidecl.h
451 regex.o
: config.h
$(INCDIR
)/xregex.h
$(INCDIR
)/xregex2.h
453 safe-ctype.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/safe-ctype.h
454 setenv.o
: config.h
$(INCDIR
)/ansidecl.h
455 sigsetmask.o
: $(INCDIR
)/ansidecl.h
456 sort.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h \
458 spaces.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
459 splay-tree.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h \
460 $(INCDIR
)/splay-tree.h
461 strcasecmp.o
: $(INCDIR
)/ansidecl.h
462 strchr.o
: $(INCDIR
)/ansidecl.h
463 strerror.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
464 strncasecmp.o
: $(INCDIR
)/ansidecl.h
465 strncmp.o
: $(INCDIR
)/ansidecl.h
466 strrchr.o
: $(INCDIR
)/ansidecl.h
467 strsignal.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
468 strtod.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/safe-ctype.h
469 strtol.o
: config.h
$(INCDIR
)/safe-ctype.h
470 strtoul.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/safe-ctype.h
471 ternary.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h \
473 vasprintf.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
474 vfork.o
: $(INCDIR
)/ansidecl.h
475 vprintf.o
: $(INCDIR
)/ansidecl.h
476 vsprintf.o
: $(INCDIR
)/ansidecl.h
478 xatexit.o
: $(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
479 xexit.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
480 xmalloc.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
481 xmemdup.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
482 xstrdup.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h
483 xstrerror.o
: config.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/libiberty.h