get rid of extra variables for nptl pregen altogether
[uclibc-ng.git] / libpthread / nptl / sysdeps / arm / Makefile.arch
blobf16b605fb5be9d2e520e7822a2e7021c86cebed8
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 \
10         thumb_atomics.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
16 libc_a_CSRC =
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))
34 ifeq ($(DOPIC),y)
35 libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
36 else
37 libpthread-a-y += $(PTHREAD_ARCH_OBJ)
38 endif
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_objclean
47 headers_clean-y += nptl_arch_headers_clean
50 # Create 'tcb-offsets.h' header file.
52 CFLAGS-tcb-offsets.c = -S
54 $(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
55         $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
57 $(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
58         $(compile.c)
60 $(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.s
61         $(do_sed) -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$\/#define \1 \2/p" $< > $(PTHREAD_ARCH_OUT)/tcb-offsets.h
63 pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(PTHREAD_ARCH_OUT)/tcb-offsets.h
65 nptl_arch_headers_clean:
66         $(RM) $(PTHREAD_ARCH_OUT)/tcb-offsets.c         \
67               $(PTHREAD_ARCH_OUT)/tcb-offsets.s         \
68               $(PTHREAD_ARCH_OUT)/tcb-offsets.h
70 nptl_arch_objclean:
71         $(RM) $(PTHREAD_ARCH_OUT)/*.{o,os,oS}