Makefile.in 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. #--------------------------------------------------------------
  8. # You shouldn't need to mess with anything beyond this point...
  9. #--------------------------------------------------------------
  10. clean_targets := clean realclean distclean \
  11. objclean-y headers_clean-y CLEAN_utils
  12. noconfig_targets := menuconfig config oldconfig silentoldconfig randconfig \
  13. defconfig allyesconfig allnoconfig \
  14. release dist tags help
  15. include $(top_srcdir)Rules.mak
  16. sub_headers := headers
  17. ifndef KCONFIG_CONFIG
  18. KCONFIG_CONFIG := $(top_builddir).config
  19. endif
  20. export KCONFIG_CONFIG
  21. ifeq ($(HAVE_DOT_CONFIG),y)
  22. all: pregen libs
  23. libs: pregen
  24. # In this section, we need .config
  25. -include $(top_builddir).config.cmd
  26. else # ifeq ($(HAVE_DOT_CONFIG),y)
  27. all: menuconfig
  28. headers:
  29. @echo "Need to make a config file first, run: make menuconfig"
  30. @false
  31. 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
  43. # last included to catch all the objects added by others (locales/threads)
  44. include $(top_srcdir)libc/Makefile.in
  45. conf := $(top_builddir)extra/config/conf
  46. mconf := $(top_builddir)extra/config/mconf
  47. ifeq ($(HAVE_DOT_CONFIG),y)
  48. # If the .config changes then we have to make sure that our includes are
  49. # updated properly. This would normally work by saying that the headers
  50. # have uClibc_config.h as prerequisite but since we _symlink_ the headers
  51. # and do not (?) want to rely on 'make -L' we better update them right here,
  52. # on spot to save us from alot of hazzle.
  53. $(top_builddir)include/bits/uClibc_config.h: $(conf) $(KCONFIG_CONFIG) $(top_srcdir)extra/scripts/conf-header.sh | $(top_builddir)include/bits $(top_builddir)include/config
  54. @$(disp_gen)
  55. $(Q)@$< -s $(top_srcdir)extra/Configs/Config.in
  56. $(Q)$(top_srcdir)extra/scripts/conf-header.sh $(KCONFIG_CONFIG) > $@
  57. $(Q)$(MAKE) headers-y
  58. # The above doesn't work for threads, though. Just using check-symlinks for now.
  59. # XXX: FIXME: this is ugly
  60. MAKEFLAGS += -L
  61. $(top_builddir)include/config/linuxthreads/old.h $(top_builddir)include/config/linuxthreads/new.h:
  62. @true
  63. # For the moment, we have to keep re-running this target
  64. # because the fix includes scripts rely on pre-processers
  65. # in order to generate the headers correctly :(. That
  66. # means we can't use the $(HOSTCC) in order to get the
  67. # correct output.
  68. ifeq ($(ARCH_USE_MMU),y)
  69. export header_extra_args =
  70. else
  71. export header_extra_args = -n
  72. endif
  73. HEADERS_BITS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/bits/*.h))
  74. HEADERS_BITS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h))
  75. HEADERS_BITS_SUBARCH :=
  76. ifneq ($(TARGET_SUBARCH),)
  77. HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h))
  78. endif
  79. HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH) $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_COMMON))
  80. HEADERS_SYS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/sys/*.h))
  81. HEADERS_SYS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h))
  82. HEADERS_SYS_COMMON := $(filter-out $(HEADERS_SYS_ARCH),$(HEADERS_SYS_COMMON))
  83. ALL_HEADERS_COMMON := $(top_builddir)include/fpu_control.h \
  84. $(top_builddir)include/dl-osinfo.h \
  85. $(top_builddir)include/hp-timing.h
  86. ALL_HEADERS_BITS_COMMON := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_COMMON))
  87. ALL_HEADERS_BITS_ARCH := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_ARCH))
  88. ifneq ($(TARGET_SUBARCH),)
  89. ALL_HEADERS_BITS_SUBARCH := $(addprefix $(top_builddir)include/bits/,$(HEADERS_BITS_SUBARCH))
  90. else
  91. ALL_HEADERS_BITS_SUBARCH :=
  92. endif
  93. ALL_HEADERS_SYS_COMMON := $(addprefix $(top_builddir)include/sys/,$(HEADERS_SYS_COMMON))
  94. ALL_HEADERS_SYS_ARCH := $(addprefix $(top_builddir)include/sys/,$(HEADERS_SYS_ARCH))
  95. target-headers-sysdep := \
  96. $(ALL_HEADERS_COMMON) \
  97. $(ALL_HEADERS_BITS_COMMON) \
  98. $(ALL_HEADERS_BITS_ARCH) \
  99. $(ALL_HEADERS_BITS_SUBARCH) \
  100. $(ALL_HEADERS_SYS_COMMON) \
  101. $(ALL_HEADERS_SYS_ARCH) \
  102. $(ALL_HEADERS_BITS_PTHREAD)
  103. $(top_builddir)include/fpu_control.h:
  104. @$(disp_ln)
  105. $(Q)[ -r $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) ] && \
  106. $(LN) -fs $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@ || \
  107. $(LN) -fs $(call rel_srcdir)libc/sysdeps/linux/common/$(@F) $@
  108. $(top_builddir)include/dl-osinfo.h $(top_builddir)include/hp-timing.h:
  109. $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/$(@F) $@
  110. $(ALL_HEADERS_BITS_COMMON):
  111. $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/bits/$(@F) $@
  112. $(ALL_HEADERS_BITS_ARCH):
  113. $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(@F) $@
  114. ifneq ($(TARGET_SUBARCH),)
  115. $(ALL_HEADERS_BITS_SUBARCH):
  116. $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/$(@F) $@
  117. endif
  118. ifneq ($(strip $(ALL_HEADERS_SYS_COMMON)),)
  119. $(ALL_HEADERS_SYS_COMMON):
  120. $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/common/sys/$(@F) $@
  121. endif
  122. ifneq ($(strip $(ALL_HEADERS_SYS_ARCH)),)
  123. $(ALL_HEADERS_SYS_ARCH):
  124. $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/$(@F) $@
  125. endif
  126. $(target-headers-sysdep) $(pregen-headers-y): | $(top_builddir)include/bits $(top_builddir)include/sys
  127. HEADERCLEAN_common:
  128. $(do_rm) $(ALL_HEADERS_COMMON)
  129. headers_clean-y += HEADERCLEAN_common
  130. # The headers. Arch specific headers are specified via ARCH_HEADERS in
  131. # libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch which appends those via
  132. # libc/sysdeps/linux/Makefile.commonarch to headers-y
  133. headers-y += $(target-headers-sysdep)
  134. headers: $(top_builddir)include/bits/uClibc_config.h | subdirs
  135. subdirs: $(addprefix $(top_builddir),$(subdirs))
  136. pregen-headers: $(top_builddir)include/bits/sysnum.h $(pregen-headers-y)
  137. pregen: headers pregen-headers
  138. $(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
  139. $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh | $(top_builddir)include/bits
  140. @$(disp_gen)
  141. $(Q)set -e; \
  142. tmp=`mktemp $(top_builddir)include/bits/sysnum.h.XXXXXX 2>/dev/null || true`; \
  143. [ -z "$$tmp" ] && tmp='$(top_builddir)include/bits/sysnum.h.new'; \
  144. KERNEL_HEADERS="${KERNEL_HEADERS}" top_builddir="$(top_builddir)" CC="$(CC) $(CPU_CFLAGS)" $(SHELL) $< > $$tmp; \
  145. if cmp $(top_builddir)include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \
  146. $(RM) $$tmp; \
  147. else \
  148. mv -f $$tmp $(top_builddir)include/bits/sysnum.h; \
  149. fi
  150. @# Ugly linux specific hack..
  151. $(Q)if grep -q __NR_ $@; then true; else \
  152. rm -f $@; \
  153. echo "ERROR: Could not generate syscalls."; \
  154. echo "Make sure that you have proper kernel headers."; \
  155. echo "Your .config in KERNEL_HEADERS=\"\" was set to:"; \
  156. echo "${KERNEL_HEADERS}"; \
  157. exit 1; \
  158. fi
  159. .PHONY: $(LOCAL_INSTALL_PATH)
  160. $(LOCAL_INSTALL_PATH):
  161. $(Q)$(MAKE) PREFIX=$(shell pwd)/$(LOCAL_INSTALL_PATH) RUNTIME_PREFIX=/ \
  162. DEVEL_PREFIX=/usr/ \
  163. HOSTCC="$(HOSTCC)" \
  164. install
  165. install: install_runtime install_dev
  166. RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)$(MULTILIB_DIR) $(RUNTIME_PREFIX)$(MULTILIB_DIR))
  167. startfiles: $(crt-y)
  168. $(top_builddir)extra/scripts/unifdef: |$(top_builddir)extra/scripts
  169. $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c
  170. $(hcompile.u)
  171. # Installs header files.
  172. # a "y" here means the feature is enabled and so we should *not* rm it.
  173. # if the option expands to nothing though, we can punt the headers.
  174. HEADERS_RM- := \
  175. dl-osinfo.h \
  176. hp-timing.h \
  177. _lfs_64.h \
  178. bits/uClibc_arch_features.h \
  179. bits/kernel_sigaction.h \
  180. bits/kernel_stat.h \
  181. bits/kernel_types.h \
  182. bits/syscalls.h \
  183. bits/syscalls-common.h \
  184. bits/uClibc_fpmax.h \
  185. bits/uClibc_uintmaxtostr.h \
  186. bits/uClibc_uwchar.h \
  187. bits/uClibc_va_copy.h \
  188. bits/sigcontextinfo.h \
  189. bits/stackinfo.h \
  190. tls.h \
  191. rpc/des_crypt.h \
  192. rpc/key_prot.h \
  193. rpc/rpc_des.h
  194. ifeq ($(UCLIBC_STRICT_HEADERS),y)
  195. HEADERS_RM- += sgtty.h
  196. endif
  197. HEADERS_RM-$(HAVE_SHARED) += dlfcn.h bits/dlfcn.h
  198. HEADERS_RM-$(PTHREADS_DEBUG_SUPPORT) += thread_db.h
  199. HEADERS_RM-$(UCLIBC_HAS_BSD_ERR) += err.h
  200. HEADERS_RM-$(UCLIBC_HAS_CRYPT) += crypt.h
  201. HEADERS_RM-$(UCLIBC_HAS_EPOLL) += sys/epoll.h
  202. HEADERS_RM-$(UCLIBC_HAS_FENV) += fenv.h bits/fenv.h bits/fenvinline.h
  203. HEADERS_RM-$(UCLIBC_HAS_FLOATS) += complex.h fpu_control.h ieee754.h \
  204. math.h \
  205. tgmath.h \
  206. bits/math*.h
  207. HEADERS_RM-$(findstring y,$(UCLIBC_HAS_FTW)$(UCLIBC_HAS_NFTW)) += ftw.h
  208. HEADERS_RM-$(UCLIBC_HAS_FTS) += fts.h
  209. HEADERS_RM-$(UCLIBC_HAS_GETTEXT_AWARENESS) += libintl.h
  210. HEADERS_RM-$(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF) += printf.h
  211. HEADERS_RM-$(UCLIBC_HAS_GLOB) += glob.h
  212. HEADERS_RM-$(UCLIBC_HAS_GNU_ERROR) += error.h
  213. HEADERS_RM-$(UCLIBC_HAS_GNU_GETOPT)$(UCLIBC_HAS_GETOPT_LONG) += getopt.h
  214. HEADERS_RM-$(UCLIBC_HAS_IPV6) += netinet/ip6.h netinet/icmp6.h
  215. HEADERS_RM-$(UCLIBC_HAS_BACKTRACE) += execinfo.h
  216. HEADERS_RM-$(UCLIBC_HAS_LOCALE) += iconv.h bits/uClibc_ctype.h
  217. HEADERS_RM-$(UCLIBC_HAS_PTY) += pty.h
  218. HEADERS_RM-$(UCLIBC_HAS_REALTIME) += mqueue.h bits/mqueue.h sched.h \
  219. bits/sched.h \
  220. semaphore.h
  221. HEADERS_RM-$(UCLIBC_HAS_REGEX) += regex.h regexp.h
  222. HEADERS_RM-$(UCLIBC_HAS_RPC) += rpc
  223. HEADERS_RM-$(UCLIBC_HAS_SHADOW) += shadow.h
  224. HEADERS_RM-$(UCLIBC_HAS_SOCKET) += sys/socket.h bits/socket.h sys/socketvar.h
  225. HEADERS_RM-$(UCLIBC_HAS_SYSLOG) += syslog.h sys/syslog.h bits/syslog*.h
  226. HEADERS_RM-$(UCLIBC_HAS_THREADS) += *thread*.h semaphore.h \
  227. bits/*thread*.h \
  228. bits/initspin.h
  229. HEADERS_RM-$(UCLIBC_HAS_THREADS_NATIVE) += atomic.h bits/atomic.h
  230. HEADERS_RM-$(UCLIBC_HAS_UTMPX) += bits/utmpx.h utmpx.h
  231. HEADERS_RM-$(UCLIBC_HAS_WCHAR) += wchar.h wctype.h
  232. HEADERS_RM-$(UCLIBC_HAS_WORDEXP) += wordexp.h
  233. HEADERS_RM-$(UCLIBC_HAS_XATTR) += sys/xattr.h
  234. HEADERS_RM-$(UCLIBC_HAS_XLOCALE) += xlocale.h
  235. HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC) += sys/eventfd.h sys/fsuid.h \
  236. sys/inotify.h \
  237. sys/kdaemon.h \
  238. sys/perm.h \
  239. sys/personality.h \
  240. sys/prctl.h \
  241. sys/reboot.h \
  242. sys/sendfile.h \
  243. sys/signalfd.h \
  244. bits/statfs.h \
  245. sys/statfs.h \
  246. sys/swap.h \
  247. sys/sysctl.h \
  248. sys/sysinfo.h \
  249. sys/timerfd.h \
  250. sys/vfs.h
  251. HEADERS_RM-$(UCLIBC_SUPPORT_AI_ADDRCONFIG) += ifaddrs.h
  252. HEADERS_RM-$(UCLIBC_SV4_DEPRECATED) += ustat.h sys/ustat.h bits/ustat.h
  253. HEADERS_RM-$(UCLIBC_SUSV3_LEGACY) += sys/timeb.h regexp.h
  254. HEADERS_RM-$(UCLIBC_SUSV4_LEGACY) += utime.h ucontext.h
  255. ifneq ($(findstring install,$(MAKECMDGOALS)),)
  256. $(addprefix $(PREFIX)$(DEVEL_PREFIX),include $(MULTILIB_DIR)):
  257. $(do_mkdir)
  258. # avoid warning about duplicate targets in rule or overrides
  259. ifneq ($(abspath $(RUNTIME_PREFIX)$(MULTILIB_DIR)),$(abspath $(DEVEL_PREFIX)$(MULTILIB_DIR)))
  260. $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR):
  261. $(do_mkdir)
  262. endif
  263. endif
  264. install_headers: headers $(top_builddir)extra/scripts/unifdef | $(PREFIX)$(DEVEL_PREFIX)include
  265. @$(call disp_install,"include -> $(PREFIX)$(DEVEL_PREFIX)include")
  266. $(Q)top_builddir=$(top_builddir) \
  267. $(top_srcdir)extra/scripts/install_headers.sh \
  268. include $(PREFIX)$(DEVEL_PREFIX)include
  269. ifneq ($(O),) # only run this step in O is set i.e. make O=/my/builddir/ ..
  270. @$(call disp_install,"$(top_builddir)/include -> $(PREFIX)$(DEVEL_PREFIX)include")
  271. $(Q)top_builddir=$(top_builddir) \
  272. $(top_srcdir)extra/scripts/install_headers.sh \
  273. $(top_builddir)/include $(PREFIX)$(DEVEL_PREFIX)include
  274. endif
  275. $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -r $(HEADERS_RM-)
  276. ifeq ($(UCLIBC_HAS_WCHAR),)
  277. $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && mv -f wchar-stub.h wchar.h
  278. else
  279. $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -f wchar-stub.h
  280. endif
  281. # Installs startfiles
  282. install_startfiles: startfiles | $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)
  283. -$(INSTALL) -m 644 $(startfiles) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
  284. # Installs development library links.
  285. install_dev: install_headers install_runtime install_startfiles | $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)
  286. -$(INSTALL) -m 644 $(top_builddir)lib/*.a $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
  287. ifeq ($(HAVE_SHARED),y)
  288. for i in `cd $(top_builddir) && find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
  289. $(SED) -e 's/lib\///'` ; do \
  290. $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(ABI_VERSION) \
  291. $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/$$i; \
  292. done
  293. ifeq ($(HARDWIRED_ABSPATH),y)
  294. if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME) ] ; then \
  295. $(RM) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
  296. $(SED) -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)$(MULTILIB_DIR)/$(NONSHARED_LIBNAME):' \
  297. -e 's:$(SHARED_LIBNAME):$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME):' \
  298. -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(UCLIBC_LDSO):' \
  299. $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
  300. $(SED) -i -e 's://:/:g' $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
  301. fi
  302. else
  303. -$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
  304. endif
  305. ifeq ($(UCLIBC_HAS_BACKTRACE),y)
  306. # Add the AS_NEEDED entry for libubacktrace.so
  307. if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_LIBNAME) ] ; then \
  308. echo "GROUP ( $(UBACKTRACE_ASNEEDED) )" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
  309. fi
  310. endif
  311. ifeq ($(UCLIBC_HAS_THREADS),y)
  312. ifneq ($(LINUXTHREADS_OLD),y)
  313. ifeq ($(HARDWIRED_ABSPATH),y)
  314. if [ -f $(top_builddir)lib/libpthread.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/libpthread.so.$(ABI_VERSION) ] ; then \
  315. $(RM) $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
  316. cp $(top_srcdir)extra/scripts/format.lds $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
  317. echo "GROUP ( $(RUNTIME_PREFIX)$(MULTILIB_DIR)/libpthread.so.$(ABI_VERSION) $(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread_nonshared.a )" \
  318. >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
  319. $(SED) -i -e 's://:/:g' $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libpthread.so; \
  320. fi
  321. else
  322. -$(INSTALL) -m 755 $(top_builddir)lib/libpthread.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
  323. endif
  324. endif
  325. endif
  326. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  327. $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \
  328. $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libthread_db.so
  329. endif
  330. ifeq ($(DOPIC),y)
  331. # # If we build shared libraries then the static libs are PIC...
  332. # # Make _pic.a symlinks to make mklibs.py and similar tools happy.
  333. if [ -d $(top_builddir)lib ] ; then \
  334. for i in `cd $(top_builddir) && find lib/ -type f -name 'lib*.a' | $(SED) -e 's/lib\///'` ; do \
  335. $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/`echo $$i \
  336. | $(SED) -e 's/\.a$$/_pic.a/'`; \
  337. done ; \
  338. fi
  339. endif
  340. endif
  341. ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
  342. for file in $(top_builddir)lib/lib*.gdb; do \
  343. if test -f $$file; then \
  344. $(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR); \
  345. $(INSTALL) -m 755 `echo $$file | $(SED) 's/\.gdb$$//'` \
  346. $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR); \
  347. fi; \
  348. done
  349. endif
  350. # Installs run-time libraries
  351. install_runtime: all | $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
  352. ifeq ($(HAVE_SHARED),y)
  353. $(INSTALL) -m 755 $(top_builddir)lib/lib*-$(VERSION).so \
  354. $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
  355. (cd $(top_builddir)lib && $(TAR) -cf - *.so.*) | $(TAR) -xf - -C $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)
  356. @if [ -x $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so ] ; then \
  357. set -e; \
  358. $(SHELL_SET_X); \
  359. $(INSTALL) -m 755 $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so \
  360. $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR); \
  361. fi
  362. endif
  363. utils: | pregen
  364. $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils $@
  365. # Installs helper applications, such as 'ldd' and 'ldconfig'
  366. install_utils: utils
  367. $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils utils_install
  368. endif # ifeq ($(HAVE_DOT_CONFIG),y)
  369. hostutils: | pregen
  370. $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@
  371. install_hostutils: hostutils
  372. $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils utils_install
  373. $(addprefix $(top_builddir),include include/bits include/sys include/config lib extra/config/lxdialog extra/locale extra/scripts $(subdirs)):
  374. $(do_mkdir)
  375. # configuration
  376. # ---------------------------------------------------------------------------
  377. $(conf) $(mconf): | $(top_builddir)include/config $(top_builddir)extra/config/lxdialog
  378. $(Q)$(MAKE) -C extra/config $(@F)
  379. arch-defconfigs := $(notdir $(wildcard $(top_srcdir)extra/Configs/defconfigs/$(ARCH)/*_defconfig))
  380. menuconfig: $(mconf)
  381. $(Q)$< extra/Configs/Config.in
  382. config: $(conf)
  383. $(Q)$< extra/Configs/Config.in
  384. oldconfig: $(conf)
  385. $(Q)$< -o extra/Configs/Config.in
  386. silentoldconfig: $(conf)
  387. $(Q)$< -s extra/Configs/Config.in
  388. randconfig: $(conf)
  389. $(Q)$< -r extra/Configs/Config.in
  390. allyesconfig: $(conf)
  391. $(Q)$< -y extra/Configs/Config.in
  392. $(SED) -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" \
  393. -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" \
  394. -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" \
  395. -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" \
  396. -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" \
  397. $(KCONFIG_CONFIG)
  398. $(Q)$< -o extra/Configs/Config.in
  399. allnoconfig: $(conf)
  400. $(Q)$< -n extra/Configs/Config.in
  401. defconfig: $(conf)
  402. $(Q)$< -D extra/Configs/defconfigs/$(ARCH)/$@ extra/Configs/Config.in
  403. %_defconfig: $(conf)
  404. $(Q)$< -D extra/Configs/defconfigs/$(ARCH)/$@ extra/Configs/Config.in
  405. menuconfig-clean-y:
  406. $(Q)$(MAKE) -C extra/config CLEAN_extra/config
  407. include_clean:
  408. $(Q)$(RM) $(top_builddir)include/fpu_control.h $(top_builddir)include/dl-osinfo.h $(top_builddir)include/hp-timing.h
  409. @set -e; \
  410. for i in `(cd libc/sysdeps/linux/common/sys; ls *.h)` ; do \
  411. $(RM) $(top_builddir)include/sys/$$i; \
  412. done; \
  413. if [ -d libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
  414. for i in `(cd libc/sysdeps/linux/$(TARGET_ARCH)/sys; ls *.h)` ; do \
  415. $(RM) $(top_builddir)include/sys/$$i; \
  416. done; \
  417. fi
  418. clean: include_clean
  419. $(Q)$(RM) -r $(top_builddir)lib $(top_builddir)include/bits
  420. @$(MAKE) -C utils CLEAN_utils
  421. +$(MAKE) -s -C test clean
  422. @$(RM) $(top_builddir)include/linux $(top_builddir)include/asm*
  423. $(Q)$(RM) $(top_builddir)extra/scripts/unifdef
  424. $(Q)$(RM) -r $(LOCAL_INSTALL_PATH)
  425. distclean: clean
  426. -find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\*.dep \) -exec $(RM) {} \;
  427. $(RM) $(top_builddir).config $(top_builddir).config.old $(top_builddir).config.cmd
  428. $(RM) $(top_builddir)extra/locale/*.tgz
  429. $(MAKE) -C extra/config distclean
  430. dist release:
  431. $(RM) ../uClibc-$(VERSION).tar
  432. git archive --format=tar --prefix=uClibc-$(VERSION)/ HEAD \
  433. > ../uClibc-$(VERSION).tar
  434. cat ../uClibc-$(VERSION).tar | bzip2 -c9 > ../uClibc-$(VERSION).tar.bz2
  435. cat ../uClibc-$(VERSION).tar | xz -e -c8 > ../uClibc-$(VERSION).tar.xz
  436. du -b ../uClibc-$(VERSION).tar.{bz2,xz}
  437. test check: test_compile
  438. $(Q)$(MAKE) -C test
  439. test_compile: $(LOCAL_INSTALL_PATH)
  440. $(Q)$(MAKE) -C test compile