OSDN Git Service

51327deaaa6c5eb6b47acb2feb38860936b7eaa8
[uclinux-h8/uClibc.git] / Makefile
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Library General Public
7 # License as published by the Free Software Foundation; either
8 # version 2 of the License, or (at your option) any later
9 # version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Library General Public License for more details.
15 #
16 # You should have received a copy of the GNU Library General
17 # Public License along with this program; if not, write to the
18 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 # Boston, MA 02111-1307 USA
20
21
22 #--------------------------------------------------------------
23 # You shouldn't need to mess with anything beyond this point...
24 #--------------------------------------------------------------
25 noconfig_targets := menuconfig config oldconfig randconfig \
26         defconfig allyesconfig allnoconfig clean distclean \
27         release tags TAGS
28 TOPDIR=./
29 include Rules.mak
30
31 DIRS = extra ldso libc libcrypt libresolv libnsl libutil libm libpthread
32 ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
33         DIRS += libintl
34 endif
35
36 ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
37
38 all: headers pregen subdirs shared utils finished
39
40 # In this section, we need .config
41 -include .config.cmd
42
43 .PHONY: $(SHARED_TARGET)
44 shared: $(SHARED_TARGET)
45 ifeq ($(strip $(HAVE_SHARED)),y)
46         @$(MAKE) -C libc shared
47         @$(MAKE) -C ldso shared
48         @$(MAKE) -C libcrypt shared
49         @$(MAKE) -C libresolv shared
50         @$(MAKE) -C libnsl shared
51         @$(MAKE) -C libutil shared
52         @$(MAKE) -C libm shared
53         @$(MAKE) -C libpthread shared
54 ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
55         @$(MAKE) -C libintl shared
56 endif
57 else
58 ifeq ($(SHARED_TARGET),)
59         @echo
60         @echo Not building shared libraries...
61         @echo
62 endif
63 endif
64
65 ifneq ($(SHARED_TARGET),)
66
67 lib/main.o: $(ROOTDIR)/lib/libc/main.c
68         $(CC) $(CFLAGS) $(ARCH_CFLAGS) -c -o $@ $(ROOTDIR)/lib/libc/main.c
69
70 bogus $(SHARED_TARGET): lib/libc.a lib/main.o Makefile
71         make -C $(ROOTDIR) relink
72         $(CC) -nostartfiles -o $(SHARED_TARGET) $(ARCH_CFLAGS) -Wl,-elf2flt -nostdlib           \
73                 -Wl,-shared-lib-id,${LIBID}                             \
74                 lib/main.o \
75                 -Wl,--whole-archive,lib/libc.a,-lgcc,--no-whole-archive
76         $(OBJCOPY) -L _GLOBAL_OFFSET_TABLE_ -L main -L __main -L _start \
77                 -L __uClibc_main -L __uClibc_start_main -L lib_main \
78                 -L _exit_dummy_ref              \
79                 -L __do_global_dtors -L __do_global_ctors               \
80                 -L __CTOR_LIST__ -L __DTOR_LIST__                       \
81                 -L _current_shared_library_a5_offset_                   \
82                 $(SHARED_TARGET).gdb
83         $(LN) -sf $(SHARED_TARGET).gdb .
84 endif
85
86 finished: shared
87         @echo
88         @echo Finally finished compiling...
89         @echo
90
91 #
92 # Target for uClinux distro
93 #
94 .PHONY: romfs
95 romfs:
96         @if [ "$(CONFIG_BINFMT_SHARED_FLAT)" = "y" ]; then \
97                 [ -e $(ROMFSDIR)/lib ] || $(INSTALL) -d $(ROMFSDIR)/lib; \
98                 $(ROMFSINST) $(SHARED_TARGET) /lib/lib$(LIBID).so; \
99         fi
100 ifeq ($(strip $(HAVE_SHARED)),y)
101         $(INSTALL) -d $(ROMFSDIR)/lib
102         $(INSTALL) -m 644 lib/lib*-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
103                 $(ROMFSDIR)/lib
104         cp -fa lib/*.so.* $(ROMFSDIR)/lib/.
105         @if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
106             set -x -e; \
107             $(INSTALL) -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
108                         $(ROMFSDIR)/lib; \
109                 $(ROMFSINST) -s \
110                         /lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
111                         /lib/ld-linux.so.2; \
112         fi;
113 endif
114
115 include/bits/uClibc_config.h: .config
116         @if [ ! -x ./extra/config/conf ] ; then \
117             make -C extra/config conf; \
118         fi;
119         $(RM) -r include/bits
120         $(INSTALL) -d include/bits
121         @./extra/config/conf -o extra/Configs/Config.$(TARGET_ARCH)
122
123 headers: include/bits/uClibc_config.h
124 ifeq ($(strip $(UCLIBC_HAS_MMU)),y)
125         @./extra/scripts/fix_includes.sh -k $(KERNEL_SOURCE) -t $(TARGET_ARCH)
126 else
127         @./extra/scripts/fix_includes.sh -k $(KERNEL_SOURCE) -t $(TARGET_ARCH) -n
128 endif
129         @if [ "$(TARGET_ARCH)" = "mipsel" ]; then \
130             $(LN) -fs mips libc/sysdeps/linux/mipsel; \
131             $(LN) -fs mips ldso/ldso/mipsel; \
132             $(LN) -fs mips libpthread/linuxthreads/sysdeps/mipsel; \
133         fi;
134         @cd include/bits; \
135         set -e; \
136         for i in `ls ../../libc/sysdeps/linux/common/bits/*.h` ; do \
137                 $(LN) -fs $$i .; \
138         done; \
139         if [ -d ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits ] ; then \
140                 for i in `ls ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h` ; do \
141                         $(LN) -fs $$i .; \
142                 done; \
143         fi
144         @cd include/sys; \
145         set -e; \
146         for i in `ls ../../libc/sysdeps/linux/common/sys/*.h` ; do \
147                 $(LN) -fs $$i .; \
148         done; \
149         if [ -d ../../libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
150                 for i in `ls ../../libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h` ; do \
151                         $(LN) -fs $$i .; \
152                 done; \
153         fi
154         @cd $(TOPDIR); \
155         set -x -e; \
156         TOPDIR=. CC="$(CC)" /bin/sh extra/scripts/gen_bits_syscall_h.sh > include/bits/sysnum.h.new; \
157         if cmp include/bits/sysnum.h include/bits/sysnum.h.new >/dev/null 2>&1; then \
158                 $(RM) include/bits/sysnum.h.new; \
159         else \
160                 mv -f include/bits/sysnum.h.new include/bits/sysnum.h; \
161         fi
162         $(MAKE) -C libc/sysdeps/linux/$(TARGET_ARCH) headers
163
164 # Command used to download source code
165 WGET:=wget --passive-ftp
166
167 pregen: headers
168 ifeq ($(strip $(UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA)),y)
169         (cd extra/locale; \
170         $(WGET) http://www.uclibc.org/downloads/uClibc-locale-030818.tgz);
171 endif
172 ifeq ($(strip $(UCLIBC_PREGENERATED_LOCALE_DATA)),y)
173         (cd extra/locale; zcat uClibc-locale-030818.tgz | tar -xvf -)
174         make -C extra/locale pregen
175 endif
176
177
178 subdirs: $(patsubst %, _dir_%, $(DIRS))
179
180 $(patsubst %, _dir_%, $(DIRS)) : dummy
181         $(MAKE) -C $(patsubst _dir_%, %, $@)
182
183 tags:
184         ctags -R
185
186 install: install_dev install_runtime install_toolchain install_utils finished2
187
188
189 # Installs header files and development library links.
190 install_dev:
191         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/lib
192         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/usr/lib
193         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/include
194         -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)/lib/
195         tar -chf - include | tar -xf - -C $(PREFIX)$(DEVEL_PREFIX);
196 ifneq ($(strip $(UCLIBC_HAS_FLOATS)),y)
197         # Remove floating point related headers since float support is disabled.
198         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/complex.h
199         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/fpu_control.h
200         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/ieee754.h
201         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/math.h
202         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/tgmath.h
203 endif
204 ifneq ($(strip $(UCLIBC_HAS_WCHAR)),y)
205         # Remove wide char headers since wide char support is disabled.
206         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/wctype.h
207         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/wchar.h
208 endif
209 ifneq ($(strip $(UCLIBC_HAS_LOCALE)),y)
210         # Remove iconv header since locale support is disabled.
211         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/iconv.h
212 endif
213 ifneq ($(strip $(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF)),y)
214         # Remove printf header since custom print specifier support is disabled.
215         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/printf.h
216 endif
217 ifneq ($(strip $(UCLIBC_HAS_XLOCALE)),y)
218         # Remove xlocale header since extended locale support is disabled.
219         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/xlocale.h
220 endif
221 ifneq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
222         # Remove libintl header since gettext support is disabled.
223         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/libintl.h
224 endif
225 ifneq ($(strip $(UCLIBC_HAS_REGEX)),y)
226         # Remove regex headers since regex support is disabled.
227         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/regex.h
228         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/regexp.h
229 endif
230 ifneq ($(strip $(UCLIBC_HAS_WORDEXP)),y)
231         # Remove wordexp header since wordexp support is disabled.
232         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/wordexp.h
233 endif
234 ifneq ($(strip $(UCLIBC_HAS_FTW)),y)
235         # Remove ftw header since ftw support is disabled.
236         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/ftw.h
237 endif
238 ifneq ($(strip $(UCLIBC_HAS_GLOB)),y)
239         # Remove glob header since glob support is disabled.
240         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/glob.h
241 endif
242 ifneq ($(strip $(UCLIBC_HAS_GNU_GETOPT)),y)
243         # Remove getopt header since gnu getopt support is disabled.
244         $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/getopt.h
245 endif
246         -@for i in `find  $(PREFIX)$(DEVEL_PREFIX) -type d` ; do \
247             chmod -f 755 $$i; chmod -f 644 $$i/*.h; \
248         done;
249         -find $(PREFIX)$(DEVEL_PREFIX) -name CVS | xargs $(RM) -r;
250         -chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$$/\1.\2/'` $(PREFIX)$(DEVEL_PREFIX)
251 ifeq ($(strip $(HAVE_SHARED)),y)
252         -$(INSTALL) -m 644 lib/*.so $(PREFIX)$(DEVEL_PREFIX)/lib/
253         -find lib/ -type l -name '*.so' -exec cp -fa {} $(PREFIX)$(DEVEL_PREFIX)/lib ';'
254         # If we build shared libraries then the static libs are PIC...
255         # Make _pic.a symlinks to make mklibs.py and similar tools happy.
256         for i in `find lib/  -type f -name '*.a' | sed -e 's/lib\///'` ; do \
257                 $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)/lib/`echo $$i | sed -e 's/\.a$$/_pic.a/'`; \
258         done
259 endif
260
261
262 # Installs run-time libraries and helper apps onto the host system
263 # allowing cross development.  If you want to deploy to a target 
264 # system, use the "install_target" target instead... 
265 install_runtime:
266 ifeq ($(strip $(HAVE_SHARED)),y)
267         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/lib
268         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/bin
269         $(INSTALL) -m 644 lib/lib*-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
270                 $(PREFIX)$(DEVEL_PREFIX)/lib
271         cp -fa lib/*.so.* $(PREFIX)$(DEVEL_PREFIX)/lib
272         @if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
273             set -x -e; \
274             $(INSTALL) -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
275                         $(PREFIX)$(DEVEL_PREFIX)/lib; \
276         fi;
277         #@if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
278         #    $(INSTALL) -d $(PREFIX)$(SHARED_LIB_LOADER_PATH); \
279         #    $(LN) -sf $(PREFIX)$(DEVEL_PREFIX)/lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
280         #               $(PREFIX)$(SHARED_LIB_LOADER_PATH)/$(UCLIBC_LDSO); \
281         #fi;
282 endif
283
284 install_toolchain:
285         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/lib
286         $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/bin
287         $(INSTALL) -d $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin
288         $(INSTALL) -d $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin
289         $(MAKE) -C extra/gcc-uClibc install
290
291 ifeq ($(strip $(HAVE_SHARED)),y)
292 utils: $(TOPDIR)ldso/util/ldd
293         $(MAKE) -C ldso utils
294 else
295 utils: dummy
296 endif
297
298 install_utils: utils
299 ifeq ($(strip $(HAVE_SHARED)),y)
300         $(INSTALL) -d $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin;
301         $(INSTALL) -m 755 ldso/util/ldd \
302                 $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd
303         $(LN) -fs $(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd \
304                 $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin/ldd
305         # For now, don't bother with readelf since surely the host
306         # system has binutils, or we couldn't have gotten this far...
307         #$(INSTALL) -m 755 ldso/util/readelf \
308         #       $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-readelf
309         #$(LN) -fs $(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-readelf \
310         #       $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin/readelf
311         @if [ -x ldso/util/ldconfig ] ; then \
312             set -x -e; \
313             $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/etc; \
314             $(INSTALL) -m 755 ldso/util/ldconfig \
315                     $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldconfig; \
316             $(LN) -fs $(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldconfig \
317                     $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin/ldconfig; \
318         fi;
319 endif
320
321 # Installs run-time libraries and helper apps in preparation for
322 # deploying onto a target system, but installed below wherever
323 # $PREFIX is set to, allowing you to package up the result for
324 # deployment onto your target system.
325 install_target:
326 ifeq ($(strip $(HAVE_SHARED)),y)
327         $(INSTALL) -d $(PREFIX)$(TARGET_PREFIX)/lib
328         $(INSTALL) -d $(PREFIX)$(TARGET_PREFIX)/usr/bin
329         $(INSTALL) -m 644 lib/lib*-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
330                 $(PREFIX)$(TARGET_PREFIX)/lib
331         cp -fa lib/*.so.* $(PREFIX)$(TARGET_PREFIX)/lib
332         @if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
333             set -x -e; \
334             $(INSTALL) -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
335                         $(PREFIX)$(TARGET_PREFIX)/lib; \
336         fi;
337         #@if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
338         #    $(INSTALL) -d $(PREFIX)$(SHARED_LIB_LOADER_PATH); \
339         #    $(LN) -sf $(PREFIX)$(TARGET_PREFIX)/lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
340         #               $(PREFIX)$(SHARED_LIB_LOADER_PATH)/$(UCLIBC_LDSO); \
341         #fi;
342 endif
343
344 install_target_utils:
345 ifeq ($(strip $(HAVE_SHARED)),y)
346         @$(MAKE) -C ldso/util ldd.target ldconfig.target #readelf.target
347         $(INSTALL) -d $(PREFIX)$(TARGET_PREFIX)/etc;
348         $(INSTALL) -d $(PREFIX)$(TARGET_PREFIX)/sbin;
349         $(INSTALL) -d $(PREFIX)$(TARGET_PREFIX)/usr/bin;
350         $(INSTALL) -m 755 ldso/util/ldd.target $(PREFIX)$(TARGET_PREFIX)/usr/bin/ldd
351         $(INSTALL) -m 755 ldso/util/ldconfig.target $(PREFIX)$(TARGET_PREFIX)/sbin/ldconfig;
352         #$(INSTALL) -m 755 ldso/util/readelf.target $(PREFIX)$(TARGET_PREFIX)/usr/bin/readelf;
353 endif
354 ifeq ($(strip $(UCLIBC_HAS_LOCALE)),y)
355         @$(MAKE) -C libc/misc/wchar iconv.target
356         $(INSTALL) -d $(PREFIX)$(TARGET_PREFIX)/usr/bin;
357         $(INSTALL) -m 755 libc/misc/wchar/iconv.target $(PREFIX)$(TARGET_PREFIX)/usr/bin/iconv
358 endif
359
360 finished2:
361         @echo
362         @echo Finished installing...
363         @echo
364
365 else # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
366
367 all: menuconfig
368
369 # configuration
370 # ---------------------------------------------------------------------------
371 extra/config/conf: buildconf
372         -@if [ ! -f .config ] ; then \
373                 cp extra/Configs/Config.$(TARGET_ARCH).default .config; \
374         fi
375
376 buildconf:
377         make -C extra/config conf
378
379 extra/config/mconf: buildmconf
380         -@if [ ! -f .config ] ; then \
381                 cp extra/Configs/Config.$(TARGET_ARCH).default .config; \
382         fi
383
384 buildmconf:
385         make -C extra/config ncurses mconf
386
387 menuconfig: extra/config/mconf
388         $(RM) -r include/bits
389         $(INSTALL) -d include/bits
390         @./extra/config/mconf extra/Configs/Config.$(TARGET_ARCH)
391
392 config: extra/config/conf
393         $(RM) -r include/bits
394         $(INSTALL) -d include/bits
395         @./extra/config/conf extra/Configs/Config.$(TARGET_ARCH)
396
397 oldconfig: extra/config/conf
398         $(RM) -r include/bits
399         $(INSTALL) -d include/bits
400         @./extra/config/conf -o extra/Configs/Config.$(TARGET_ARCH)
401
402 randconfig: extra/config/conf
403         $(RM) -r include/bits
404         $(INSTALL) -d include/bits
405         @./extra/config/conf -r extra/Configs/Config.$(TARGET_ARCH)
406
407 allyesconfig: extra/config/conf
408         $(RM) -r include/bits
409         $(INSTALL) -d include/bits
410         @./extra/config/conf -y extra/Configs/Config.$(TARGET_ARCH)
411
412 allnoconfig: extra/config/conf
413         $(RM) -r include/bits
414         $(INSTALL) -d include/bits
415         @./extra/config/conf -n extra/Configs/Config.$(TARGET_ARCH)
416
417 defconfig: extra/config/conf
418         $(RM) -r include/bits
419         $(INSTALL) -d include/bits
420         @./extra/config/conf -d extra/Configs/Config.$(TARGET_ARCH)
421
422
423 clean:
424         - find . \( -name \*.o -o -name \*.a -o -name \*.so -o -name core -o -name .\#\* \) -exec $(RM) {} \;
425         @$(RM) -r tmp lib include/bits libc/tmp _install
426         $(MAKE) -C test clean
427         $(MAKE) -C ldso clean
428         $(MAKE) -C libc/misc/internals clean
429         $(MAKE) -C libc/misc/wchar clean
430         $(MAKE) -C libc/unistd clean
431         $(MAKE) -C libc/sysdeps/linux/common clean
432         $(MAKE) -C extra/gcc-uClibc clean
433         $(MAKE) -C extra/locale clean
434         @set -e; \
435         for i in `(cd $(TOPDIR)/libc/sysdeps/linux/common/sys; ls *.h)` ; do \
436                 $(RM) include/sys/$$i; \
437         done; \
438         if [ -d libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
439                 for i in `(cd libc/sysdeps/linux/$(TARGET_ARCH)/sys; ls *.h)` ; do \
440                         $(RM) include/sys/$$i; \
441                 done; \
442         fi;
443         @$(RM) include/linux include/scsi include/asm
444         @if [ -d libc/sysdeps/linux/$(TARGET_ARCH) ]; then              \
445             $(MAKE) -C libc/sysdeps/linux/$(TARGET_ARCH) clean;         \
446         fi;
447         @if [ "$(TARGET_ARCH)" = "mipsel" ]; then \
448             $(MAKE) -C libc/sysdeps/linux/mips clean; \
449             $(RM) ldso/ldso/mipsel; \
450             $(RM) libc/sysdeps/linux/mipsel; \
451             $(RM) libpthread/linuxthreads/sysdeps/mipsel; \
452         fi;
453
454 distclean: clean
455         $(RM) .config .config.old .config.cmd
456         $(MAKE) -C extra clean
457
458 release: distclean
459         cd ..;                                  \
460         $(RM) -r uClibc-$(VERSION);             \
461         cp -fa uClibc uClibc-$(VERSION);        \
462         find uClibc-$(VERSION)/ -type f         \
463             -name .\#* -exec $(RM) -r {} \; ;   \
464         find uClibc-$(VERSION)/ -type d         \
465             -name CVS  -exec $(RM) -r {} \; ;   \
466                                                 \
467         tar -cvzf uClibc-$(VERSION).tar.gz uClibc-$(VERSION)/;
468
469 endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
470
471 .PHONY: dummy subdirs release distclean clean config oldconfig menuconfig
472
473