OSDN Git Service

- fix bad r23573 from egtvedt
[uclinux-h8/uClibc.git] / Makefile.in
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
4 #
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6 #
7
8 #--------------------------------------------------------------
9 # You shouldn't need to mess with anything beyond this point...
10 #--------------------------------------------------------------
11 clean_targets := clean realclean distclean \
12         objclean-y headers_clean-y utils_clean
13 noconfig_targets := menuconfig config oldconfig silentoldconfig randconfig \
14         defconfig allyesconfig allnoconfig \
15         release dist tags help
16
17 include $(top_builddir)Rules.mak
18 sub_headers := headers
19
20 #suspicious_dependency:=include/bits
21
22 ifeq ($(HAVE_DOT_CONFIG),y)
23
24 all: pregen libs
25
26 # To be able to build the libs rule, we must first have the generated headers.
27 # This is needed when locale support is enabled, but also ensures that the
28 # build process is parallel safe.
29 libs: pregen
30
31 # In this section, we need .config
32 -include .config.cmd
33
34 else # ifeq ($(HAVE_DOT_CONFIG),y)
35
36 all: menuconfig
37
38 headers:
39         @echo "Need to make a config file first, run: make menuconfig"
40         @false
41
42 endif # ifeq ($(HAVE_DOT_CONFIG),y)
43
44 include $(top_srcdir)ldso/Makefile.in
45 include $(top_srcdir)libcrypt/Makefile.in
46 include $(top_srcdir)libintl/Makefile.in
47 include $(top_srcdir)libm/Makefile.in
48 include $(top_srcdir)libnsl/Makefile.in
49 include $(top_srcdir)libresolv/Makefile.in
50 include $(top_srcdir)libutil/Makefile.in
51 include $(top_srcdir)libpthread/Makefile.in
52 include $(top_srcdir)librt/Makefile.in
53 include $(top_srcdir)extra/locale/Makefile.in
54
55 # last included to catch all the objects added by others (locales/threads)
56 include $(top_srcdir)libc/Makefile.in
57
58 ifeq ($(HAVE_DOT_CONFIG),y)
59 # If the .config changes then we have to make sure that our includes are
60 # updated properly. This would normally work by saying that the headers
61 # have uClibc_config.h as prerequisite but since we _symlink_ the headers
62 # and do not (?) want to rely on 'make -L' we better update them right here,
63 # on spot to save us from alot of hazzle.
64 include/bits/uClibc_config.h: extra/config/conf .config $(top_srcdir)extra/scripts/conf-header.sh | include/bits
65         @$(disp_gen)
66         @#superfluous: $(Q)$(INSTALL) -d $(dir $@)
67         $(Q)@$< -s $(top_srcdir)extra/Configs/Config.in
68         $(Q)$(top_srcdir)extra/scripts/conf-header.sh .config > $@
69         $(Q)$(MAKE) headers-y
70
71 # For the moment, we have to keep re-running this target
72 # because the fix includes scripts rely on pre-processers
73 # in order to generate the headers correctly :(.  That
74 # means we can't use the $(HOSTCC) in order to get the
75 # correct output.
76 ifeq ($(ARCH_USE_MMU),y)
77 export header_extra_args =
78 else
79 export header_extra_args = -n
80 endif
81 HEADERS_BITS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/bits/*.h))
82 HEADERS_BITS_ARCH   := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h))
83 HEADERS_BITS_SUBARCH :=
84 ifneq ($(TARGET_SUBARCH),)
85 HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h))
86 endif
87 HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH) $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_COMMON))
88
89 HEADERS_SYS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/sys/*.h))
90 HEADERS_SYS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h))
91 HEADERS_SYS_COMMON := $(filter-out $(HEADERS_SYS_ARCH),$(HEADERS_SYS_COMMON))
92
93 ALL_HEADERS_COMMON       := include/fpu_control.h include/dl-osinfo.h \
94                                 include/hp-timing.h
95 ALL_HEADERS_BITS_COMMON  := $(addprefix include/bits/,$(HEADERS_BITS_COMMON))
96 ALL_HEADERS_BITS_ARCH    := $(addprefix include/bits/,$(HEADERS_BITS_ARCH))
97 ifneq ($(TARGET_SUBARCH),)
98 ALL_HEADERS_BITS_SUBARCH := $(addprefix include/bits/,$(HEADERS_BITS_SUBARCH))
99 else
100 ALL_HEADERS_BITS_SUBARCH :=
101 endif
102 ALL_HEADERS_SYS_COMMON   := $(addprefix include/sys/,$(HEADERS_SYS_COMMON))
103 ALL_HEADERS_SYS_ARCH     := $(addprefix include/sys/,$(HEADERS_SYS_ARCH))
104
105 target-headers-sysdep := \
106         $(ALL_HEADERS_COMMON) \
107         $(ALL_HEADERS_BITS_COMMON) \
108         $(ALL_HEADERS_BITS_ARCH) \
109         $(ALL_HEADERS_BITS_SUBARCH) \
110         $(ALL_HEADERS_SYS_COMMON) \
111         $(ALL_HEADERS_SYS_ARCH)
112
113 include/fpu_control.h:
114         @$(disp_ln)
115         $(Q)[ -r libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) ] && \
116                 $(LN) -fs ../libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@ || \
117                 $(LN) -fs ../libc/sysdeps/linux/common/$(@F) $@
118
119 include/dl-osinfo.h include/hp-timing.h:
120         $(do_ln) ../libc/sysdeps/linux/common/$(@F) $@
121
122 $(ALL_HEADERS_BITS_COMMON):
123         $(do_ln) ../../libc/sysdeps/linux/common/bits/$(@F) $@
124
125 $(ALL_HEADERS_BITS_ARCH):
126         $(do_ln) ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(@F) $@
127
128 ifneq ($(TARGET_SUBARCH),)
129 $(ALL_HEADERS_BITS_SUBARCH):
130         $(do_ln) ../../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/$(@F) $@
131 endif
132
133 ifneq ($(strip $(ALL_HEADERS_SYS_COMMON)),)
134 $(ALL_HEADERS_SYS_COMMON):
135         $(do_ln) ../../libc/sysdeps/linux/common/sys/$(@F) $@
136 endif
137
138 ifneq ($(strip $(ALL_HEADERS_SYS_ARCH)),)
139 $(ALL_HEADERS_SYS_ARCH):
140         $(do_ln) ../../libc/sysdeps/linux/$(TARGET_ARCH)/sys/$(@F) $@
141 endif
142
143 $(target-headers-sysdep): | include/bits
144
145 sysdep_common_headers-clean:
146         $(RM) $(ALL_HEADERS_COMMON)
147 headers_clean-y += sysdep_common_headers-clean
148
149 # The headers. Arch specific headers are specified via ARCH_HEADERS in
150 # libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch which appends those via
151 # libc/sysdeps/linux/Makefile.commonarch to headers-y
152 headers-y += $(target-headers-sysdep)
153
154 headers: include/bits/uClibc_config.h
155
156 pregen: include/bits/sysnum.h headers
157
158 include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh
159         $(Q)$(INSTALL) -d $(@D)
160         @$(disp_gen)
161         $(Q)set -e; \
162         cd $(top_builddir); \
163         tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null`; \
164         [ -z "$$tmp" ] && tmp='include/bits/sysnum.h.new'; \
165         KERNEL_HEADERS="${KERNEL_HEADERS}" top_builddir=. CC="$(CC) $(CPU_CFLAGS)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \
166         if cmp include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \
167                 $(RM) $$tmp; \
168         else \
169                 mv -f $$tmp include/bits/sysnum.h; \
170         fi
171
172 $(LOCAL_INSTALL_PATH):
173         $(Q)$(MAKE) PREFIX=$(shell pwd)/ RUNTIME_PREFIX=./ \
174         DEVEL_PREFIX=$(LOCAL_INSTALL_PATH)/usr/ \
175         HOSTCC="$(HOSTCC)" \
176         install_kernel_headers
177         $(Q)$(MAKE) PREFIX=$(shell pwd)/ RUNTIME_PREFIX=./ \
178         DEVEL_PREFIX=$(LOCAL_INSTALL_PATH)/usr/ \
179         HOSTCC="$(HOSTCC)" \
180         install_dev
181
182 install: install_runtime install_dev
183
184
185 RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib)
186
187 $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c
188         $(hcompile.u)
189
190 # Installs kernel header files (linux/*, asm/*, asm-generic/*).
191 install_kernel_headers: headers
192         top_builddir=$(top_builddir) \
193         $(top_srcdir)extra/scripts/install_kernel_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include
194
195 # Installs header files.
196 install_headers: headers $(top_builddir)extra/scripts/unifdef
197         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
198         top_builddir=$(top_builddir) \
199         $(top_srcdir)extra/scripts/install_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include
200         printf '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' > \
201                 $(PREFIX)$(DEVEL_PREFIX)include/libc-internal.h
202         echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
203                 $(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
204         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h
205         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/_lfs_64.h
206         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_uintmaxtostr.h
207         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/kernel_sigaction.h
208         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/kernel_stat.h
209 ifneq ($(UCLIBC_HAS_FLOATS),y)
210         # Remove floating point related headers since float support is disabled.
211         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/complex.h
212         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fpu_control.h
213         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ieee754.h
214         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/math.h
215         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tgmath.h
216         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_fpmax.h
217 endif
218 ifneq ($(UCLIBC_HAS_FENV),y)
219         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fenv.h \
220                 $(PREFIX)$(DEVEL_PREFIX)include/bits/fenv.h \
221                 $(PREFIX)$(DEVEL_PREFIX)include/bits/fenvinline.h
222 endif
223 ifneq ($(UCLIBC_HAS_WCHAR),y)
224         # Remove wide char headers since wide char support is disabled.
225         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wctype.h
226         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wchar.h
227 endif
228 ifneq ($(UCLIBC_HAS_LOCALE),y)
229         # Remove iconv header since locale support is disabled.
230         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/iconv.h
231 endif
232 ifneq ($(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF),y)
233         # Remove printf header since custom print specifier support is disabled.
234         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/printf.h
235 endif
236 ifneq ($(UCLIBC_HAS_XLOCALE),y)
237         # Remove xlocale header since extended locale support is disabled.
238         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/xlocale.h
239 endif
240 ifneq ($(UCLIBC_HAS_GETTEXT_AWARENESS),y)
241         # Remove libintl header since gettext support is disabled.
242         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/libintl.h
243 endif
244 ifneq ($(UCLIBC_HAS_REGEX),y)
245         # Remove regex headers since regex support is disabled.
246         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regex.h
247         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regexp.h
248 endif
249 ifneq ($(UCLIBC_HAS_WORDEXP),y)
250         # Remove wordexp header since wordexp support is disabled.
251         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wordexp.h
252 endif
253 ifneq ($(UCLIBC_HAS_FTW),y)
254         # Remove ftw header since ftw support is disabled.
255         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ftw.h
256 endif
257 ifneq ($(UCLIBC_HAS_GLOB),y)
258         # Remove glob header since glob support is disabled.
259         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/glob.h
260 endif
261 ifneq ($(UCLIBC_HAS_GNU_GETOPT),y)
262 ifneq ($(UCLIBC_HAS_GETOPT_LONG),y)
263         # Remove getopt header since gnu getopt support is disabled.
264         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/getopt.h
265 endif
266 endif
267 ifneq ($(UCLIBC_HAS_SHADOW),y)
268         # Remove shadow header since shadow password support is disabled.
269         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/shadow.h
270 endif
271 ifneq ($(PTHREADS_DEBUG_SUPPORT),y)
272         # Remove thread_db header since thread debug support is disabled.
273         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/thread_db.h
274 endif
275 ifneq ($(UCLIBC_HAS_THREADS),y)
276         # Remove pthread headers since thread support is disabled.
277         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/*thread*.h
278         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/semaphore.h
279         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/*thread*.h
280 endif
281 ifneq ($(HAVE_SHARED),y)
282         # Remove dlfcn header if we don't have shared libraries.
283         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dlfcn.h
284         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/dlfcn.h
285 endif
286 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
287         # Remove this as it is only used internally.
288         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tls.h
289 endif
290 ifneq ($(UCLIBC_HAS_GNU_ERROR),y)
291         # Remove error.h upon request
292         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/error.h
293 endif
294 ifneq ($(UCLIBC_HAS_BSD_ERR),y)
295         # Remove err.h upon request
296         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/err.h
297 endif
298 ifneq ($(UCLIBC_SUSV3_LEGACY),y)
299         # Remove timeb.h since the LEGACY ftime() was disabled upon request
300         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/timeb.h
301 endif
302 ifneq ($(UCLIBC_HAS_EPOLL),y)
303         # Remove epoll.h since epoll_*() were disabled upon request
304         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/epoll.h
305 endif
306 ifneq ($(UCLIBC_HAS_XATTR),y)
307         # Remove xattr.h since extended attributes were disabled upon request
308         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/xattr.h
309 endif
310 ifneq ($(UCLIBC_HAS_PTY),y)
311         # Remove pty.h since PTY support was disabled upon request
312         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/pty.h
313 endif
314 ifneq ($(UCLIBC_LINUX_SPECIFIC),y)
315         # Remove linux-specific headers as requested
316         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/inotify.h
317         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/perm.h
318         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/personality.h
319 endif
320 ifneq ($(UCLIBC_SV4_DEPRECATED),y)
321         # Remove ustat.h since deprecated SV4 support was disabled upon request
322         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ustat.h
323         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/ustat.h
324         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/ustat.h
325 endif
326 ifeq ($(UCLIBC_HAS_REALTIME)$(UCLIBC_HAS_ADVANCED_REALTIME),)
327         # Remove SUSv-realtime related message-queue headers upon request
328         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/mqueue.h
329         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/mqueue.h
330         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/mqueue.h
331 endif
332 ifneq ($(UCLIBC_HAS_REALTIME),y)
333         # Remove SUSv-realtime related headers upon request
334         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sched.h
335         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/sched.h
336         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/sched.h
337         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/semaphore.h
338         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/semaphore.h
339         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/semaphore.h
340 endif
341 ifneq ($(UCLIBC_HAS_SOCKET),y)
342         # Remove socket related headers upon request
343         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/socket.h
344         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/socket.h
345         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/socketvar.h
346 endif
347 ifneq ($(UCLIBC_HAS_CRYPT),y)
348         # Remove crypt.h since libcrypt was disabled upon request
349         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/crypt.h
350 endif
351 ifneq ($(UCLIBC_SUPPORT_AI_ADDRCONFIG),y)
352         # Remove ifaddrs.h since the corresponding functionality is disabled
353         $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ifaddrs.h
354 endif
355
356 # Installs development library links.
357 install_dev: install_headers all
358         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
359         -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
360 ifeq ($(HAVE_SHARED),y)
361         for i in `find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
362         $(SED) -e 's/lib\///'` ; do \
363                 $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(MAJOR_VERSION) \
364                 $(PREFIX)$(DEVEL_PREFIX)lib/$$i; \
365         done
366         if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \
367                 $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
368                 $(SED) -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)lib/$(NONSHARED_LIBNAME):' \
369                     -e 's:$(SHARED_MAJORNAME):$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME):' \
370                     -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)lib/$(UCLIBC_LDSO):' \
371                     $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
372         fi
373 ifeq ($(UCLIBC_HAS_THREADS),y)
374 ifneq ($(LINUXTHREADS_OLD),y)
375         if [ -f $(top_builddir)lib/libpthread.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) ] ; then \
376                 $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
377                 cp $(top_srcdir)extra/scripts/format.lds $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
378                 echo "GROUP ( $(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) $(DEVEL_PREFIX)lib/libpthread_nonshared.a )" \
379                         >> $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
380         fi
381 endif
382 endif
383 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
384         $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \
385                 $(PREFIX)$(DEVEL_PREFIX)lib/libthread_db.so
386 endif
387 ifeq ($(DOPIC),y)
388 #       # If we build shared libraries then the static libs are PIC...
389 #       # Make _pic.a symlinks to make mklibs.py and similar tools happy.
390         if [ -d lib ] ; then \
391                 for i in `find lib/ -type f -name 'lib*.a' | $(SED) -e 's/lib\///'` ; do \
392                         $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)lib/`echo $$i \
393                                 | $(SED) -e 's/\.a$$/_pic.a/'`; \
394                 done ; \
395         fi
396 endif
397 endif
398 ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
399         for file in lib/lib*.gdb; do \
400                 if test -f $$file; then \
401                         $(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)lib; \
402                         $(INSTALL) -m 755 `echo $$file | $(SED) 's/\.gdb$$//'` \
403                           $(PREFIX)$(DEVEL_PREFIX)lib; \
404                 fi; \
405         done
406 endif
407
408 # Installs run-time libraries
409 install_runtime: all
410 ifeq ($(HAVE_SHARED),y)
411         $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)lib
412         $(INSTALL) -m 644 lib/lib*-$(VERSION).so \
413                 $(PREFIX)$(RUNTIME_PREFIX)lib
414         cd lib && $(TAR) -cf - *.so.* | $(TAR) -xf - -C $(PREFIX)$(RUNTIME_PREFIX)lib
415         @if [ -x lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so ] ; then \
416                 set -e; \
417                 $(SHELL_SET_X); \
418                 $(INSTALL) -m 755 lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so \
419                         $(PREFIX)$(RUNTIME_PREFIX)lib; \
420         fi
421 endif
422
423 utils:
424         $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils
425
426 # Installs helper applications, such as 'ldd' and 'ldconfig'
427 install_utils: utils
428         $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils utils_install
429
430 endif # ifeq ($(HAVE_DOT_CONFIG),y)
431
432 include/bits:
433         @$(disp_mkdir)
434         $(Q)$(INSTALL) -d $@
435
436 # configuration
437 # ---------------------------------------------------------------------------
438 extra/config/conf extra/config/mconf: $(suspicious_dependency)
439         $(Q)$(MAKE) -C extra/config $(notdir $@)
440
441 menuconfig: extra/config/mconf $(suspicious_dependency)
442         $(Q)./extra/config/mconf extra/Configs/Config.in
443
444 config: extra/config/conf $(suspicious_dependency)
445         $(Q)./extra/config/conf extra/Configs/Config.in
446
447 oldconfig: extra/config/conf $(suspicious_dependency)
448         $(Q)./extra/config/conf -o extra/Configs/Config.in
449
450 silentoldconfig: extra/config/conf $(suspicious_dependency)
451         $(Q)./extra/config/conf -s extra/Configs/Config.in
452
453 randconfig: extra/config/conf $(suspicious_dependency)
454         $(Q)./extra/config/conf -r extra/Configs/Config.in
455
456 allyesconfig: extra/config/conf $(suspicious_dependency)
457         $(Q)./extra/config/conf -y extra/Configs/Config.in
458         $(SED) -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" .config
459         $(SED) -i -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" .config
460         $(SED) -i -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" .config
461         $(SED) -i -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" .config
462         $(SED) -i -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" .config
463         $(Q)./extra/config/conf -o extra/Configs/Config.in
464
465 allnoconfig: extra/config/conf $(suspicious_dependency)
466         $(Q)./extra/config/conf -n extra/Configs/Config.in
467
468 defconfig: extra/config/conf $(suspicious_dependency)
469         $(Q)./extra/config/conf -d extra/Configs/Config.in \
470                 -D extra/Configs/defconfigs/$(ARCH)
471
472 clean:
473         $(Q)$(RM) -r lib include/bits
474         $(RM) ldso/*/*.a libpthread/*/*.a libc/*.a libcrypt/*.a libintl/*.a \
475                 libm/*.a libnsl/*.a libpthread/*.a libresolv/*.a librt/*.a \
476                 libutil/*.a lib/*.a \
477                 include/fpu_control.h include/dl-osinfo.h include/hp-timing.h
478         +$(MAKE) -s -C test clean
479         +$(MAKE) -C utils utils_clean
480         @set -e; \
481         for i in `(cd libc/sysdeps/linux/common/sys; ls *.h)` ; do \
482                 $(RM) include/sys/$$i; \
483         done; \
484         if [ -d libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
485                 for i in `(cd libc/sysdeps/linux/$(TARGET_ARCH)/sys; ls *.h)` ; do \
486                         $(RM) include/sys/$$i; \
487                 done; \
488         fi
489         @$(RM) include/linux include/asm*
490         $(RM) $(top_builddir)extra/scripts/unifdef
491         $(RM) -r $(LOCAL_INSTALL_PATH)
492
493 distclean: clean
494         -find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\*.dep \) -exec $(RM) {} \;
495         $(RM) .config .config.old .config.cmd
496         $(RM) extra/locale/*.tgz
497         $(MAKE) -C extra/config distclean
498
499 dist release:
500         $(RM) -r ../uClibc-$(VERSION) ../uClibc-$(VERSION).tar.bz2
501         svn -q export . ../uClibc-$(VERSION)
502         $(TAR) cjf ../uClibc-$(VERSION).tar.bz2 -C .. uClibc-$(VERSION)
503         du -b ../uClibc-$(VERSION).tar.bz2
504
505 test check: test_compile
506         $(Q)$(MAKE) -C test
507
508 test_compile: $(LOCAL_INSTALL_PATH)
509         $(Q)$(MAKE) -C test compile