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