metag: use generic lowlevellock
[uclibc-ng.git] / Makefile.in
blob59656853e057c923b1057ff4ff871a15090e32a6
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 include $(top_srcdir)Rules.mak
12 sub_headers := headers
14 ifeq ($(HAVE_DOT_CONFIG),y)
16 all: pregen libs startfiles
17 libs: pregen
19 # In this section, we need .config
20 -include $(top_builddir).config.cmd
22 else # ifeq ($(HAVE_DOT_CONFIG),y)
24 all: menuconfig
26 headers:
27 @echo "Need to make a config file first, run: make menuconfig"
28 @false
30 endif # ifeq ($(HAVE_DOT_CONFIG),y)
32 include $(top_srcdir)extra/locale/Makefile.in
33 include $(top_srcdir)ldso/Makefile.in
34 include $(top_srcdir)libcrypt/Makefile.in
35 include $(top_srcdir)libintl/Makefile.in
36 include $(top_srcdir)libm/Makefile.in
37 include $(top_srcdir)libnsl/Makefile.in
38 include $(top_srcdir)libresolv/Makefile.in
39 include $(top_srcdir)libutil/Makefile.in
40 include $(top_srcdir)libpthread/Makefile.in
41 include $(top_srcdir)librt/Makefile.in
42 include $(top_srcdir)libuargp/Makefile.in
43 include $(top_srcdir)libubacktrace/Makefile.in
45 # last included to catch all the objects added by others (locales/threads)
46 include $(top_srcdir)libc/Makefile.in
48 conf := $(top_builddir)extra/config/conf
49 mconf := $(top_builddir)extra/config/mconf
50 nconf := $(top_builddir)extra/config/nconf
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 $(top_builddir)include/bits/uClibc_config.h: $(conf) $(KCONFIG_CONFIG) $(top_srcdir)extra/scripts/conf-header.sh | $(top_builddir)include/bits
59 @$(disp_gen)
60 $(Q)$< -s $(Kconfig)
61 $(Q)$(top_srcdir)extra/scripts/conf-header.sh $(KCONFIG_CONFIG) > $@.tmp
62 $(Q)$(MAKE) headers-y
63 $(Q)mv $@.tmp $@
65 # The above doesn't work for threads, though. Just using check-symlinks for now.
66 # XXX: FIXME: this is ugly
67 MAKEFLAGS += -L
69 $(top_builddir)include/config/linuxthreads/old.h $(top_builddir)include/config/linuxthreads/new.h:
70 @true
72 $(top_builddir)include/generated/unifdef_config.h: $(top_builddir)include/bits/uClibc_config.h | $(top_builddir)include/generated
73 @$(disp_gen)
74 $(Q)$(SED) -e '1,3d' $^ > $@
76 # For the moment, we have to keep re-running this target
77 # because the fix includes scripts rely on pre-processers
78 # in order to generate the headers correctly :(. That
79 # means we can't use the $(HOSTCC) in order to get the
80 # correct output.
81 ifeq ($(ARCH_USE_MMU),y)
82 export header_extra_args =
83 else
84 export header_extra_args = -n
85 endif
86 HEADERS_BITS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/bits/*.h))
87 ifneq ($(ARCH_HAS_DEPRECATED_SYSCALLS),y)
88 HEADERS_BITS_COMMON_NO_LEGACY := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common-generic/bits/*.h))
89 HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_COMMON_NO_LEGACY),$(HEADERS_BITS_COMMON))
90 ALL_HEADERS_BITS_COMMON_NO_LEGACY := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_COMMON_NO_LEGACY))
91 endif
93 HEADERS_BITS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h))
94 HEADERS_BITS_SUBARCH :=
95 ifneq ($(TARGET_SUBARCH),)
96 HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h))
97 endif
98 ifneq ($(HEADERS_BITS_PTHREAD),)
99 HEADERS_BITS_ARCH := $(filter-out $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_ARCH))
100 HEADERS_BITS_SUBARCH:= $(filter-out $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_SUBARCH))
101 endif
102 HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH) $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_COMMON))
104 HEADERS_SYS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/sys/*.h))
105 HEADERS_SYS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h))
106 HEADERS_SYS_COMMON := $(filter-out $(HEADERS_SYS_ARCH),$(HEADERS_SYS_COMMON))
108 ALL_HEADERS_COMMON := $(top_builddir)include/fpu_control.h \
109 $(top_builddir)include/jmpbuf-offsets.h \
110 $(top_builddir)include/jmpbuf-unwind.h \
111 $(top_builddir)include/dl-osinfo.h \
112 $(top_builddir)include/hp-timing.h \
113 $(top_builddir)include/not-cancel.h
114 ALL_HEADERS_BITS_COMMON := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_COMMON))
115 ALL_HEADERS_BITS_ARCH := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_ARCH))
116 ifneq ($(TARGET_SUBARCH),)
117 ALL_HEADERS_BITS_SUBARCH := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_SUBARCH))
118 else
119 ALL_HEADERS_BITS_SUBARCH :=
120 endif
121 ALL_HEADERS_SYS_COMMON := $(addprefix $(top_builddir)include/sys/,$(HEADERS_SYS_COMMON))
122 ALL_HEADERS_SYS_ARCH := $(addprefix $(top_builddir)include/sys/,$(HEADERS_SYS_ARCH))
124 target-headers-sysdep := \
125 $(ALL_HEADERS_COMMON) \
126 $(ALL_HEADERS_BITS_COMMON) \
127 $(ALL_HEADERS_BITS_ARCH) \
128 $(ALL_HEADERS_BITS_SUBARCH) \
129 $(ALL_HEADERS_SYS_COMMON) \
130 $(ALL_HEADERS_SYS_ARCH) \
131 $(ALL_HEADERS_BITS_PTHREAD)
133 ifneq ($(ARCH_HAS_DEPRECATED_SYSCALLS),y)
134 target-headers-sysdep += $(ALL_HEADERS_BITS_COMMON_NO_LEGACY)
135 endif
137 $(top_builddir)include/fpu_control.h $(top_builddir)include/jmpbuf-offsets.h $(top_builddir)include/jmpbuf-unwind.h:
138 @$(disp_ln)
139 $(Q)[ -r $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) ] && \
140 $(LN) -fs $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@ || \
141 $(LN) -fs $(call rel_srcdir)libc/sysdeps/linux/common/$(@F) $@
143 $(top_builddir)include/dl-osinfo.h $(top_builddir)include/hp-timing.h $(top_builddir)include/not-cancel.h:
144 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/$(@F) $@
146 $(ALL_HEADERS_BITS_COMMON):
147 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/bits/$(@F) $@
149 $(ALL_HEADERS_BITS_ARCH):
150 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(@F) $@
152 ifneq ($(ARCH_HAS_DEPRECATED_SYSCALLS),y)
153 $(ALL_HEADERS_BITS_COMMON_NO_LEGACY):
154 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common-generic/bits/$(@F) $@
155 endif
157 ifneq ($(TARGET_SUBARCH),)
158 $(ALL_HEADERS_BITS_SUBARCH):
159 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/$(@F) $@
160 endif
162 ifneq ($(strip $(ALL_HEADERS_SYS_COMMON)),)
163 $(ALL_HEADERS_SYS_COMMON):
164 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/sys/$(@F) $@
165 endif
167 ifneq ($(strip $(ALL_HEADERS_SYS_ARCH)),)
168 $(ALL_HEADERS_SYS_ARCH):
169 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/$(@F) $@
170 endif
172 $(target-headers-sysdep) $(pregen-headers-y): | $(top_builddir)include/bits $(top_builddir)include/sys $(top_builddir)include/bits/sysnum.h
174 HEADERCLEAN_common:
175 $(do_rm) $(ALL_HEADERS_COMMON)
176 headers_clean-y += HEADERCLEAN_common
177 HEADERCLEAN_config:
178 $(do_rm) -r $(addprefix $(top_builddir)include/,config generated)
179 menuconfig-clean-y: HEADERCLEAN_config
181 # The headers. Arch specific headers are specified via ARCH_HEADERS in
182 # libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch which appends those via
183 # libc/sysdeps/linux/Makefile.commonarch to headers-y
184 headers-y += $(target-headers-sysdep)
186 headers: $(top_builddir)include/bits/uClibc_config.h | subdirs
187 $(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
189 subdirs: $(addprefix $(top_builddir),$(subdirs))
191 $(pregen-headers-y): $(headers_dep)
192 pregen: headers $(pregen-headers-y) $(headers_dep)
194 $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh | $(top_builddir)include/bits
195 @$(disp_gen)
196 $(Q)set -e; \
197 KERNEL_HEADERS="${KERNEL_HEADERS}" CC="$(CC) $(CPU_CFLAGS)" $(SHELL) $< > $@.new; \
198 cmp -s $@ $@.new && $(RM) $@.new || mv -f $@.new $@
199 @# Ugly linux specific hack..
200 $(Q)if grep -q __NR_ $@; then true; else \
201 rm -f $@; \
202 echo "ERROR: Could not generate syscalls."; \
203 echo "Make sure that you have properly installed kernel headers."; \
204 echo "Your .config KERNEL_HEADERS=\"\" was set to:"; \
205 echo "${KERNEL_HEADERS}"; \
206 exit 1; \
209 .PHONY: $(LOCAL_INSTALL_PATH)
210 $(LOCAL_INSTALL_PATH):
211 $(Q)$(MAKE) PREFIX=$(LOCAL_INSTALL_PATH) \
212 RUNTIME_PREFIX=/ \
213 DEVEL_PREFIX=/usr/ \
214 HOSTCC="$(HOSTCC)" \
215 install
217 install: install_runtime install_dev
220 RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)$(MULTILIB_DIR) $(RUNTIME_PREFIX)$(MULTILIB_DIR))
222 $(top_builddir)extra/scripts/unifdef: |$(top_builddir)extra/scripts
223 $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c
224 $(hcompile.u)
226 # Installs header files.
227 # a "y" here means the feature is enabled and so we should *not* rm it.
228 # if the option expands to nothing though, we can punt the headers.
229 HEADERS_RM- := \
230 config \
231 generated \
232 internal \
233 cancel.h \
234 dl-osinfo.h \
235 jmpbuf-offsets.h \
236 jmpbuf-unwind.h \
237 hp-timing.h \
238 not-cancel.h \
239 _lfs_64.h \
240 bits/uClibc_arch_features.h \
241 bits/kernel_sigaction.h \
242 bits/kernel_stat.h \
243 bits/kernel_types.h \
244 bits/libc-lock.h \
245 bits/stdio-lock.h \
246 bits/syscalls.h \
247 bits/syscalls-common.h \
248 bits/uClibc_fpmax.h \
249 bits/uClibc_mutex.h \
250 bits/uClibc_pthread.h \
251 bits/uClibc_uintmaxtostr.h \
252 bits/uClibc_uwchar.h \
253 bits/uClibc_va_copy.h \
254 bits/sigcontextinfo.h \
255 bits/stackinfo.h \
256 atomic.h \
257 bits/atomic.h \
258 tls.h \
259 rpc/des_crypt.h \
260 rpc/key_prot.h \
261 rpc/rpc_des.h
262 ifeq ($(UCLIBC_STRICT_HEADERS),y)
263 HEADERS_RM- += sgtty.h
264 endif
265 HEADERS_RM-$(HAVE_SHARED) += dlfcn.h bits/dlfcn.h
266 HEADERS_RM-$(PTHREADS_DEBUG_SUPPORT) += thread_db.h
267 HEADERS_RM-$(UCLIBC_HAS_ARGP) += argp.h
268 HEADERS_RM-$(UCLIBC_HAS_BSD_ERR) += err.h
269 HEADERS_RM-$(UCLIBC_HAS_CRYPT) += crypt.h
270 HEADERS_RM-$(UCLIBC_HAS_EPOLL) += sys/epoll.h
271 HEADERS_RM-$(UCLIBC_HAS_FENV) += fenv.h bits/fenv.h bits/fenvinline.h
272 HEADERS_RM-$(UCLIBC_HAS_FLOATS) += complex.h fpu_control.h ieee754.h \
273 math.h \
274 tgmath.h \
275 bits/math*.h
276 HEADERS_RM-$(findstring y,$(UCLIBC_HAS_FTW)$(UCLIBC_HAS_NFTW)) += ftw.h
277 HEADERS_RM-$(UCLIBC_HAS_FTS) += fts.h
278 HEADERS_RM-$(UCLIBC_HAS_GETTEXT_AWARENESS) += libintl.h
279 HEADERS_RM-$(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF) += printf.h
280 HEADERS_RM-$(UCLIBC_HAS_GLOB) += glob.h
281 HEADERS_RM-$(UCLIBC_HAS_GNU_ERROR) += error.h
282 HEADERS_RM-$(UCLIBC_HAS_GETOPT_LONG) += getopt.h
283 HEADERS_RM-$(UCLIBC_HAS_IPV6) += netinet/ip6.h netinet/icmp6.h
284 HEADERS_RM-$(UCLIBC_HAS_BACKTRACE) += execinfo.h
285 HEADERS_RM-$(UCLIBC_HAS_LOCALE) += iconv.h bits/uClibc_ctype.h
286 HEADERS_RM-$(UCLIBC_HAS_PTY) += pty.h
287 HEADERS_RM-$(UCLIBC_HAS_REALTIME) += mqueue.h bits/mqueue.h sched.h \
288 bits/sched.h \
289 semaphore.h
290 HEADERS_RM-$(UCLIBC_HAS_REGEX) += regex.h regexp.h
291 HEADERS_RM-$(UCLIBC_HAS_RPC) += rpc
292 HEADERS_RM-$(UCLIBC_HAS_SHADOW) += shadow.h
293 HEADERS_RM-$(UCLIBC_HAS_SOCKET) += sys/socket.h bits/socket.h sys/socketvar.h bits/socket_type.h
294 HEADERS_RM-$(UCLIBC_HAS_SYSLOG) += syslog.h sys/syslog.h bits/syslog*.h
295 HEADERS_RM-$(UCLIBC_HAS_THREADS) += *thread*.h semaphore.h \
296 bits/*thread*.h \
297 bits/initspin.h
298 HEADERS_RM-$(UCLIBC_HAS_THREADS_NATIVE) += atomic.h bits/atomic.h
299 HEADERS_RM-$(UCLIBC_HAS_OBSTACK) += obstack.h
300 HEADERS_RM-$(UCLIBC_HAS_UTMP) += bits/utmp.h utmp.h
301 HEADERS_RM-$(UCLIBC_HAS_UTMPX) += bits/utmpx.h utmpx.h
302 HEADERS_RM-$(UCLIBC_HAS_WCHAR) += wchar.h wctype.h
303 HEADERS_RM-$(UCLIBC_HAS_WORDEXP) += wordexp.h
304 HEADERS_RM-$(UCLIBC_HAS_XATTR) += sys/xattr.h
305 HEADERS_RM-$(UCLIBC_HAS_XLOCALE) += xlocale.h
306 HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC) += \
307 sys/cachectl.h \
308 bits/eventfd.h \
309 sys/eventfd.h \
310 sys/fsuid.h \
311 bits/inotify.h \
312 sys/inotify.h \
313 sys/kdaemon.h \
314 sys/perm.h \
315 sys/personality.h \
316 sys/prctl.h \
317 sys/random.h \
318 sys/reboot.h \
319 sys/sendfile.h \
320 bits/signalfd.h \
321 sys/signalfd.h \
322 bits/statfs.h \
323 sys/statfs.h \
324 sys/swap.h \
325 sys/sysctl.h \
326 sys/sysinfo.h \
327 bits/timerfd.h \
328 sys/timerfd.h \
329 sys/sysmips.h \
330 sys/vfs.h
331 HEADERS_RM-$(UCLIBC_SUPPORT_AI_ADDRCONFIG) += ifaddrs.h
332 HEADERS_RM-$(UCLIBC_SV4_DEPRECATED) += ustat.h sys/ustat.h bits/ustat.h
333 HEADERS_RM-$(UCLIBC_SUSV3_LEGACY) += sys/timeb.h regexp.h
334 HEADERS_RM-$(UCLIBC_SUSV4_LEGACY) += utime.h ucontext.h
335 HEADERS_RM-$(UCLIBC_HAS_ADVANCED_REALTIME) += spawn.h
337 ifneq ($(findstring install,$(MAKECMDGOALS)),)
338 $(addprefix $(PREFIX)$(DEVEL_PREFIX),include $(MULTILIB_DIR)):
339 $(do_mkdir)
340 # avoid warning about duplicate targets in rule or overrides
341 ifneq ($(abspath $(RUNTIME_PREFIX)$(MULTILIB_DIR)),$(abspath $(DEVEL_PREFIX)$(MULTILIB_DIR)))
342 $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR):
343 $(do_mkdir)
344 endif
345 endif
348 install_headers: headers $(top_builddir)extra/scripts/unifdef $(top_builddir)include/generated/unifdef_config.h | $(PREFIX)$(DEVEL_PREFIX)include
349 @$(call disp_install,"include -> $(PREFIX)$(DEVEL_PREFIX)include")
350 $(Q)top_builddir=$(top_builddir) \
351 $(top_srcdir)extra/scripts/install_headers.sh \
352 include $(PREFIX)$(DEVEL_PREFIX)include
353 ifneq ($(O),) # only run this step in O is set i.e. make O=/my/builddir/ ..
354 @$(call disp_install,"$(top_builddir)/include -> $(PREFIX)$(DEVEL_PREFIX)include")
355 $(Q)top_builddir=$(top_builddir) \
356 $(top_srcdir)extra/scripts/install_headers.sh \
357 $(top_builddir)/include $(PREFIX)$(DEVEL_PREFIX)include
358 endif
359 $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -r $(HEADERS_RM-)
360 ifeq ($(UCLIBC_HAS_WCHAR),)
361 $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && mv -f wchar-stub.h wchar.h
362 else
363 $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -f wchar-stub.h
364 endif
366 # Installs startfiles
367 install_startfiles: startfiles | $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)
368 -$(INSTALL) -m 644 $(startfiles) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
370 # Installs development library links.
371 install_dev: install_headers install_runtime install_startfiles | $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)
372 -$(INSTALL) -m 644 $(top_builddir)lib/*.a $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
373 ifeq ($(HAVE_SHARED),y)
374 for i in `cd $(top_builddir) && find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
375 $(SED) -e 's/lib\///'` ; do \
376 $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(ABI_VERSION) \
377 $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/$$i; \
378 done
379 ifeq ($(HARDWIRED_ABSPATH),y)
380 if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME) ] ; then \
381 $(RM) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
382 $(SED) -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)$(MULTILIB_DIR)/$(NONSHARED_LIBNAME):' \
383 -e 's:$(SHARED_LIBNAME):$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME):' \
384 -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(UCLIBC_LDSO):' \
385 $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
386 $(SED) -i -e 's://:/:g' $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
388 else
389 -$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
390 endif
391 echo "$(UBACKTRACE_ASNEEDED)" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so
392 ifeq ($(UCLIBC_HAS_ARGP),y)
393 # Add the AS_NEEDED entry for libuargp.so
394 if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_MAJORNAME) ] ; then \
395 echo "GROUP ( $(UARGP_ASNEEDED) )" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
397 endif
399 ifeq ($(UCLIBC_HAS_THREADS),y)
400 ifneq ($(UCLIBC_HAS_LINUXTHREADS),y)
401 ifeq ($(HARDWIRED_ABSPATH),y)
402 if [ -f $(top_builddir)lib/libpthread.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/libpthread.so.$(ABI_VERSION) ] ; then \
403 $(RM) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
404 cp $(top_srcdir)extra/scripts/format.lds $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
405 echo "GROUP ( $(RUNTIME_PREFIX)$(MULTILIB_DIR)/libpthread.so.$(ABI_VERSION) $(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread_nonshared.a )" \
406 >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
407 $(SED) -i -e 's://:/:g' $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
409 else
410 -$(INSTALL) -m 755 $(top_builddir)lib/libpthread.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
411 endif
412 endif
413 endif
414 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
415 $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \
416 $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libthread_db.so
417 endif
418 ifeq ($(DOPIC),y)
419 # # If we build shared libraries then the static libs are PIC...
420 # # Make _pic.a symlinks to make mklibs.py and similar tools happy.
421 if [ -d $(top_builddir)lib ] ; then \
422 for i in `cd $(top_builddir) && find lib/ -type f -name 'lib*.a' | $(SED) -e 's/lib\///'` ; do \
423 $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/`echo $$i \
424 | $(SED) -e 's/\.a$$/_pic.a/'`; \
425 done ; \
427 endif
428 endif
429 ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
430 for file in $(top_builddir)lib/lib*.gdb; do \
431 if test -f $$file; then \
432 $(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR); \
433 $(INSTALL) -m 755 `echo $$file | $(SED) 's/\.gdb$$//'` \
434 $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR); \
435 fi; \
436 done
437 endif
439 # Installs run-time libraries
440 install_runtime: all | $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
441 ifeq ($(HAVE_SHARED),y)
442 $(INSTALL) -m 755 $(top_builddir)lib/lib*-$(VERSION).so \
443 $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
444 (cd $(top_builddir)lib && $(TAR) --exclude=$(UCLIBC_LDSO_NAME).so.lds -cf - *.so.*) \
445 | $(TAR) -xf - -C $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
446 @if [ -x $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so ] ; then \
447 set -e; \
448 $(SHELL_SET_X); \
449 $(INSTALL) -m 755 $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so \
450 $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR); \
452 endif
454 utils: | pregen
455 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" -C utils $@
457 # Installs helper applications, such as 'ldd' and 'ldconfig'
458 install_utils: utils
459 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" -C utils utils_install
461 endif # ifeq ($(HAVE_DOT_CONFIG),y)
463 hostutils: | pregen
464 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@
466 install_hostutils: hostutils
467 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils utils_install
469 $(addprefix $(top_builddir),include include/bits include/sys include/config include/generated lib extra/config/lxdialog extra/locale extra/scripts $(subdirs)):
470 $(do_mkdir)
472 # configuration
473 # ---------------------------------------------------------------------------
474 $(conf) $(mconf) $(nconf): | $(top_builddir)include/config $(top_builddir)include/generated $(top_builddir)extra/config/lxdialog
475 $(Q)$(MAKE) -C extra/config $(@F)
477 arch-defconfigs := $(notdir $(wildcard $(top_srcdir)extra/Configs/defconfigs/$(ARCH)/*_defconfig))
479 menuconfig: $(mconf)
480 $(Q)$< $(Kconfig)
481 config: $(conf)
482 $(Q)$< $(Kconfig)
483 nconfig: $(nconf)
484 $(Q)$< $(Kconfig)
486 oldaskconfig: $(conf)
487 $(Q)$< -a $(Kconfig)
488 silentoldconfig: $(conf)
489 $(Q)$< -s $(Kconfig)
490 oldconfig: $(conf)
491 $(Q)$< -o $(Kconfig)
492 allnoconfig: $(conf)
493 $(Q)$< -n $(Kconfig)
494 allyesconfig: $(conf)
495 $(Q)$< -y $(Kconfig)
496 $(SED) -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" \
497 -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" \
498 -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" \
499 -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" \
500 $(KCONFIG_CONFIG)
501 $(Q)$< -o $(Kconfig)
502 alldefconfig: $(conf)
503 $(Q)$< -A $(Kconfig)
504 randconfig: $(conf)
505 $(Q)$< -r $(Kconfig)
507 cmd_defconfig = $(Q)$< -D extra/Configs/defconfigs/$(ARCH)/$@ $(Kconfig)
508 defconfig: $(conf) ; $(cmd_defconfig)
509 %_defconfig: $(conf) ; $(cmd_defconfig)
511 savedefconfig: $(conf)
512 $(Q)$< -S defconfig $(Kconfig)
513 listnewconfig: $(conf)
514 $(Q)$< -l $(Kconfig)
515 olddefconfig: $(conf)
516 $(Q)$< -d $(Kconfig)
518 menuconfig-clean-y:
519 $(Q)$(MAKE) -C extra/config CLEAN_extra/config
521 # The find here should continue to work as long as we are only symlinking
522 # headers in to include/. I don't see this changing to anything else, so
523 # it should be fine.
524 include_clean:
525 $(SECHO) " CLEAN include"
526 $(Q)$(RM) -r $(top_builddir)include/bits
527 $(Q)find $(top_builddir)include/ -type l -exec rm -f {} +
529 clean: include_clean
530 $(Q)$(RM) -r $(top_builddir)lib
531 @$(MAKE) -C utils CLEAN_utils
532 +$(MAKE) -s -C test clean
533 $(Q)$(RM) $(top_builddir)extra/scripts/unifdef
534 $(Q)$(RM) -r $(LOCAL_INSTALL_PATH)
536 distclean: realclean
537 -find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\*.dep \) -exec $(RM) {} \;
538 $(RM) $(top_builddir).config $(top_builddir).config.old $(top_builddir).config.cmd
539 $(Q)$(RM) $(top_builddir)extra/locale/*.tgz
540 @$(MAKE) -C extra/config distclean
542 dist release:
543 $(RM) ../uClibc-$(VERSION).tar
544 git archive --format=tar --prefix=uClibc-$(VERSION)/ HEAD \
545 > ../uClibc-$(VERSION).tar
546 cat ../uClibc-$(VERSION).tar | bzip2 -c9 > ../uClibc-$(VERSION).tar.bz2
547 cat ../uClibc-$(VERSION).tar | xz -e -c8 > ../uClibc-$(VERSION).tar.xz
548 du -b ../uClibc-$(VERSION).tar.{bz2,xz}
550 test check: test_compile
551 $(Q)$(MAKE) -C test \
552 $(if $(O),top_builddir=$(O)/)
554 test_compile: $(LOCAL_INSTALL_PATH)
555 $(Q)$(MAKE) -C test compile \
556 $(if $(O),top_builddir=$(O)/)
558 test_gen: $(LOCAL_INSTALL_PATH)
559 $(Q)$(MAKE) -C test gen \
560 $(if $(O),top_builddir=$(O)/)