Makefile.in 18 KB

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