remove misc/gnu, cleanup comment
[uclibc-ng.git] / Makefile.in
blob9acf76c844abf5c3e7c9123f3767b4be5b91a2de
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)libm/Makefile.in
36 include $(top_srcdir)libutil/Makefile.in
37 include $(top_srcdir)libpthread/Makefile.in
38 include $(top_srcdir)librt/Makefile.in
39 include $(top_srcdir)libuargp/Makefile.in
40 include $(top_srcdir)libubacktrace/Makefile.in
41 include $(top_srcdir)libiconv/Makefile.in
42 include $(top_srcdir)libintl/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) > $@.tmp
61 $(Q)$(MAKE) headers-y
62 $(Q)mv $@.tmp $@
64 # The above doesn't work for threads, though. Just using check-symlinks for now.
65 # XXX: FIXME: this is ugly
66 MAKEFLAGS += -L
68 $(top_builddir)include/config/linuxthreads/old.h $(top_builddir)include/config/linuxthreads/new.h:
69 @true
71 $(top_builddir)include/generated/unifdef_config.h: $(top_builddir)include/bits/uClibc_config.h | $(top_builddir)include/generated
72 @$(disp_gen)
73 $(Q)$(SED) -e '1,3d' $^ > $@
75 # For the moment, we have to keep re-running this target
76 # because the fix includes scripts rely on pre-processers
77 # in order to generate the headers correctly :(. That
78 # means we can't use the $(HOSTCC) in order to get the
79 # correct output.
80 ifeq ($(ARCH_USE_MMU),y)
81 export header_extra_args =
82 else
83 export header_extra_args = -n
84 endif
85 HEADERS_BITS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/bits/*.h))
86 ifneq ($(ARCH_HAS_DEPRECATED_SYSCALLS),y)
87 HEADERS_BITS_COMMON_NO_LEGACY := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common-generic/bits/*.h))
88 HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_COMMON_NO_LEGACY),$(HEADERS_BITS_COMMON))
89 ALL_HEADERS_BITS_COMMON_NO_LEGACY := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_COMMON_NO_LEGACY))
90 endif
92 HEADERS_BITS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h))
93 HEADERS_BITS_SUBARCH :=
94 ifneq ($(TARGET_SUBARCH),)
95 HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h))
96 endif
97 ifneq ($(HEADERS_BITS_PTHREAD),)
98 HEADERS_BITS_ARCH := $(filter-out $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_ARCH))
99 HEADERS_BITS_SUBARCH:= $(filter-out $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_SUBARCH))
100 endif
101 HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH) $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_COMMON))
103 HEADERS_SYS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/sys/*.h))
104 HEADERS_SYS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h))
105 HEADERS_SYS_COMMON := $(filter-out $(HEADERS_SYS_ARCH),$(HEADERS_SYS_COMMON))
107 ALL_HEADERS_COMMON := $(top_builddir)include/fpu_control.h \
108 $(top_builddir)include/jmpbuf-offsets.h \
109 $(top_builddir)include/jmpbuf-unwind.h \
110 $(top_builddir)include/dl-osinfo.h \
111 $(top_builddir)include/hp-timing.h \
112 $(top_builddir)include/not-cancel.h
113 ALL_HEADERS_BITS_COMMON := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_COMMON))
114 ALL_HEADERS_BITS_ARCH := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_ARCH))
115 ifneq ($(TARGET_SUBARCH),)
116 ALL_HEADERS_BITS_SUBARCH := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_SUBARCH))
117 else
118 ALL_HEADERS_BITS_SUBARCH :=
119 endif
120 ALL_HEADERS_SYS_COMMON := $(addprefix $(top_builddir)include/sys/,$(HEADERS_SYS_COMMON))
121 ALL_HEADERS_SYS_ARCH := $(addprefix $(top_builddir)include/sys/,$(HEADERS_SYS_ARCH))
123 target-headers-sysdep := \
124 $(ALL_HEADERS_COMMON) \
125 $(ALL_HEADERS_BITS_COMMON) \
126 $(ALL_HEADERS_BITS_ARCH) \
127 $(ALL_HEADERS_BITS_SUBARCH) \
128 $(ALL_HEADERS_SYS_COMMON) \
129 $(ALL_HEADERS_SYS_ARCH) \
130 $(ALL_HEADERS_BITS_PTHREAD)
132 ifneq ($(ARCH_HAS_DEPRECATED_SYSCALLS),y)
133 target-headers-sysdep += $(ALL_HEADERS_BITS_COMMON_NO_LEGACY)
134 endif
136 $(top_builddir)include/fpu_control.h $(top_builddir)include/jmpbuf-offsets.h $(top_builddir)include/jmpbuf-unwind.h:
137 @$(disp_ln)
138 $(Q)[ -r $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) ] && \
139 $(LN) -fs $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@ || \
140 $(LN) -fs $(call rel_srcdir)libc/sysdeps/linux/common/$(@F) $@
142 $(top_builddir)include/dl-osinfo.h $(top_builddir)include/hp-timing.h $(top_builddir)include/not-cancel.h:
143 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/$(@F) $@
145 $(ALL_HEADERS_BITS_COMMON):
146 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/bits/$(@F) $@
148 $(ALL_HEADERS_BITS_ARCH):
149 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(@F) $@
151 ifneq ($(ARCH_HAS_DEPRECATED_SYSCALLS),y)
152 $(ALL_HEADERS_BITS_COMMON_NO_LEGACY):
153 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common-generic/bits/$(@F) $@
154 endif
156 ifneq ($(TARGET_SUBARCH),)
157 $(ALL_HEADERS_BITS_SUBARCH):
158 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/$(@F) $@
159 endif
161 ifneq ($(strip $(ALL_HEADERS_SYS_COMMON)),)
162 $(ALL_HEADERS_SYS_COMMON):
163 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/sys/$(@F) $@
164 endif
166 ifneq ($(strip $(ALL_HEADERS_SYS_ARCH)),)
167 $(ALL_HEADERS_SYS_ARCH):
168 $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/$(@F) $@
169 endif
171 $(target-headers-sysdep) $(pregen-headers-y): | $(top_builddir)include/bits $(top_builddir)include/sys $(top_builddir)include/bits/sysnum.h
173 HEADERCLEAN_common:
174 $(do_rm) $(ALL_HEADERS_COMMON)
175 headers_clean-y += HEADERCLEAN_common
176 HEADERCLEAN_config:
177 $(do_rm) -r $(addprefix $(top_builddir)include/,config generated)
178 menuconfig-clean-y: HEADERCLEAN_config
180 # The headers. Arch specific headers are specified via ARCH_HEADERS in
181 # libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch which appends those via
182 # libc/sysdeps/linux/Makefile.commonarch to headers-y
183 headers-y += $(target-headers-sysdep)
185 headers: $(top_builddir)include/bits/uClibc_config.h | subdirs $(top_builddir)extra/locale
186 $(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
188 subdirs: $(addprefix $(top_builddir),$(subdirs))
190 $(pregen-headers-y): $(headers_dep)
191 pregen: headers $(pregen-headers-y) $(headers_dep)
193 $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh | $(top_builddir)include/bits
194 @$(disp_gen)
195 $(Q)set -e; \
196 KERNEL_HEADERS="${KERNEL_HEADERS}" CC="$(CC) $(CPU_CFLAGS)" $(SHELL) $< > $@.new; \
197 cmp -s $@ $@.new && $(RM) $@.new || mv -f $@.new $@
198 @# Ugly linux specific hack..
199 $(Q)if grep -q __NR_ $@; then true; else \
200 rm -f $@; \
201 echo "ERROR: Could not generate syscalls."; \
202 echo "Make sure that you have properly installed kernel headers."; \
203 echo "Your .config KERNEL_HEADERS=\"\" was set to:"; \
204 echo "${KERNEL_HEADERS}"; \
205 exit 1; \
208 .PHONY: $(LOCAL_INSTALL_PATH)
209 $(LOCAL_INSTALL_PATH):
210 $(Q)$(MAKE) PREFIX=$(LOCAL_INSTALL_PATH) \
211 RUNTIME_PREFIX=/ \
212 DEVEL_PREFIX=/usr/ \
213 HOSTCC="$(HOSTCC)" \
214 install
216 install: install_runtime install_dev
219 RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)$(MULTILIB_DIR) $(RUNTIME_PREFIX)$(MULTILIB_DIR))
221 $(top_builddir)extra/scripts/unifdef: |$(top_builddir)extra/scripts
222 $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c
223 $(hcompile.u)
225 # Installs header files.
226 # a "y" here means the feature is enabled and so we should *not* rm it.
227 # if the option expands to nothing though, we can punt the headers.
228 HEADERS_RM- := \
229 config \
230 generated \
231 internal \
232 cancel.h \
233 dl-osinfo.h \
234 jmpbuf-offsets.h \
235 jmpbuf-unwind.h \
236 hp-timing.h \
237 not-cancel.h \
238 _lfs_64.h \
239 bits/uClibc_arch_features.h \
240 bits/kernel_sigaction.h \
241 bits/kernel_stat.h \
242 bits/kernel_types.h \
243 bits/libc-lock.h \
244 bits/stdio-lock.h \
245 bits/syscalls.h \
246 bits/syscalls-common.h \
247 bits/uClibc_fpmax.h \
248 bits/uClibc_mutex.h \
249 bits/uClibc_pthread.h \
250 bits/uClibc_uintmaxtostr.h \
251 bits/uClibc_uwchar.h \
252 bits/uClibc_va_copy.h \
253 bits/sigcontextinfo.h \
254 bits/stackinfo.h \
255 atomic.h \
256 bits/atomic.h \
257 tls.h \
258 rpc/des_crypt.h \
259 rpc/key_prot.h \
260 rpc/rpc_des.h
261 ifeq ($(UCLIBC_STRICT_HEADERS),y)
262 HEADERS_RM- += sgtty.h
263 endif
264 HEADERS_RM-$(HAVE_SHARED) += dlfcn.h bits/dlfcn.h
265 HEADERS_RM-$(PTHREADS_DEBUG_SUPPORT) += thread_db.h
266 HEADERS_RM-$(UCLIBC_HAS_ARGP) += argp.h
267 HEADERS_RM-$(UCLIBC_HAS_BSD_ERR) += err.h
268 HEADERS_RM-$(UCLIBC_HAS_CRYPT) += crypt.h
269 HEADERS_RM-$(UCLIBC_HAS_EPOLL) += sys/epoll.h
270 HEADERS_RM-$(UCLIBC_HAS_FENV) += fenv.h bits/fenv.h bits/fenvinline.h
271 HEADERS_RM-$(UCLIBC_HAS_FLOATS) += complex.h fpu_control.h ieee754.h \
272 math.h \
273 tgmath.h \
274 bits/math*.h
275 HEADERS_RM-$(findstring y,$(UCLIBC_HAS_FTW)$(UCLIBC_HAS_NFTW)) += ftw.h
276 HEADERS_RM-$(UCLIBC_HAS_FTS) += fts.h
277 HEADERS_RM-$(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF) += printf.h
278 HEADERS_RM-$(UCLIBC_HAS_GLOB) += glob.h
279 HEADERS_RM-$(UCLIBC_HAS_GNU_ERROR) += error.h
280 HEADERS_RM-$(UCLIBC_HAS_GETOPT_LONG) += getopt.h
281 HEADERS_RM-$(UCLIBC_HAS_IPV6) += netinet/ip6.h netinet/icmp6.h
282 HEADERS_RM-$(UCLIBC_HAS_BACKTRACE) += execinfo.h
283 HEADERS_RM-$(UCLIBC_HAS_LIBICONV) += iconv.h
284 HEADERS_RM-$(UCLIBC_HAS_LIBINTL) += intl.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_UTMP) += bits/utmp.h utmp.h
300 HEADERS_RM-$(UCLIBC_HAS_UTMPX) += bits/utmpx.h utmpx.h
301 HEADERS_RM-$(UCLIBC_HAS_WCHAR) += wchar.h wctype.h
302 HEADERS_RM-$(UCLIBC_HAS_WORDEXP) += wordexp.h
303 HEADERS_RM-$(UCLIBC_HAS_XATTR) += sys/xattr.h
304 HEADERS_RM-$(UCLIBC_HAS_XLOCALE) += xlocale.h
305 HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC) += \
306 sys/cachectl.h \
307 bits/eventfd.h \
308 sys/eventfd.h \
309 sys/fsuid.h \
310 bits/inotify.h \
311 sys/inotify.h \
312 sys/kdaemon.h \
313 sys/perm.h \
314 sys/personality.h \
315 sys/prctl.h \
316 sys/random.h \
317 sys/reboot.h \
318 sys/sendfile.h \
319 bits/signalfd.h \
320 sys/signalfd.h \
321 bits/statfs.h \
322 sys/statfs.h \
323 sys/swap.h \
324 sys/sysctl.h \
325 sys/sysinfo.h \
326 bits/timerfd.h \
327 sys/timerfd.h \
328 sys/sysmips.h \
329 sys/vfs.h
330 HEADERS_RM-$(UCLIBC_SUPPORT_AI_ADDRCONFIG) += ifaddrs.h
331 HEADERS_RM-$(UCLIBC_SV4_DEPRECATED) += ustat.h sys/ustat.h bits/ustat.h
332 HEADERS_RM-$(UCLIBC_SUSV3_LEGACY) += sys/timeb.h regexp.h
333 HEADERS_RM-$(UCLIBC_SUSV4_LEGACY) += utime.h ucontext.h
334 HEADERS_RM-$(UCLIBC_HAS_ADVANCED_REALTIME) += spawn.h
336 ifneq ($(findstring install,$(MAKECMDGOALS)),)
337 $(addprefix $(PREFIX)$(DEVEL_PREFIX),include $(MULTILIB_DIR)):
338 $(do_mkdir)
339 # avoid warning about duplicate targets in rule or overrides
340 ifneq ($(abspath $(RUNTIME_PREFIX)$(MULTILIB_DIR)),$(abspath $(DEVEL_PREFIX)$(MULTILIB_DIR)))
341 $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR):
342 $(do_mkdir)
343 endif
344 endif
347 install_headers: headers $(top_builddir)extra/scripts/unifdef $(top_builddir)include/generated/unifdef_config.h | $(PREFIX)$(DEVEL_PREFIX)include
348 @$(call disp_install,"include -> $(PREFIX)$(DEVEL_PREFIX)include")
349 $(Q)top_builddir=$(top_builddir) \
350 $(top_srcdir)extra/scripts/install_headers.sh \
351 include $(PREFIX)$(DEVEL_PREFIX)include
352 ifneq ($(O),) # only run this step in O is set i.e. make O=/my/builddir/ ..
353 @$(call disp_install,"$(top_builddir)/include -> $(PREFIX)$(DEVEL_PREFIX)include")
354 $(Q)top_builddir=$(top_builddir) \
355 $(top_srcdir)extra/scripts/install_headers.sh \
356 $(top_builddir)/include $(PREFIX)$(DEVEL_PREFIX)include
357 endif
358 $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -r $(HEADERS_RM-)
359 ifeq ($(UCLIBC_HAS_WCHAR),)
360 $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && mv -f wchar-stub.h wchar.h
361 else
362 $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -f wchar-stub.h
363 endif
365 EMPTY_LIB_NAMES = dl nsl resolv
366 ifeq ($(DO_C99_MATH),y)
367 EMPTY_LIB_NAMES += m
368 endif
369 ifeq ($(UCLIBC_HAS_THREADS),y)
370 EMPTY_LIB_NAMES += pthread
371 endif
372 ifeq ($(UCLIBC_HAS_REALTIME),y)
373 EMPTY_LIB_NAMES += rt
374 endif
375 ifeq ($(UCLIBC_HAS_CRYPT),y)
376 EMPTY_LIB_NAMES += crypt
377 endif
378 ifeq ($(UCLIBC_HAS_LIBUTIL),y)
379 EMPTY_LIB_NAMES += util
380 endif
381 ifeq ($(UCLIBC_HAS_LIBICONV),y)
382 EMPTY_LIB_NAMES += iconv
383 endif
384 ifeq ($(UCLIBC_HAS_LIBINTL),y)
385 EMPTY_LIB_NAMES += intl
386 endif
387 EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
389 $(EMPTY_LIBS):
390 rm -f $(top_builddir)$@
391 $(AR) rc $(top_builddir)$@
393 # Installs startfiles
394 install_startfiles: startfiles | $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)
395 -$(INSTALL) -m 644 $(startfiles) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
397 # Installs development library links.
398 install_dev: install_headers install_runtime install_startfiles $(EMPTY_LIBS) | $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)
399 -$(INSTALL) -m 644 $(top_builddir)lib/*.a $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
400 ifeq ($(HAVE_SHARED),y)
401 for i in `cd $(top_builddir) && find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
402 $(SED) -e 's/lib\///'` ; do \
403 $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(ABI_VERSION) \
404 $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/$$i; \
405 done
406 ifeq ($(HARDWIRED_ABSPATH),y)
407 if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME) ] ; then \
408 $(RM) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
409 $(SED) -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)$(MULTILIB_DIR)/$(NONSHARED_LIBNAME):' \
410 -e 's:$(SHARED_LIBNAME):$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME):' \
411 -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(UCLIBC_LDSO):' \
412 $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
413 $(SED) -i -e 's://:/:g' $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
415 else
416 -$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
417 endif
418 echo "$(UBACKTRACE_ASNEEDED)" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so
420 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
421 $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \
422 $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libthread_db.so
423 endif
424 ifeq ($(DOPIC),y)
425 # # If we build shared libraries then the static libs are PIC...
426 # # Make _pic.a symlinks to make mklibs.py and similar tools happy.
427 if [ -d $(top_builddir)lib ] ; then \
428 for i in `cd $(top_builddir) && find lib/ -type f -name 'lib*.a' | $(SED) -e 's/lib\///'` ; do \
429 $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/`echo $$i \
430 | $(SED) -e 's/\.a$$/_pic.a/'`; \
431 done ; \
433 endif
434 endif
435 ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
436 for file in $(top_builddir)lib/lib*.gdb; do \
437 if test -f $$file; then \
438 $(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR); \
439 $(INSTALL) -m 755 `echo $$file | $(SED) 's/\.gdb$$//'` \
440 $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR); \
441 fi; \
442 done
443 endif
445 # Installs run-time libraries
446 install_runtime: all | $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
447 ifeq ($(HAVE_SHARED),y)
448 $(INSTALL) -m 755 $(top_builddir)lib/lib*-$(VERSION).so \
449 $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
450 (cd $(top_builddir)lib && $(TAR) --exclude=$(UCLIBC_LDSO_NAME).so.lds -cf - *.so.*) \
451 | $(TAR) -xf - -C $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
452 @if [ -x $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so ] ; then \
453 set -e; \
454 $(SHELL_SET_X); \
455 $(INSTALL) -m 755 $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so \
456 $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR); \
458 endif
460 utils: | pregen
461 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" -C utils $@
463 # Installs helper applications, such as 'ldd' and 'ldconfig'
464 install_utils: utils
465 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" -C utils utils_install
467 endif # ifeq ($(HAVE_DOT_CONFIG),y)
469 hostutils: | pregen
470 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@
472 install_hostutils: hostutils
473 $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils utils_install
475 $(addprefix $(top_builddir),include include/bits include/sys include/config include/generated lib extra/config/lxdialog extra/locale extra/scripts $(subdirs)):
476 $(do_mkdir)
478 # configuration
479 # ---------------------------------------------------------------------------
480 $(conf) $(mconf) $(nconf): | $(top_builddir)include/config $(top_builddir)include/generated $(top_builddir)extra/config/lxdialog
481 $(Q)$(MAKE) -C extra/config $(@F)
483 arch-defconfigs := $(notdir $(wildcard $(top_srcdir)extra/Configs/defconfigs/$(ARCH)/*_defconfig))
485 menuconfig: $(mconf)
486 $(Q)$< $(Kconfig)
487 config: $(conf)
488 $(Q)$< $(Kconfig)
489 nconfig: $(nconf)
490 $(Q)$< $(Kconfig)
492 oldaskconfig: $(conf)
493 $(Q)$< -a $(Kconfig)
494 silentoldconfig: $(conf)
495 $(Q)$< -s $(Kconfig)
496 oldconfig: $(conf)
497 $(Q)$< -o $(Kconfig)
498 allnoconfig: $(conf)
499 $(Q)$< -n $(Kconfig)
500 allyesconfig: $(conf)
501 $(Q)$< -y $(Kconfig)
502 $(SED) -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" \
503 -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" \
504 -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" \
505 -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" \
506 $(KCONFIG_CONFIG)
507 $(Q)$< -o $(Kconfig)
508 alldefconfig: $(conf)
509 $(Q)$< -A $(Kconfig)
510 randconfig: $(conf)
511 $(Q)$< -r $(Kconfig)
513 cmd_defconfig = $(Q)$< -D extra/Configs/defconfigs/$(ARCH)/$@ $(Kconfig)
514 defconfig: $(conf) ; $(cmd_defconfig)
515 %_defconfig: $(conf) ; $(cmd_defconfig)
517 savedefconfig: $(conf)
518 $(Q)$< -S defconfig $(Kconfig)
519 listnewconfig: $(conf)
520 $(Q)$< -l $(Kconfig)
521 olddefconfig: $(conf)
522 $(Q)$< -d $(Kconfig)
524 menuconfig-clean-y:
525 $(Q)$(MAKE) -C extra/config CLEAN_extra/config
527 # The find here should continue to work as long as we are only symlinking
528 # headers in to include/. I don't see this changing to anything else, so
529 # it should be fine.
530 include_clean:
531 $(SECHO) " CLEAN include"
532 $(Q)$(RM) -r $(top_builddir)include/bits
533 $(Q)find $(top_builddir)include/ -type l -exec rm -f {} +
535 clean: include_clean
536 $(Q)$(RM) -r $(top_builddir)lib
537 @$(MAKE) -C utils CLEAN_utils
538 $(Q)$(RM) $(top_builddir)extra/scripts/unifdef
539 $(Q)$(RM) -r $(LOCAL_INSTALL_PATH)
541 distclean: realclean
542 -find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\*.dep \) -exec $(RM) {} \;
543 $(RM) $(top_builddir).config $(top_builddir).config.old $(top_builddir).config.cmd
544 $(Q)$(RM) $(top_builddir)extra/locale/*.tgz
545 @$(MAKE) -C extra/config distclean
547 dist release:
548 $(RM) ../uClibc-$(VERSION).tar
549 git archive --format=tar --prefix=uClibc-$(VERSION)/ HEAD \
550 > ../uClibc-$(VERSION).tar
551 cat ../uClibc-$(VERSION).tar | bzip2 -c9 > ../uClibc-$(VERSION).tar.bz2
552 cat ../uClibc-$(VERSION).tar | xz -e -c8 > ../uClibc-$(VERSION).tar.xz
553 du -b ../uClibc-$(VERSION).tar.{bz2,xz}