]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - libiberty/Makefile.in
import libiberty from egcs
[thirdparty/binutils-gdb.git] / libiberty / Makefile.in
CommitLineData
252b5132
RH
1#
2# Makefile
e2eaf477 3# Copyright (C) 1990, 91 - 99, 2000
252b5132
RH
4# Free Software Foundation
5#
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.
11#
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.
16#
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.
21#
22
23# This file was written by K. Richard Pixley <rich@cygnus.com>.
24
25#
26# Makefile for libiberty directory
27#
28
29srcdir = @srcdir@
30VPATH = @srcdir@
31
32prefix = @prefix@
33
34exec_prefix = @exec_prefix@
35bindir = @bindir@
36libdir = @libdir@
37
38SHELL = @SHELL@
39
40# Multilib support variables.
41MULTISRCTOP =
42MULTIBUILDTOP =
43MULTIDIRS =
44MULTISUBDIR =
45MULTIDO = true
46MULTICLEAN = true
47
48INSTALL = @INSTALL@
49INSTALL_PROGRAM = @INSTALL_PROGRAM@
50INSTALL_DATA = @INSTALL_DATA@
51
52AR = @AR@
53AR_FLAGS = rc
54
55CC = @CC@
56CFLAGS = @CFLAGS@
57LIBCFLAGS = $(CFLAGS)
58RANLIB = @RANLIB@
59
60PICFLAG =
61
62MAKEOVERRIDES =
63
64TARGETLIB = libiberty.a
65
66LIBOBJS = @LIBOBJS@
67ALLOCA = @ALLOCA@
68
69# A configuration can specify extra .o files that should be included,
70# even if they are in libc. (Perhaps the libc version is buggy.)
71EXTRA_OFILES =
72
73# Flags to pass to a recursive make.
74FLAGS_TO_PASS = \
75 "AR=$(AR)" \
76 "AR_FLAGS=$(AR_FLAGS)" \
77 "CC=$(CC)" \
78 "CFLAGS=$(CFLAGS)" \
79 "LIBCFLAGS=$(LIBCFLAGS)" \
80 "EXTRA_OFILES=$(EXTRA_OFILES)" \
81 "HDEFINES=$(HDEFINES)" \
82 "INSTALL=$(INSTALL)" \
83 "INSTALL_DATA=$(INSTALL_DATA)" \
84 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
85 "LDFLAGS=$(LDFLAGS)" \
86 "LOADLIBES=$(LOADLIBES)" \
87 "RANLIB=$(RANLIB)" \
e2eaf477
ILT
88 "SHELL=$(SHELL)" \
89 "prefix=$(prefix)" \
90 "exec_prefix=$(exec_prefix)" \
91 "libdir=$(libdir)" \
92 "libsubdir=$(libsubdir)" \
93 "tooldir=$(tooldir)"
252b5132 94
e2eaf477
ILT
95# Subdirectories to recurse into. We need to override this during cleaning
96SUBDIRS = testsuite
97
98all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir
252b5132
RH
99 @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
100
101.PHONY: check installcheck
e2eaf477
ILT
102check: check-subdir
103installcheck: installcheck-subdir
252b5132
RH
104
105@host_makefile_frag@
106
107INCDIR=$(srcdir)/$(MULTISRCTOP)../include
108
e2eaf477 109COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@
252b5132
RH
110.c.o:
111 test x"$(enable_shared)" != xyes || \
112 $(COMPILE.c) $(PICFLAG) $< -o pic/$@
113 $(COMPILE.c) $<
114
e2eaf477
ILT
115info: info-subdir
116install-info: install-info-subdir
117clean-info: clean-info-subdir
118dvi: dvi-subdir
252b5132
RH
119
120# Include files that are in this directory.
121HFILES = alloca-conf.h
122
123# NOTE: If you add new files to the library, add them to this list
124# (alphabetical), and add them to REQUIRED_OFILES or funcs in
125# configure.in.
126CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
e2eaf477
ILT
127 bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c \
128 fnmatch.c getcwd.c getpwd.c getopt.c getopt1.c getpagesize.c \
129 getruntime.c floatformat.c hashtab.c hex.c index.c insque.c memchr.c \
252b5132 130 memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \
e2eaf477
ILT
131 pexecute.c putenv.c random.c rename.c rindex.c setenv.c sigsetmask.c \
132 spaces.c splay-tree.c strcasecmp.c strncasecmp.c strchr.c strdup.c \
133 strerror.c strrchr.c strsignal.c strstr.c strtod.c strtol.c strtoul.c \
252b5132 134 tmpnam.c vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c \
e2eaf477 135 waitpid.c xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c
252b5132
RH
136
137# These are always included in the library.
138REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o \
e2eaf477
ILT
139 fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o \
140 hex.o floatformat.o objalloc.o obstack.o pexecute.o spaces.o \
252b5132 141 splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \
e2eaf477 142 xmemdup.o xstrdup.o xstrerror.o
252b5132
RH
143
144$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
145 rm -f $(TARGETLIB)
146 $(AR) $(AR_FLAGS) $(TARGETLIB) \
147 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
148 $(RANLIB) $(TARGETLIB)
149
150INSTALL_DEST = @INSTALL_DEST@
e2eaf477 151install: install_to_$(INSTALL_DEST) install-subdir
252b5132
RH
152
153install_to_libdir: all
154 $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n
155 ( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB).n )
156 mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n $(libdir)$(MULTISUBDIR)/$(TARGETLIB)
157 @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
158
159install_to_tooldir: all
160 $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n
161 ( cd $(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB).n )
162 mv -f $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)
163 @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
164
e2eaf477
ILT
165# needed-list is used by libstdc++. NEEDED is the list of functions
166# to include there. Do not add anything LGPL to this list; libstdc++
167# can't use anything encumbering.
168NEEDED = atexit calloc memchr memcmp memcpy memmove memset rename strchr \
169 strerror strrchr strstr strtol strtoul tmpnam vfprintf vprintf \
170 vfork waitpid bcmp bcopy bzero
252b5132 171needed-list: Makefile
e2eaf477
ILT
172 rm -f needed-list; touch needed-list; \
173 for f in $(NEEDED); do \
174 for g in $(LIBOBJS) $(EXTRA_OFILES); do \
175 case "$$g" in \
176 *$$f*) echo $$g >> needed-list ;; \
177 esac; \
178 done; \
179 done
252b5132
RH
180
181# required-list was used when building a shared bfd/opcodes/libiberty
182# library. I don't know if it used by anything currently.
183required-list: Makefile
184 echo $(REQUIRED_OFILES) > required-list
185
186stamp-picdir:
187 if [ x"$(enable_shared)" = xyes ] && [ ! -d pic ]; then \
188 mkdir pic; \
189 else true; fi
190 touch stamp-picdir
191
192.PHONY: all etags tags ls clean stage1 stage2
193
e2eaf477 194etags tags: TAGS etags-subdir
252b5132
RH
195
196TAGS: $(CFILES) $(HFILES)
197 etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done`
198
199# The standalone demangler (c++filt) has been moved to binutils.
200demangle:
201 @echo "The standalone demangler, now named c++filt, is now"
202 @echo "a part of binutils."
203 @false
204
205ls:
206 @echo Makefile $(HFILES) $(CFILES)
207
208# Need to deal with profiled libraries, too.
209
e2eaf477
ILT
210# Cleaning has to be done carefully to ensure that we don't clean our SUBDIRS
211# multiple times, hence our explicit recursion with an empty SUBDIRS.
212mostlyclean: mostlyclean-subdir
252b5132
RH
213 rm -rf *.o pic core errs \#* *.E a.out
214 rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-*
215 rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir
216 @$(MULTICLEAN) multi-clean DO=mostlyclean
e2eaf477
ILT
217clean: clean-subdir
218 $(MAKE) SUBDIRS="" mostlyclean
252b5132
RH
219 rm -f *.a required-list tmpmulti.out
220 @$(MULTICLEAN) multi-clean DO=clean
e2eaf477
ILT
221distclean: distclean-subdir
222 $(MAKE) SUBDIRS="" clean
252b5132
RH
223 @$(MULTICLEAN) multi-clean DO=distclean
224 rm -f *~ Makefile config.status xhost-mkfrag TAGS multilib.out
225 rm -f config.log
e2eaf477
ILT
226maintainer-clean realclean: maintainer-clean-subdir
227 $(MAKE) SUBDIRS="" distclean
252b5132
RH
228
229force:
230
231Makefile: $(srcdir)/Makefile.in config.status
232 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
233
234config.h: stamp-h ; @true
235stamp-h: config.in config.status
236 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
237
238config.status: $(srcdir)/configure $(srcdir)/config.table
239 $(SHELL) ./config.status --recheck
240
e2eaf477
ILT
241
242all-subdir check-subdir installcheck-subdir info-subdir \
243install-info-subdir clean-info-subdir dvi-subdir install-subdir \
244etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
245maintainer-clean-subdir:
246 @target=`echo $@ | sed -e 's/-subdir//'`; \
247 for dir in . $(SUBDIRS) ; do \
248 test $$dir = . || (cd $$dir && $(MAKE) $$target) || exit 1; \
249 done
250
252b5132
RH
251$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir
252
253alloca.o: config.h
254atexit.o: config.h
255argv.o: config.h alloca-conf.h $(INCDIR)/libiberty.h
256basename.o: $(INCDIR)/libiberty.h
257choose-temp.o: config.h
258clock.o: config.h
259concat.o: $(INCDIR)/libiberty.h
260cplus-dem.o: config.h $(INCDIR)/demangle.h
261fdmatch.o: $(INCDIR)/libiberty.h
262fnmatch.o: config.h $(INCDIR)/fnmatch.h
263getcwd.o: config.h
264getopt.o: config.h $(INCDIR)/getopt.h
265getopt1.o: config.h $(INCDIR)/getopt.h
266getpagesize.o: config.h
e2eaf477 267getpwd.o: config.h $(INCDIR)/libiberty.h
252b5132
RH
268getruntime.o: config.h $(INCDIR)/libiberty.h
269hex.o: $(INCDIR)/libiberty.h
270floatformat.o: $(INCDIR)/floatformat.h
271mkstemps.o: config.h
272objalloc.o: $(INCDIR)/objalloc.h
273obstack.o: config.h $(INCDIR)/obstack.h
274pexecute.o: config.h $(INCDIR)/libiberty.h
e2eaf477 275setenv.o: config.h
252b5132
RH
276spaces.o: $(INCDIR)/libiberty.h
277splay-tree.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h $(INCDIR)/ansidecl.h
278strerror.o: config.h $(INCDIR)/libiberty.h
279strsignal.o: config.h $(INCDIR)/libiberty.h
280xatexit.o: $(INCDIR)/libiberty.h
281xexit.o: $(INCDIR)/libiberty.h
282xmalloc.o: $(INCDIR)/libiberty.h
e2eaf477 283xmemdup.o: config.h $(INCDIR)/libiberty.h
252b5132
RH
284xstrdup.o: config.h $(INCDIR)/libiberty.h
285xstrerror.o: config.h $(INCDIR)/libiberty.h
e2eaf477 286hashtab.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h $(INCDIR)/ansidecl.h