Makefile.in 18 KB

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