libc/string/i386/memset.c: memset 1 byte at a time is a bit gross
[uclibc-ng.git] / Makefile.in
blob2a7674543cc83351cdc1a3283f9fd5153ffa6584
1 # Makefile for uClibc
3 # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
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
17 include $(top_builddir)Rules.mak
18 sub_headers := headers
20 ifeq ($(HAVE_DOT_CONFIG),y)
22 all: pregen libs
23 libs: pregen
25 # In this section, we need .config
26 -include .config.cmd
28 else # ifeq ($(HAVE_DOT_CONFIG),y)
30 all: menuconfig
32 headers:
33 @echo "Need to make a config file first, run: make menuconfig"
34 @false
36 endif # ifeq ($(HAVE_DOT_CONFIG),y)
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
49 # last included to catch all the objects added by others (locales/threads)
50 include $(top_srcdir)libc/Makefile.in
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
64 # The above doesn't work for threads, though. Just using check-symlinks for now.
65 # XXX: FIXME: this is ugly
66 MAKEFLAGS += -L
67 include/config/linuxthreads/old.h include/config/linuxthreads/new.h:
68 @true
70 # For the moment, we have to keep re-running this target
71 # because the fix includes scripts rely on pre-processers
72 # in order to generate the headers correctly :(. That
73 # means we can't use the $(HOSTCC) in order to get the
74 # correct output.
75 ifeq ($(ARCH_USE_MMU),y)
76 export header_extra_args =
77 else
78 export header_extra_args = -n
79 endif
80 HEADERS_BITS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/bits/*.h))
81 HEADERS_BITS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h))
82 HEADERS_BITS_SUBARCH :=
83 ifneq ($(TARGET_SUBARCH),)
84 HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h))
85 endif
86 HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH) $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_COMMON))
88 HEADERS_SYS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/sys/*.h))
89 HEADERS_SYS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h))
90 HEADERS_SYS_COMMON := $(filter-out $(HEADERS_SYS_ARCH),$(HEADERS_SYS_COMMON))
92 ALL_HEADERS_COMMON := include/fpu_control.h include/dl-osinfo.h \
93 include/hp-timing.h
94 ALL_HEADERS_BITS_COMMON := $(addprefix include/bits/,$(HEADERS_BITS_COMMON))
95 ALL_HEADERS_BITS_ARCH := $(addprefix include/bits/,$(HEADERS_BITS_ARCH))
96 ifneq ($(TARGET_SUBARCH),)
97 ALL_HEADERS_BITS_SUBARCH := $(addprefix include/bits/,$(HEADERS_BITS_SUBARCH))
98 else
99 ALL_HEADERS_BITS_SUBARCH :=
100 endif
101 ALL_HEADERS_SYS_COMMON := $(addprefix include/sys/,$(HEADERS_SYS_COMMON))
102 ALL_HEADERS_SYS_ARCH := $(addprefix include/sys/,$(HEADERS_SYS_ARCH))
104 target-headers-sysdep := \
105 $(ALL_HEADERS_COMMON) \
106 $(ALL_HEADERS_BITS_COMMON) \
107 $(ALL_HEADERS_BITS_ARCH) \
108 $(ALL_HEADERS_BITS_SUBARCH) \
109 $(ALL_HEADERS_SYS_COMMON) \
110 $(ALL_HEADERS_SYS_ARCH)
112 include/fpu_control.h:
113 @$(disp_ln)
114 $(Q)[ -r libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) ] && \
115 $(LN) -fs ../libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@ || \
116 $(LN) -fs ../libc/sysdeps/linux/common/$(@F) $@
118 include/dl-osinfo.h include/hp-timing.h:
119 $(do_ln) ../libc/sysdeps/linux/common/$(@F) $@
121 $(ALL_HEADERS_BITS_COMMON):
122 $(do_ln) ../../libc/sysdeps/linux/common/bits/$(@F) $@
124 $(ALL_HEADERS_BITS_ARCH):
125 $(do_ln) ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(@F) $@
127 ifneq ($(TARGET_SUBARCH),)
128 $(ALL_HEADERS_BITS_SUBARCH):
129 $(do_ln) ../../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/$(@F) $@
130 endif
132 ifneq ($(strip $(ALL_HEADERS_SYS_COMMON)),)
133 $(ALL_HEADERS_SYS_COMMON):
134 $(do_ln) ../../libc/sysdeps/linux/common/sys/$(@F) $@
135 endif
137 ifneq ($(strip $(ALL_HEADERS_SYS_ARCH)),)
138 $(ALL_HEADERS_SYS_ARCH):
139 $(do_ln) ../../libc/sysdeps/linux/$(TARGET_ARCH)/sys/$(@F) $@
140 endif
142 $(target-headers-sysdep): | include/bits
144 sysdep_common_headers-clean:
145 $(RM) $(ALL_HEADERS_COMMON)
146 headers_clean-y += sysdep_common_headers-clean
148 # The headers. Arch specific headers are specified via ARCH_HEADERS in
149 # libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch which appends those via
150 # libc/sysdeps/linux/Makefile.commonarch to headers-y
151 headers-y += $(target-headers-sysdep)
153 headers: include/bits/uClibc_config.h
155 pregen: include/bits/sysnum.h headers
157 include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh
158 $(Q)$(INSTALL) -d $(@D)
159 @$(disp_gen)
160 $(Q)set -e; \
161 cd $(top_builddir); \
162 tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null || true`; \
163 [ -z "$$tmp" ] && tmp='include/bits/sysnum.h.new'; \
164 KERNEL_HEADERS="${KERNEL_HEADERS}" top_builddir=. CC="$(CC) $(CPU_CFLAGS)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \
165 if cmp include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \
166 $(RM) $$tmp; \
167 else \
168 mv -f $$tmp include/bits/sysnum.h; \
170 @# Ugly linux specific hack..
171 $(Q)if grep -q __NR_ $@; then true; else \
172 rm -f $@; \
173 echo "ERROR: Could not generate syscalls."; \
174 echo "Make sure that you have proper kernel headers."; \
175 echo "Your .config in KERNEL_HEADERS=\"\" was set to:"; \
176 echo "${KERNEL_HEADERS}"; \
177 exit 1; \
180 $(LOCAL_INSTALL_PATH):
181 $(Q)$(MAKE) PREFIX=$(shell pwd)/$(LOCAL_INSTALL_PATH) RUNTIME_PREFIX=/ \
182 DEVEL_PREFIX=/usr/ \
183 HOSTCC="$(HOSTCC)" \
184 install_kernel_headers
185 $(Q)$(MAKE) PREFIX=$(shell pwd)/$(LOCAL_INSTALL_PATH) RUNTIME_PREFIX=/ \
186 DEVEL_PREFIX=/usr/ \
187 HOSTCC="$(HOSTCC)" \
188 install
190 install: install_runtime install_dev
193 RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib)
195 $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c
196 $(hcompile.u)
198 # Installs kernel header files (linux/*, asm/*, asm-generic/*).
199 install_kernel_headers: headers
200 top_builddir=$(top_builddir) \
201 $(top_srcdir)extra/scripts/install_kernel_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include
203 # Installs header files.
204 install_headers: headers $(top_builddir)extra/scripts/unifdef
205 $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
206 top_builddir=$(top_builddir) \
207 $(top_srcdir)extra/scripts/install_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include
208 # Disabled. If libc-internal.h is needed, document here why!
209 #printf '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' >$(PREFIX)$(DEVEL_PREFIX)include/libc-internal.h
210 echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
211 $(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
212 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h
213 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/_lfs_64.h
214 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_uintmaxtostr.h
215 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/kernel_sigaction.h
216 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/kernel_stat.h
217 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/kernel_types.h
218 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/utmpx.h
219 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/atomic.h
220 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/atomic.h
221 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/sigcontextinfo.h
222 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/stackinfo.h
223 # gcc 4.3.1 needs it, dont rm:
224 #$(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_arch_features.h
225 ifneq ($(UCLIBC_HAS_FLOATS),y)
226 # Remove floating point related headers since float support is disabled.
227 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/complex.h
228 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fpu_control.h
229 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ieee754.h
230 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/math.h
231 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tgmath.h
232 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_fpmax.h
233 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/math*.h
234 endif
235 ifneq ($(UCLIBC_HAS_FENV),y)
236 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fenv.h \
237 $(PREFIX)$(DEVEL_PREFIX)include/bits/fenv.h \
238 $(PREFIX)$(DEVEL_PREFIX)include/bits/fenvinline.h
239 endif
240 ifneq ($(UCLIBC_HAS_WCHAR),y)
241 # Remove wide char headers since wide char support is disabled.
242 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wctype.h
243 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wchar.h
244 endif
245 ifneq ($(UCLIBC_HAS_LOCALE),y)
246 # Remove iconv header since locale support is disabled.
247 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/iconv.h
248 endif
249 ifneq ($(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF),y)
250 # Remove printf header since custom print specifier support is disabled.
251 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/printf.h
252 endif
253 ifneq ($(UCLIBC_HAS_XLOCALE),y)
254 # Remove xlocale header since extended locale support is disabled.
255 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/xlocale.h
256 endif
257 ifneq ($(UCLIBC_HAS_GETTEXT_AWARENESS),y)
258 # Remove libintl header since gettext support is disabled.
259 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/libintl.h
260 endif
261 ifneq ($(UCLIBC_HAS_REGEX),y)
262 # Remove regex headers since regex support is disabled.
263 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regex.h
264 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regexp.h
265 endif
266 ifneq ($(UCLIBC_HAS_WORDEXP),y)
267 # Remove wordexp header since wordexp support is disabled.
268 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wordexp.h
269 endif
270 ifneq ($(UCLIBC_HAS_FTW),y)
271 # Remove ftw header since ftw support is disabled.
272 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ftw.h
273 endif
274 ifneq ($(UCLIBC_HAS_GLOB),y)
275 # Remove glob header since glob support is disabled.
276 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/glob.h
277 endif
278 ifneq ($(UCLIBC_HAS_GNU_GETOPT),y)
279 ifneq ($(UCLIBC_HAS_GETOPT_LONG),y)
280 # Remove getopt header since gnu getopt support is disabled.
281 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/getopt.h
282 endif
283 endif
284 ifneq ($(UCLIBC_HAS_SHADOW),y)
285 # Remove shadow header since shadow password support is disabled.
286 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/shadow.h
287 endif
288 ifneq ($(PTHREADS_DEBUG_SUPPORT),y)
289 # Remove thread_db header since thread debug support is disabled.
290 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/thread_db.h
291 endif
292 ifneq ($(UCLIBC_HAS_THREADS),y)
293 # Remove pthread headers since thread support is disabled.
294 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/*thread*.h
295 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/semaphore.h
296 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/*thread*.h
297 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/initspin.h
298 endif
299 ifneq ($(HAVE_SHARED),y)
300 # Remove dlfcn header if we don't have shared libraries.
301 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dlfcn.h
302 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/dlfcn.h
303 endif
304 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
305 # Remove this as it is only used internally.
306 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tls.h
307 endif
308 ifneq ($(UCLIBC_HAS_GNU_ERROR),y)
309 # Remove error.h upon request
310 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/error.h
311 endif
312 ifneq ($(UCLIBC_HAS_BSD_ERR),y)
313 # Remove err.h upon request
314 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/err.h
315 endif
316 ifneq ($(UCLIBC_SUSV3_LEGACY),y)
317 # Remove timeb.h since the LEGACY ftime() was disabled upon request
318 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/timeb.h
319 # BREAKAGE: include/signal.h uses it, this rm broke bbox compile:
320 ### $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ucontext.h
321 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regexp.h
322 endif
323 ifneq ($(UCLIBC_HAS_EPOLL),y)
324 # Remove epoll.h since epoll_*() were disabled upon request
325 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/epoll.h
326 endif
327 ifneq ($(UCLIBC_HAS_XATTR),y)
328 # Remove xattr.h since extended attributes were disabled upon request
329 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/xattr.h
330 endif
331 ifneq ($(UCLIBC_HAS_PTY),y)
332 # Remove pty.h since PTY support was disabled upon request
333 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/pty.h
334 endif
335 ifneq ($(UCLIBC_LINUX_SPECIFIC),y)
336 # Remove linux-specific headers as requested
337 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/inotify.h
338 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/perm.h
339 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/personality.h
340 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/prctl.h
341 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/reboot.h
342 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/sendfile.h
343 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/fsuid.h
344 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/signalfd.h
345 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/statfs.h
346 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/statfs.h
347 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/swap.h
348 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/sysctl.h
349 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/vfs.h
350 $(RM) ${PREFIX}$(DEVEL_PREFIX)include/sys/sysinfo.h
351 endif
352 ifneq ($(UCLIBC_SV4_DEPRECATED),y)
353 # Remove ustat.h since deprecated SV4 support was disabled upon request
354 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ustat.h
355 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/ustat.h
356 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/ustat.h
357 endif
358 ifneq ($(UCLIBC_HAS_REALTIME),y)
359 # Remove SUSv-realtime related headers upon request
360 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/mqueue.h
361 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/mqueue.h
362 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sched.h
363 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/sched.h
364 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/semaphore.h
365 endif
366 ifneq ($(UCLIBC_HAS_SOCKET),y)
367 # Remove socket related headers upon request
368 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/socket.h
369 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/socket.h
370 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/socketvar.h
371 endif
372 ifneq ($(UCLIBC_HAS_CRYPT),y)
373 # Remove crypt.h since libcrypt was disabled upon request
374 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/crypt.h
375 endif
376 ifneq ($(UCLIBC_SUPPORT_AI_ADDRCONFIG),y)
377 # Remove ifaddrs.h since the corresponding functionality is disabled
378 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ifaddrs.h
379 endif
380 ifneq ($(UCLIBC_HAS_SYSLOG),y)
381 # Remove syslog.h since the corresponding functionality is disabled
382 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/syslog.h
383 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/syslog.h
384 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/syslog*.h
385 endif
386 ifneq ($(UCLIBC_HAS_RPC),y)
387 $(RM) -r $(PREFIX)$(DEVEL_PREFIX)include/rpc
388 endif
389 ifneq ($(UCLIBC_HAS_IPV6),y)
390 # Remove IPv6 headers since the corresponding functionality is disabled
391 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/netinet/ip6.h
392 $(RM) $(PREFIX)$(DEVEL_PREFIX)include/netinet/icmp6.h
393 endif
395 # Installs development library links.
396 install_dev: install_headers all
397 $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
398 -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
399 ifeq ($(HAVE_SHARED),y)
400 for i in `find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
401 $(SED) -e 's/lib\///'` ; do \
402 $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(MAJOR_VERSION) \
403 $(PREFIX)$(DEVEL_PREFIX)lib/$$i; \
404 done
405 ifeq ($(HARDWIRED_ABSPATH),y)
406 if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \
407 $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
408 $(SED) -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)lib/$(NONSHARED_LIBNAME):' \
409 -e 's:$(SHARED_MAJORNAME):$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME):' \
410 -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)lib/$(UCLIBC_LDSO):' \
411 $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
413 else
414 -$(INSTALL) -m 644 lib/libc.so $(PREFIX)$(DEVEL_PREFIX)lib/
415 endif
416 ifeq ($(UCLIBC_HAS_THREADS),y)
417 ifneq ($(LINUXTHREADS_OLD),y)
418 ifeq ($(HARDWIRED_ABSPATH),y)
419 if [ -f $(top_builddir)lib/libpthread.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) ] ; then \
420 $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
421 cp $(top_srcdir)extra/scripts/format.lds $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
422 echo "GROUP ( $(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) $(DEVEL_PREFIX)lib/libpthread_nonshared.a )" \
423 >> $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
425 else
426 -$(INSTALL) -m 644 lib/libpthread.so $(PREFIX)$(DEVEL_PREFIX)lib/
427 endif
428 endif
429 endif
430 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
431 $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \
432 $(PREFIX)$(DEVEL_PREFIX)lib/libthread_db.so
433 endif
434 ifeq ($(DOPIC),y)
435 # # If we build shared libraries then the static libs are PIC...
436 # # Make _pic.a symlinks to make mklibs.py and similar tools happy.
437 if [ -d lib ] ; then \
438 for i in `find lib/ -type f -name 'lib*.a' | $(SED) -e 's/lib\///'` ; do \
439 $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)lib/`echo $$i \
440 | $(SED) -e 's/\.a$$/_pic.a/'`; \
441 done ; \
443 endif
444 endif
445 ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
446 for file in lib/lib*.gdb; do \
447 if test -f $$file; then \
448 $(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)lib; \
449 $(INSTALL) -m 755 `echo $$file | $(SED) 's/\.gdb$$//'` \
450 $(PREFIX)$(DEVEL_PREFIX)lib; \
451 fi; \
452 done
453 endif
455 # Installs run-time libraries
456 install_runtime: all
457 ifeq ($(HAVE_SHARED),y)
458 $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)lib
459 $(INSTALL) -m 644 lib/lib*-$(VERSION).so \
460 $(PREFIX)$(RUNTIME_PREFIX)lib
461 (cd lib && $(TAR) -cf - *.so.*) | $(TAR) -xf - -C $(PREFIX)$(RUNTIME_PREFIX)lib
462 @if [ -x lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so ] ; then \
463 set -e; \
464 $(SHELL_SET_X); \
465 $(INSTALL) -m 755 lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so \
466 $(PREFIX)$(RUNTIME_PREFIX)lib; \
468 endif
470 utils:
471 $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils
473 # Installs helper applications, such as 'ldd' and 'ldconfig'
474 install_utils: utils
475 $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils utils_install
477 endif # ifeq ($(HAVE_DOT_CONFIG),y)
479 hostutils:
480 $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" -C utils hostutils
482 install_hostutils: hostutils
483 $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils utils_install DOTHOST=.host
485 include/bits include/config:
486 @$(disp_mkdir)
487 $(Q)$(INSTALL) -d $@
489 # configuration
490 # ---------------------------------------------------------------------------
491 extra/config/conf extra/config/mconf: | include/config
492 $(Q)$(MAKE) -C extra/config $(notdir $@)
494 menuconfig: extra/config/mconf
495 $(Q)./extra/config/mconf extra/Configs/Config.in
497 config: extra/config/conf
498 $(Q)./extra/config/conf extra/Configs/Config.in
500 oldconfig: extra/config/conf
501 $(Q)./extra/config/conf -o extra/Configs/Config.in
503 silentoldconfig: extra/config/conf
504 $(Q)./extra/config/conf -s extra/Configs/Config.in
506 randconfig: extra/config/conf
507 $(Q)./extra/config/conf -r extra/Configs/Config.in
509 allyesconfig: extra/config/conf
510 $(Q)./extra/config/conf -y extra/Configs/Config.in
511 $(SED) -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" .config
512 $(SED) -i -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" .config
513 $(SED) -i -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" .config
514 $(SED) -i -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" .config
515 $(SED) -i -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" .config
516 $(Q)./extra/config/conf -o extra/Configs/Config.in
518 allnoconfig: extra/config/conf
519 $(Q)./extra/config/conf -n extra/Configs/Config.in
521 defconfig: extra/config/conf
522 $(Q)./extra/config/conf -d extra/Configs/Config.in \
523 -D extra/Configs/defconfigs/$(ARCH)
525 include_clean:
526 $(Q)$(RM) include/fpu_control.h include/dl-osinfo.h include/hp-timing.h
527 @set -e; \
528 for i in `(cd libc/sysdeps/linux/common/sys; ls *.h)` ; do \
529 $(RM) include/sys/$$i; \
530 done; \
531 if [ -d libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
532 for i in `(cd libc/sysdeps/linux/$(TARGET_ARCH)/sys; ls *.h)` ; do \
533 $(RM) include/sys/$$i; \
534 done; \
537 clean: include_clean
538 $(Q)$(RM) -r lib include/bits
539 @$(MAKE) -C utils utils_clean
540 +$(MAKE) -s -C test clean
541 @$(RM) include/linux include/asm*
542 $(Q)$(RM) $(top_builddir)extra/scripts/unifdef
543 $(Q)$(RM) -r $(LOCAL_INSTALL_PATH)
545 distclean: clean
546 -find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\*.dep \) -exec $(RM) {} \;
547 $(RM) .config .config.old .config.cmd
548 $(RM) extra/locale/*.tgz
549 $(MAKE) -C extra/config distclean
551 dist release:
552 $(RM) -r ../uClibc-$(VERSION) ../uClibc-$(VERSION).tar.bz2
553 svn -q export . ../uClibc-$(VERSION)
554 $(TAR) cjf ../uClibc-$(VERSION).tar.bz2 -C .. uClibc-$(VERSION)
555 du -b ../uClibc-$(VERSION).tar.bz2
557 test check: test_compile
558 $(Q)$(MAKE) -C test
560 test_compile: $(LOCAL_INSTALL_PATH)
561 $(Q)$(MAKE) -C test compile