OSDN Git Service

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