Makefile.arch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_SSRC = pthread_spin_unlock.S pthread_spin_trylock.S
  8. libpthread_CSRC = pthread_spin_lock.c pthread_spin_init.c
  9. ASFLAGS-pthread_spin_unlock.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
  10. ASFLAGS-pthread_spin_trylock.S = -DNOT_IN_libc=1 -DIS_IN_libpthread=1
  11. CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
  12. CFLAGS-sh = $(SSP_ALL_CFLAGS)
  13. #CFLAGS:=$(CFLAGS:-O1=-O2)
  14. PTHREAD_ARCH_DIR := $(top_srcdir)libpthread/nptl/sysdeps/sh
  15. PTHREAD_ARCH_OUT := $(top_builddir)libpthread/nptl/sysdeps/sh
  16. PTHREAD_ARCH_OBJ := $(patsubst %.S,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_SSRC))
  17. PTHREAD_ARCH_OBJ += $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libpthread_CSRC))
  18. ifeq ($(DOPIC),y)
  19. libpthread-a-y += $(PTHREAD_ARCH_OBJ:.o=.os)
  20. else
  21. libpthread-a-y += $(PTHREAD_ARCH_OBJ)
  22. endif
  23. libpthread-so-y += $(PTHREAD_ARCH_OBJ:.o=.oS)
  24. libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
  25. objclean-y += CLEAN_libpthread/nptl/sysdeps/sh
  26. headers_clean-y += HEADERCLEAN_libpthread/nptl/sysdeps/sh
  27. #
  28. # Create 'tcb-offsets.h' header file.
  29. #
  30. CFLAGS-tcb-offsets.c = -S
  31. $(PTHREAD_ARCH_OUT)/tcb-offsets.c: $(PTHREAD_ARCH_DIR)/tcb-offsets.sym
  32. $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
  33. $(PTHREAD_ARCH_OUT)/tcb-offsets.s: $(PTHREAD_ARCH_OUT)/tcb-offsets.c
  34. $(compile.c)
  35. $(PTHREAD_ARCH_OUT)/tcb-offsets.h: $(PTHREAD_ARCH_OUT)/tcb-offsets.s
  36. $(do_sed) -n "s/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$\/#define \1 \2/p" $< > $@
  37. pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(PTHREAD_ARCH_OUT)/tcb-offsets.h
  38. HEADERCLEAN_libpthread/nptl/sysdeps/sh:
  39. $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/tcb-offsets., c s h)
  40. CLEAN_libpthread/nptl/sysdeps/sh:
  41. $(do_rm) $(addprefix $(PTHREAD_ARCH_OUT)/*., o os oS)