Makefile.in 20 KB

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