Makefile.in 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2005 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. noconfig_targets := menuconfig config oldconfig silentoldconfig randconfig \
  11. defconfig allyesconfig allnoconfig clean distclean \
  12. release dist tags
  13. include $(top_builddir)Rules.mak
  14. sub_headers := headers
  15. #suspicious_dependency:=include/bits
  16. ifeq ($(HAVE_DOT_CONFIG),y)
  17. all: pregen libs
  18. # In this section, we need .config
  19. -include .config.cmd
  20. include $(top_srcdir)ldso/Makefile.in
  21. include $(top_srcdir)libcrypt/Makefile.in
  22. include $(top_srcdir)libintl/Makefile.in
  23. include $(top_srcdir)libm/Makefile.in
  24. include $(top_srcdir)libnsl/Makefile.in
  25. include $(top_srcdir)libresolv/Makefile.in
  26. include $(top_srcdir)libutil/Makefile.in
  27. include $(top_srcdir)libpthread/Makefile.in
  28. include $(top_srcdir)librt/Makefile.in
  29. include $(top_srcdir)extra/locale/Makefile.in
  30. # last included to catch all the objects added by others (locales/threads)
  31. include $(top_srcdir)libc/Makefile.in
  32. # If the .config changes then we have to make sure that our includes are
  33. # updated properly. This would normally work by saying that the headers
  34. # have uClibc_config.h as prerequisite but since we _symlink_ the headers
  35. # and do not (?) want to rely on 'make -L' we better update them right here,
  36. # on spot to save us from alot of hazzle.
  37. include/bits/uClibc_config.h: extra/config/conf .config $(top_srcdir)extra/scripts/conf-header.sh | include/bits
  38. @$(disp_gen)
  39. @#superfluous: $(Q)$(INSTALL) -d $(dir $@)
  40. $(Q)@$< -s $(top_srcdir)extra/Configs/Config.in
  41. $(Q)$(top_srcdir)extra/scripts/conf-header.sh .config > $@
  42. $(Q)$(MAKE) headers-y
  43. # For the moment, we have to keep re-running this target
  44. # because the fix includes scripts rely on pre-processers
  45. # in order to generate the headers correctly :(. That
  46. # means we can't use the $(HOSTCC) in order to get the
  47. # correct output.
  48. ifeq ($(ARCH_USE_MMU),y)
  49. export header_extra_args =
  50. else
  51. export header_extra_args = -n
  52. endif
  53. HEADERS_BITS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/bits/*.h))
  54. HEADERS_BITS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h))
  55. HEADERS_BITS_SUBARCH :=
  56. ifneq ($(TARGET_SUBARCH),)
  57. HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h))
  58. endif
  59. HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH) $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_COMMON))
  60. HEADERS_SYS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/sys/*.h))
  61. HEADERS_SYS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h))
  62. HEADERS_SYS_COMMON := $(filter-out $(HEADERS_SYS_ARCH),$(HEADERS_SYS_COMMON))
  63. ALL_HEADERS_COMMON := include/fpu_control.h include/dl-osinfo.h \
  64. include/hp-timing.h
  65. ALL_HEADERS_BITS_COMMON := $(addprefix include/bits/,$(HEADERS_BITS_COMMON))
  66. ALL_HEADERS_BITS_ARCH := $(addprefix include/bits/,$(HEADERS_BITS_ARCH))
  67. ifneq ($(TARGET_SUBARCH),)
  68. ALL_HEADERS_BITS_SUBARCH := $(addprefix include/bits/,$(HEADERS_BITS_SUBARCH))
  69. else
  70. ALL_HEADERS_BITS_SUBARCH :=
  71. endif
  72. ALL_HEADERS_SYS_COMMON := $(addprefix include/sys/,$(HEADERS_SYS_COMMON))
  73. ALL_HEADERS_SYS_ARCH := $(addprefix include/sys/,$(HEADERS_SYS_ARCH))
  74. target-headers-sysdep := \
  75. $(ALL_HEADERS_COMMON) \
  76. $(ALL_HEADERS_BITS_COMMON) \
  77. $(ALL_HEADERS_BITS_ARCH) \
  78. $(ALL_HEADERS_BITS_SUBARCH) \
  79. $(ALL_HEADERS_SYS_COMMON) \
  80. $(ALL_HEADERS_SYS_ARCH)
  81. include/fpu_control.h:
  82. @$(disp_ln)
  83. $(Q)[ -r libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) ] && \
  84. $(LN) -fs ../libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@ || \
  85. $(LN) -fs ../libc/sysdeps/linux/common/$(@F) $@
  86. include/dl-osinfo.h include/hp-timing.h:
  87. $(do_ln) ../libc/sysdeps/linux/common/$(@F) $@
  88. $(ALL_HEADERS_BITS_COMMON):
  89. $(do_ln) ../../libc/sysdeps/linux/common/bits/$(@F) $@
  90. $(ALL_HEADERS_BITS_ARCH):
  91. $(do_ln) ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(@F) $@
  92. ifneq ($(TARGET_SUBARCH),)
  93. $(ALL_HEADERS_BITS_SUBARCH):
  94. $(do_ln) ../../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/$(@F) $@
  95. endif
  96. ifneq ($(strip $(ALL_HEADERS_SYS_COMMON)),)
  97. $(ALL_HEADERS_SYS_COMMON):
  98. $(do_ln) ../../libc/sysdeps/linux/common/sys/$(@F) $@
  99. endif
  100. ifneq ($(strip $(ALL_HEADERS_SYS_ARCH)),)
  101. $(ALL_HEADERS_SYS_ARCH):
  102. $(do_ln) ../../libc/sysdeps/linux/$(TARGET_ARCH)/sys/$(@F) $@
  103. endif
  104. $(target-headers-sysdep): | include/bits
  105. sysdep_common_headers-clean:
  106. $(RM) $(ALL_HEADERS_COMMON)
  107. headers_clean-y += sysdep_common_headers-clean
  108. # The headers. Arch specific headers are specified via ARCH_HEADERS in
  109. # libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch which appends those via
  110. # libc/sysdeps/linux/Makefile.commonarch to headers-y
  111. headers-y += $(target-headers-sysdep)
  112. headers: include/bits/uClibc_config.h
  113. pregen: include/bits/sysnum.h headers
  114. $(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
  115. include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh
  116. $(Q)$(INSTALL) -d $(@D)
  117. @$(disp_gen)
  118. $(Q)set -e; \
  119. cd $(top_builddir); \
  120. tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null`; \
  121. [ -z "$$tmp" ] && tmp='include/bits/sysnum.h.new'; \
  122. KERNEL_HEADERS="${KERNEL_HEADERS}" top_builddir=. CC="$(CC) $(CPU_CFLAGS)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \
  123. if cmp include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \
  124. $(RM) $$tmp; \
  125. else \
  126. mv -f $$tmp include/bits/sysnum.h; \
  127. fi
  128. $(LOCAL_INSTALL_PATH):
  129. $(Q)$(MAKE) PREFIX=$(shell pwd)/ RUNTIME_PREFIX=./ \
  130. DEVEL_PREFIX=$(LOCAL_INSTALL_PATH)/usr/ \
  131. HOSTCC="$(HOSTCC)" \
  132. install_kernel_headers
  133. $(Q)$(MAKE) PREFIX=$(shell pwd)/ RUNTIME_PREFIX=./ \
  134. DEVEL_PREFIX=$(LOCAL_INSTALL_PATH)/usr/ \
  135. HOSTCC="$(HOSTCC)" \
  136. install_dev
  137. install: install_runtime install_dev
  138. RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib)
  139. $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c
  140. $(hcompile.u)
  141. # Installs kernel header files (linux/*, asm/*, asm-generic/*).
  142. install_kernel_headers: headers
  143. top_builddir=$(top_builddir) \
  144. $(top_srcdir)extra/scripts/install_kernel_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include
  145. # Installs header files.
  146. install_headers: headers $(top_builddir)extra/scripts/unifdef
  147. $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  148. top_builddir=$(top_builddir) \
  149. $(top_srcdir)extra/scripts/install_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include
  150. printf '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' > \
  151. $(PREFIX)$(DEVEL_PREFIX)include/libc-internal.h
  152. echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
  153. $(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
  154. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h
  155. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/_lfs_64.h
  156. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_uintmaxtostr.h
  157. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/kernel_sigaction.h
  158. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/kernel_stat.h
  159. ifneq ($(UCLIBC_HAS_FLOATS),y)
  160. # Remove floating point related headers since float support is disabled.
  161. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/complex.h
  162. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fpu_control.h
  163. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ieee754.h
  164. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/math.h
  165. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tgmath.h
  166. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_fpmax.h
  167. endif
  168. ifneq ($(UCLIBC_HAS_FENV),y)
  169. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fenv.h \
  170. $(PREFIX)$(DEVEL_PREFIX)include/bits/fenv.h \
  171. $(PREFIX)$(DEVEL_PREFIX)include/bits/fenvinline.h
  172. endif
  173. ifneq ($(UCLIBC_HAS_WCHAR),y)
  174. # Remove wide char headers since wide char support is disabled.
  175. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wctype.h
  176. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wchar.h
  177. endif
  178. ifneq ($(UCLIBC_HAS_LOCALE),y)
  179. # Remove iconv header since locale support is disabled.
  180. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/iconv.h
  181. endif
  182. ifneq ($(UCLIBC_HAS_GLIBC_CUSTOM_PRINTF),y)
  183. # Remove printf header since custom print specifier support is disabled.
  184. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/printf.h
  185. endif
  186. ifneq ($(UCLIBC_HAS_XLOCALE),y)
  187. # Remove xlocale header since extended locale support is disabled.
  188. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/xlocale.h
  189. endif
  190. ifneq ($(UCLIBC_HAS_GETTEXT_AWARENESS),y)
  191. # Remove libintl header since gettext support is disabled.
  192. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/libintl.h
  193. endif
  194. ifneq ($(UCLIBC_HAS_REGEX),y)
  195. # Remove regex headers since regex support is disabled.
  196. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regex.h
  197. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regexp.h
  198. endif
  199. ifneq ($(UCLIBC_HAS_WORDEXP),y)
  200. # Remove wordexp header since wordexp support is disabled.
  201. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wordexp.h
  202. endif
  203. ifneq ($(UCLIBC_HAS_FTW),y)
  204. # Remove ftw header since ftw support is disabled.
  205. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ftw.h
  206. endif
  207. ifneq ($(UCLIBC_HAS_GLOB),y)
  208. # Remove glob header since glob support is disabled.
  209. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/glob.h
  210. endif
  211. ifneq ($(UCLIBC_HAS_GNU_GETOPT),y)
  212. ifneq ($(UCLIBC_HAS_GETOPT_LONG),y)
  213. # Remove getopt header since gnu getopt support is disabled.
  214. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/getopt.h
  215. endif
  216. endif
  217. ifneq ($(UCLIBC_HAS_SHADOW),y)
  218. # Remove shadow header since shadow password support is disabled.
  219. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/shadow.h
  220. endif
  221. ifneq ($(PTHREADS_DEBUG_SUPPORT),y)
  222. # Remove thread_db header since thread debug support is disabled.
  223. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/thread_db.h
  224. endif
  225. ifneq ($(UCLIBC_HAS_THREADS),y)
  226. # Remove pthread headers since thread support is disabled.
  227. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/*thread*.h
  228. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/semaphore.h
  229. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/*thread*.h
  230. endif
  231. ifneq ($(HAVE_SHARED),y)
  232. # Remove dlfcn header if we don't have shared libraries.
  233. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dlfcn.h
  234. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/dlfcn.h
  235. endif
  236. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  237. # Remove this as it is only used internally.
  238. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tls.h
  239. endif
  240. ifneq ($(UCLIBC_HAS_GNU_ERROR),y)
  241. # Remove error.h upon request
  242. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/error.h
  243. endif
  244. ifneq ($(UCLIBC_HAS_BSD_ERR),y)
  245. # Remove err.h upon request
  246. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/err.h
  247. endif
  248. ifneq ($(UCLIBC_SUSV3_LEGACY),y)
  249. # Remove timeb.h since the LEGACY ftime() was disabled upon request
  250. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/timeb.h
  251. endif
  252. ifneq ($(UCLIBC_HAS_EPOLL),y)
  253. # Remove epoll.h since epoll_*() were disabled upon request
  254. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/epoll.h
  255. endif
  256. ifneq ($(UCLIBC_HAS_XATTR),y)
  257. # Remove xattr.h since extended attributes were disabled upon request
  258. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/xattr.h
  259. endif
  260. ifneq ($(UCLIBC_HAS_PTY),y)
  261. # Remove pty.h since PTY support was disabled upon request
  262. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/pty.h
  263. endif
  264. ifneq ($(UCLIBC_LINUX_SPECIFIC),y)
  265. # Remove linux-specific headers as requested
  266. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/inotify.h
  267. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/perm.h
  268. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/personality.h
  269. endif
  270. ifneq ($(UCLIBC_SV4_DEPRECATED),y)
  271. # Remove ustat.h since deprecated SV4 support was disabled upon request
  272. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ustat.h
  273. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/ustat.h
  274. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/ustat.h
  275. endif
  276. ifeq ($(UCLIBC_HAS_REALTIME)$(UCLIBC_HAS_ADVANCED_REALTIME),)
  277. # Remove SUSv-realtime related message-queue headers upon request
  278. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/mqueue.h
  279. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/mqueue.h
  280. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/mqueue.h
  281. endif
  282. ifneq ($(UCLIBC_HAS_REALTIME),y)
  283. # Remove SUSv-realtime related headers upon request
  284. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sched.h
  285. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/sched.h
  286. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/sched.h
  287. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/semaphore.h
  288. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/semaphore.h
  289. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/semaphore.h
  290. endif
  291. ifneq ($(UCLIBC_HAS_SOCKET),y)
  292. # Remove socket related headers upon request
  293. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/socket.h
  294. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/socket.h
  295. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/socketvar.h
  296. endif
  297. ifneq ($(UCLIBC_HAS_CRYPT),y)
  298. # Remove crypt.h since libcrypt was disabled upon request
  299. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/crypt.h
  300. endif
  301. ifneq ($(UCLIBC_SUPPORT_AI_ADDRCONFIG),y)
  302. # Remove ifaddrs.h since the corresponding functionality is disabled
  303. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ifaddrs.h
  304. endif
  305. # Installs development library links.
  306. install_dev: install_headers
  307. $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  308. -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  309. ifeq ($(HAVE_SHARED),y)
  310. for i in `find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
  311. sed -e 's/lib\///'` ; do \
  312. $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(MAJOR_VERSION) \
  313. $(PREFIX)$(DEVEL_PREFIX)lib/$$i; \
  314. done
  315. if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \
  316. $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
  317. sed -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)lib/$(NONSHARED_LIBNAME):' \
  318. -e 's:$(SHARED_MAJORNAME):$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME):' \
  319. -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)lib/$(UCLIBC_LDSO):' \
  320. $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
  321. fi
  322. ifeq ($(UCLIBC_HAS_THREADS),y)
  323. ifneq ($(LINUXTHREADS_OLD),y)
  324. if [ -f $(top_builddir)lib/libpthread.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) ] ; then \
  325. $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
  326. cp $(top_srcdir)extra/scripts/format.lds $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
  327. echo "GROUP ( $(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) $(DEVEL_PREFIX)lib/libpthread_nonshared.a )" \
  328. >> $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \
  329. fi
  330. endif
  331. endif
  332. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  333. $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \
  334. $(PREFIX)$(DEVEL_PREFIX)lib/libthread_db.so
  335. endif
  336. ifeq ($(DOPIC),y)
  337. # # If we build shared libraries then the static libs are PIC...
  338. # # Make _pic.a symlinks to make mklibs.py and similar tools happy.
  339. if [ -d lib ] ; then \
  340. for i in `find lib/ -type f -name 'lib*.a' | sed -e 's/lib\///'` ; do \
  341. $(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)lib/`echo $$i \
  342. | sed -e 's/\.a$$/_pic.a/'`; \
  343. done ; \
  344. fi
  345. endif
  346. endif
  347. ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
  348. for file in lib/lib*.gdb; do \
  349. if test -f $$file; then \
  350. $(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)lib; \
  351. $(INSTALL) -m 755 `echo $$file | sed 's/\.gdb$$//'` \
  352. $(PREFIX)$(DEVEL_PREFIX)lib; \
  353. fi; \
  354. done
  355. endif
  356. # Installs run-time libraries
  357. install_runtime:
  358. ifeq ($(HAVE_SHARED),y)
  359. $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)lib
  360. $(INSTALL) -m 644 lib/lib*-$(VERSION).so \
  361. $(PREFIX)$(RUNTIME_PREFIX)lib
  362. cd lib && $(TAR) -cf - *.so.* | $(TAR) -xf - -C $(PREFIX)$(RUNTIME_PREFIX)lib
  363. @if [ -x lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so ] ; then \
  364. set -e; \
  365. $(SHELL_SET_X); \
  366. $(INSTALL) -m 755 lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so \
  367. $(PREFIX)$(RUNTIME_PREFIX)lib; \
  368. fi
  369. endif
  370. utils:
  371. $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils
  372. # Installs helper applications, such as 'ldd' and 'ldconfig'
  373. install_utils: utils
  374. $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils utils_install
  375. else # ifeq ($(HAVE_DOT_CONFIG),y)
  376. all: menuconfig
  377. headers:
  378. @echo "Need to make a config file first, run: make menuconfig"
  379. @false
  380. endif # ifeq ($(HAVE_DOT_CONFIG),y)
  381. include/bits:
  382. @$(disp_mkdir)
  383. $(Q)$(INSTALL) -d $@
  384. # configuration
  385. # ---------------------------------------------------------------------------
  386. extra/config/conf extra/config/mconf: $(suspicious_dependency)
  387. $(Q)$(MAKE) -C extra/config $(notdir $@)
  388. menuconfig: extra/config/mconf $(suspicious_dependency)
  389. $(Q)./extra/config/mconf extra/Configs/Config.in
  390. config: extra/config/conf $(suspicious_dependency)
  391. $(Q)./extra/config/conf extra/Configs/Config.in
  392. oldconfig: extra/config/conf $(suspicious_dependency)
  393. $(Q)./extra/config/conf -o extra/Configs/Config.in
  394. silentoldconfig: extra/config/conf $(suspicious_dependency)
  395. $(Q)./extra/config/conf -s extra/Configs/Config.in
  396. randconfig: extra/config/conf $(suspicious_dependency)
  397. $(Q)./extra/config/conf -r extra/Configs/Config.in
  398. allyesconfig: extra/config/conf $(suspicious_dependency)
  399. $(Q)./extra/config/conf -y extra/Configs/Config.in
  400. sed -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" .config
  401. sed -i -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" .config
  402. sed -i -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" .config
  403. sed -i -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" .config
  404. sed -i -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" .config
  405. $(Q)./extra/config/conf -o extra/Configs/Config.in
  406. allnoconfig: extra/config/conf $(suspicious_dependency)
  407. $(Q)./extra/config/conf -n extra/Configs/Config.in
  408. defconfig: extra/config/conf $(suspicious_dependency)
  409. $(Q)./extra/config/conf -d extra/Configs/Config.in \
  410. -D extra/Configs/defconfigs/$(ARCH)
  411. clean:
  412. $(Q)$(RM) -r lib include/bits
  413. $(RM) ldso/*/*.a libpthread/*/*.a libc/*.a libcrypt/*.a libintl/*.a \
  414. libm/*.a libnsl/*.a libpthread/*.a libresolv/*.a librt/*.a \
  415. libutil/*.a lib/*.a \
  416. include/fpu_control.h include/dl-osinfo.h include/hp-timing.h
  417. $(MAKE) objclean-y headers_clean-y
  418. $(MAKE) -s -C test clean
  419. $(MAKE) -C utils utils_clean
  420. @set -e; \
  421. for i in `(cd libc/sysdeps/linux/common/sys; ls *.h)` ; do \
  422. $(RM) include/sys/$$i; \
  423. done; \
  424. if [ -d libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
  425. for i in `(cd libc/sysdeps/linux/$(TARGET_ARCH)/sys; ls *.h)` ; do \
  426. $(RM) include/sys/$$i; \
  427. done; \
  428. fi
  429. @$(RM) include/linux include/asm*
  430. $(RM) $(top_builddir)extra/scripts/unifdef
  431. $(RM) -r $(LOCAL_INSTALL_PATH)
  432. distclean: clean
  433. -find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\*.dep \) -exec $(RM) {} \;
  434. $(RM) .config .config.old .config.cmd
  435. $(RM) extra/locale/*.tgz
  436. $(MAKE) -C extra/config distclean
  437. dist release:
  438. $(RM) -r ../uClibc-$(VERSION) ../uClibc-$(VERSION).tar.bz2
  439. svn -q export . ../uClibc-$(VERSION)
  440. $(TAR) cjf ../uClibc-$(VERSION).tar.bz2 -C .. uClibc-$(VERSION)
  441. du -b ../uClibc-$(VERSION).tar.bz2
  442. test check: test_compile
  443. $(Q)$(MAKE) -C test
  444. test_compile: $(LOCAL_INSTALL_PATH)
  445. $(Q)$(MAKE) -C test compile