nptl: make build depend directly on nptl headers
[uclibc-ng.git] / libpthread / nptl / sysdeps / i386 / Makefile.arch
blob2b8fbbfec4fe7e0394c7bcf934b5c270c9063b98
1 # Makefile for uClibc NPTL
3 # Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8 libpthread_CSRC = pthread_spin_lock.c
9 libpthread_SSRC = i486/pthread_spin_trylock.S
11 CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
13 CFLAGS-i386 = $(SSP_ALL_CFLAGS)
14 #CFLAGS:=$(CFLAGS:-O1=-O2)
16 PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/i386
17 PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/i386
18 PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
19 PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
21 ifeq ($(DOPIC),y)
22 libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
23 else
24 libpthread-a-y += $(PTHREAD_ARCH_OBJ)
25 endif
26 libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
28 libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
30 objclean-y += nptl_arch_clean
31 headers-y += $(PTHREAD_ARCH_OUT)/tcb-offsets.h
32 headers_clean-y += nptl_arch_headers_clean
35 # Create 'tcb-offsets.h' header file.
37 CFLAGS-tcb-offsets.c = -S
39 $(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
40         $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
42 $(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
43         $(compile.c)
45 $(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.s
46         @sed -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$\/#define \1 \2/p" $< > $@
48 nptl_arch_headers_clean:
49         $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
51 nptl_arch_clean:
52         $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)