Makefile.arch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Makefile for uClibc NPTL
  2. #
  3. # Copyright (C) 2005 Steven J. Hill <sjhill@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. libpthread_CSRC = pthread_spin_lock.c
  8. libpthread_SSRC = pthread_spin_trylock.S
  9. CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
  10. CFLAGS-x86_64 = $(SSP_ALL_CFLAGS)
  11. #CFLAGS:=$(CFLAGS:-O1=-O2)
  12. PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/x86_64
  13. PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/x86_64
  14. PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
  15. PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
  16. ifeq ($(DOPIC),y)
  17. libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
  18. else
  19. libpthread-a-y += $(PTHREAD_ARCH_OBJ)
  20. endif
  21. libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
  22. libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
  23. objclean-y += nptl_arch_clean
  24. headers_clean-y += nptl_arch_headers_clean
  25. #
  26. # Create 'tcb-offsets.h' header file.
  27. #
  28. CFLAGS-tcb-offsets.c = -S
  29. $(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
  30. $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
  31. $(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
  32. $(compile.c)
  33. $(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.s
  34. @sed -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$\/#define \1 \2/p" $< > $@
  35. nptl_arch_headers := $(PTHREAD_ARCH_OUT)/tcb-offsets.h
  36. nptl_arch_headers_clean:
  37. $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
  38. nptl_arch_clean:
  39. $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)