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