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@
73
TARGETLIB = libiberty.a
78
# A configuration can specify extra .o files that should be included,
79
# even if they are in libc. (Perhaps the libc version is buggy.)
82
# Flags to pass to a recursive make.
85
"AR_FLAGS=$(AR_FLAGS)" \
88
"LIBCFLAGS=$(LIBCFLAGS)" \
89
"EXTRA_OFILES=$(EXTRA_OFILES)" \
90
"HDEFINES=$(HDEFINES)" \
91
"INSTALL=$(INSTALL)" \
92
"INSTALL_DATA=$(INSTALL_DATA)" \
93
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
94
"LDFLAGS=$(LDFLAGS)" \
95
"LOADLIBES=$(LOADLIBES)" \
99
"exec_prefix=$(exec_prefix)" \
101
"libsubdir=$(libsubdir)" \
104
# Subdirectories to recurse into. We need to override this during cleaning
107
# FIXME: add @BUILD_INFO@ once we're sure it works for everyone.
108
all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir
109
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
111
.PHONY: check installcheck
113
installcheck: installcheck-subdir
117
INCDIR=$(srcdir)/$(MULTISRCTOP)../include
119
COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@
121
if [ x"$(PICFLAG)" != x ]; then \
122
$(COMPILE.c) $(PICFLAG) $< -o pic/$@; \
124
$(COMPILE.c) $< $(OUTPUT_OPTION)
126
# NOTE: If you add new files to the library, add them to this list
127
# (alphabetical), and add them to REQUIRED_OFILES, or
128
# CONFIGURED_OFILES and funcs in configure.in.
129
CFILES = alloca.c argv.c asprintf.c atexit.c \
130
basename.c bcmp.c bcopy.c bsearch.c bzero.c \
131
calloc.c choose-temp.c clock.c concat.c cp-demangle.c \
134
fdmatch.c ffs.c fibheap.c floatformat.c fnmatch.c \
135
getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \
139
make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \
140
memset.c mkstemps.c \
141
objalloc.c obstack.c \
142
partition.c pexecute.c putenv.c \
143
random.c regex.c rename.c rindex.c \
144
safe-ctype.c setenv.c sigsetmask.c sort.c spaces.c \
145
splay-tree.c strcasecmp.c strchr.c strdup.c strerror.c \
146
strncasecmp.c strncmp.c strrchr.c strsignal.c strstr.c \
147
strtod.c strtol.c strtoul.c \
149
vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c \
151
xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c
153
# These are always included in the library. The first four are listed
154
# first and by compile time to optimize parallel builds.
155
REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o md5.o \
157
choose-temp.o concat.o \
159
fdmatch.o fibheap.o floatformat.o fnmatch.o \
160
getopt.o getopt1.o getpwd.o getruntime.o \
164
objalloc.o obstack.o \
165
partition.o pexecute.o \
166
safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \
169
xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o
171
# These are all the objects that configure may add to the library via
172
# $funcs or EXTRA_OFILES. This list exists here only for "make
173
# maint-missing" and "make check".
174
CONFIGURED_OFILES = asprintf.o atexit.o \
175
basename.o bcmp.o bcopy.o bsearch.o bzero.o \
176
calloc.o clock.o copysign.o \
179
getcwd.o getpagesize.o \
181
memchr.o memcmp.o memcpy.o memmove.o memset.o mkstemps.o \
183
random.o rename.o rindex.o \
184
setenv.o sigsetmask.o strcasecmp.o strchr.o strdup.o \
185
strncasecmp.o strncmp.o strrchr.o strstr.o strtod.o strtol.o \
188
vasprintf.o vfork.o vfprintf.o vprintf.o vsprintf.o \
191
# These files are installed if the library has been configured to do so.
192
INSTALLED_HEADERS = \
193
$(INCDIR)/ansidecl.h \
194
$(INCDIR)/demangle.h \
195
$(INCDIR)/dyn-string.h \
196
$(INCDIR)/fibheap.h \
197
$(INCDIR)/floatformat.h \
198
$(INCDIR)/hashtab.h \
199
$(INCDIR)/libiberty.h \
200
$(INCDIR)/objalloc.h \
201
$(INCDIR)/partition.h \
202
$(INCDIR)/safe-ctype.h \
204
$(INCDIR)/splay-tree.h \
207
$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
208
-rm -f $(TARGETLIB) pic/$(TARGETLIB)
209
$(AR) $(AR_FLAGS) $(TARGETLIB) \
210
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
211
$(RANLIB) $(TARGETLIB)
212
if [ x"$(PICFLAG)" != x ]; then \
214
$(AR) $(AR_FLAGS) $(TARGETLIB) \
215
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
216
$(RANLIB) $(TARGETLIB); \
220
$(TESTLIB): $(REQUIRED_OFILES) $(CONFIGURED_OFILES)
222
$(AR) $(AR_FLAGS) $(TESTLIB) \
223
$(REQUIRED_OFILES) $(CONFIGURED_OFILES)
226
info: libiberty.info info-subdir
227
install-info: install-info-subdir
228
clean-info: clean-info-subdir
229
dvi: libiberty.dvi dvi-subdir
233
$(srcdir)/libiberty.texi \
234
$(srcdir)/copying-lib.texi \
235
$(srcdir)/obstacks.texi \
236
$(srcdir)/functions.texi
238
# Additional files that have texi snippets that need to be collected
239
# and sorted. Some are here because the sources are imported from
240
# elsewhere. Others represent headers in ../include.
241
TEXIFILES = fnmatch.txh
243
libiberty.info : $(srcdir)/libiberty.texi $(TEXISRC)
244
$(MAKEINFO) -I$(srcdir) $(srcdir)/libiberty.texi
246
libiberty.dvi : $(srcdir)/libiberty.texi $(TEXISRC)
247
texi2dvi $(srcdir)/libiberty.texi
249
libiberty.html : $(srcdir)/libiberty.texi $(TEXISRC)
250
$(MAKEINFO) --html -I$(srcdir) $(srcdir)/libiberty.texi
252
@MAINT@$(srcdir)/functions.texi : stamp-functions
255
@MAINT@stamp-functions : $(CFILES) $(TEXIFILES) $(srcdir)/gather-docs Makefile
256
@MAINT@@HAVE_PERL@ $(PERL) $(srcdir)/gather-docs $(srcdir) $(srcdir)/functions.texi $(CFILES) $(TEXIFILES)
257
@MAINT@ echo stamp > stamp-functions
259
INSTALL_DEST = @INSTALL_DEST@
260
install: install_to_$(INSTALL_DEST) install-subdir
262
install_to_libdir: all
263
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n
264
( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n )
265
mv -f $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)
266
if test -n "${target_header_dir}"; then \
267
case "${target_header_dir}" in \
268
/*) thd=${target_header_dir};; \
269
*) thd=${includedir}${MULTISUBDIR}/${target_header_dir};; \
271
${mkinstalldirs} $(DESTDIR)$${thd}; \
272
for h in ${INSTALLED_HEADERS}; do \
273
${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
276
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
278
install_to_tooldir: all
279
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n
280
( cd $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n )
281
mv -f $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)
282
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
284
# needed-list is used by libstdc++. NEEDED is the list of functions
285
# to include there. Do not add anything LGPL to this list; libstdc++
286
# can't use anything encumbering.
287
NEEDED = atexit calloc memchr memcmp memcpy memmove memset rename strchr \
288
strerror strncmp strrchr strstr strtol strtoul tmpnam vfprintf vprintf \
289
vfork waitpid bcmp bcopy bzero
290
needed-list: Makefile
291
rm -f needed-list; touch needed-list; \
292
for f in $(NEEDED); do \
293
for g in $(LIBOBJS) $(EXTRA_OFILES); do \
295
*$$f*) echo $$g >> needed-list ;; \
300
# required-list was used when building a shared bfd/opcodes/libiberty
301
# library. I don't know if it used by anything currently.
302
required-list: Makefile
303
echo $(REQUIRED_OFILES) > required-list
306
if [ x"$(PICFLAG)" != x ] && [ ! -d pic ]; then \
311
.PHONY: all etags tags ls clean stage1 stage2
313
etags tags: TAGS etags-subdir
316
etags `for i in $(CFILES); do echo $(srcdir)/$$i ; done`
318
# The standalone demangler (c++filt) has been moved to binutils.
320
@echo "The standalone demangler, now named c++filt, is now"
321
@echo "a part of binutils."
325
@echo Makefile $(CFILES)
327
# Various targets for maintainers.
330
@$(PERL) $(srcdir)/maint-tool -s $(srcdir) missing $(CFILES) $(REQUIRED_OFILES) $(CONFIGURED_OFILES)
332
maint-buildall : $(REQUIRED_OFILES) $(CONFIGURED_OFILES)
335
maint-undoc : $(srcdir)/functions.texi
336
@$(PERL) $(srcdir)/maint-tool -s $(srcdir) undoc
339
@$(PERL) $(srcdir)/maint-tool -s $(srcdir) deps $(INCDIR)
341
# Need to deal with profiled libraries, too.
343
# Cleaning has to be done carefully to ensure that we don't clean our SUBDIRS
344
# multiple times, hence our explicit recursion with an empty SUBDIRS.
345
mostlyclean: mostlyclean-subdir
346
-rm -rf *.o pic core errs \#* *.E a.out
347
-rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-*
348
-rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir
349
-rm -f libiberty.aux libiberty.cp libiberty.cps libiberty.fn libiberty.ky
350
-rm -f libiberty.log libiberty.tmp libiberty.tps libiberty.pg
351
-rm -f libiberty.pgs libiberty.toc libiberty.tp libiberty.tpl libiberty.vr
353
@$(MULTICLEAN) multi-clean DO=mostlyclean
355
$(MAKE) SUBDIRS="" mostlyclean
356
-rm -f *.a required-list tmpmulti.out
357
-rm -f libiberty.dvi libiberty.info* libiberty.html
358
@$(MULTICLEAN) multi-clean DO=clean
359
distclean: distclean-subdir
360
$(MAKE) SUBDIRS="" clean
361
@$(MULTICLEAN) multi-clean DO=distclean
362
-rm -f *~ Makefile config.status xhost-mkfrag TAGS multilib.out
363
-rm -f config.log config.cache config.status
364
-rmdir testsuite 2>/dev/null
365
maintainer-clean realclean: maintainer-clean-subdir
366
$(MAKE) SUBDIRS="" distclean
370
Makefile: $(srcdir)/Makefile.in config.status
371
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
373
# Depending on Makefile makes sure that config.status has been re-run
374
# if needed. This prevents problems with parallel builds.
375
config.h: stamp-h ; @true
376
stamp-h: $(srcdir)/config.in config.status Makefile
377
CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
379
config.status: $(srcdir)/configure $(srcdir)/config.table
380
$(SHELL) ./config.status --recheck
382
# Depending on config.h makes sure that config.status has been re-run
383
# if needed. This prevents problems with parallel builds, in case
384
# subdirectories need to run config.status also.
385
all-subdir check-subdir installcheck-subdir info-subdir \
386
install-info-subdir clean-info-subdir dvi-subdir install-subdir \
387
etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
388
maintainer-clean-subdir: config.h
389
@subdirs='$(SUBDIRS)'; \
390
target=`echo $@ | sed -e 's/-subdir//'`; \
391
for dir in $$subdirs ; do \
392
cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $$target; \
395
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS): stamp-picdir
396
$(CONFIGURED_OFILES): stamp-picdir
398
# The dependencies in the remainder of this file are automatically
399
# generated by "make maint-deps". Manual edits will be lost.
401
_doprnt.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
402
alloca.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
403
argv.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
404
asprintf.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
406
basename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
407
$(INCDIR)/safe-ctype.h
408
bsearch.o: config.h $(INCDIR)/ansidecl.h
409
calloc.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
410
choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
412
concat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
413
copysign.o: $(INCDIR)/ansidecl.h
414
cp-demangle.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \
415
$(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h
416
cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \
417
$(INCDIR)/getopt.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
418
dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \
419
$(INCDIR)/libiberty.h
420
fdmatch.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
421
fibheap.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \
422
$(INCDIR)/libiberty.h
423
floatformat.o: $(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h
424
fnmatch.o: config.h $(INCDIR)/fnmatch.h $(INCDIR)/safe-ctype.h
426
getopt.o: config.h $(INCDIR)/getopt.h
427
getopt1.o: config.h $(INCDIR)/getopt.h
428
getpagesize.o: config.h
429
getpwd.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
430
getruntime.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
431
hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \
432
$(INCDIR)/libiberty.h
433
hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
434
lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
435
$(INCDIR)/safe-ctype.h
436
make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
437
md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
438
memchr.o: $(INCDIR)/ansidecl.h
439
memcmp.o: $(INCDIR)/ansidecl.h
440
memcpy.o: $(INCDIR)/ansidecl.h
441
memmove.o: $(INCDIR)/ansidecl.h
442
memset.o: $(INCDIR)/ansidecl.h
443
mkstemps.o: config.h $(INCDIR)/ansidecl.h
444
objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h
445
obstack.o: config.h $(INCDIR)/obstack.h
446
partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
447
$(INCDIR)/partition.h
448
pexecute.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
449
$(INCDIR)/safe-ctype.h
450
putenv.o: config.h $(INCDIR)/ansidecl.h
451
random.o: $(INCDIR)/ansidecl.h
452
regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h
454
safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
455
setenv.o: config.h $(INCDIR)/ansidecl.h
456
sigsetmask.o: $(INCDIR)/ansidecl.h
457
sort.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
459
spaces.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
460
splay-tree.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
461
$(INCDIR)/splay-tree.h
462
strcasecmp.o: $(INCDIR)/ansidecl.h
463
strchr.o: $(INCDIR)/ansidecl.h
464
strerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
465
strncasecmp.o: $(INCDIR)/ansidecl.h
466
strncmp.o: $(INCDIR)/ansidecl.h
467
strrchr.o: $(INCDIR)/ansidecl.h
468
strsignal.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
469
strtod.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
470
strtol.o: config.h $(INCDIR)/safe-ctype.h
471
strtoul.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
472
ternary.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
474
vasprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
475
vfork.o: $(INCDIR)/ansidecl.h
476
vprintf.o: $(INCDIR)/ansidecl.h
477
vsprintf.o: $(INCDIR)/ansidecl.h
479
xatexit.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
480
xexit.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
481
xmalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
482
xmemdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
483
xstrdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
484
xstrerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h