1 # Makefile for uClibc NPTL
3 # Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
4 # Portions Copyright (C) 2006 CodeSourcery
6 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
9 libpthread_SSRC = pthread_spin_lock.S pthread_spin_trylock.S aeabi_read_tp.S \
11 libpthread_CSRC = aeabi_unwind_cpp_pr1.c
13 librt_SSRC = aeabi_read_tp.S thumb_atomics.S
14 librt_CSRC = aeabi_unwind_cpp_pr1.c
18 CFLAGS-pt-raise.c = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
20 ASFLAGS-pthread_spin_lock.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
21 ASFLAGS-pthread_spin_trylock.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
22 ASFLAGS-aeabi_read_tp.S = -DNOT_IN_libc=1
24 CFLAGS-arm = $(SSP_ALL_CFLAGS)
26 PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/arm
27 PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/arm
28 PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
29 PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
30 LIBRT_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(librt_SSRC))
31 LIBRT_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(librt_CSRC))
35 libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
37 libpthread-a-y += $(PTHREAD_ARCH_OBJ)
39 libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
41 librt-a-y += $(LIBRT_ARCH_OBJ)
42 librt-so-y += $(LIBRT_ARCH_OBJ:.o=.oS)
44 libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
46 objclean-y += nptl_arch_clean
47 headers-y += $(PTHREAD_ARCH_OUT)/tcb-offsets.h
48 headers_clean-y += nptl_arch_headers_clean
51 # Create 'tcb-offsets.h' header file.
53 CFLAGS-tcb-offsets.c = -S
55 $(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
56 $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
58 $(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
61 $(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.s
62 $(do_sed) -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$\/#define \1 \2/p" $< > $@
64 nptl_arch_headers_clean:
65 $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
68 $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)