OSDN Git Service

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