Makefile.in 20 KB

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