Makefile.commonarch 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Makefile template to be included by libpthread/nptl/sysdeps/<ARCH>/Makefile.arch
  2. #
  3. # Copyright (C) 2010 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)
  8. libpthread_arch_DIR := $(top_srcdir)libpthread/nptl/sysdeps/$(TARGET_ARCH)
  9. libpthread_arch_OUT := $(top_builddir)libpthread/nptl/sysdeps/$(TARGET_ARCH)
  10. ifneq ($(abspath libpthread/nptl/sysdeps/$(TARGET_ARCH)),$(abspath libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)))
  11. subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)
  12. libpthread_subarch_DIR := $(libpthread_arch_DIR)/$(TARGET_SUBARCH)
  13. libpthread_subarch_OUT := $(libpthread_arch_OUT)/$(TARGET_SUBARCH)
  14. endif
  15. -include $(libpthread_arch_DIR)/Makefile.arch
  16. libpthread_arch_SSRC := $(filter-out librt-%,$(filter-out libc-%,$(notdir $(wildcard $(libpthread_arch_DIR)/*.S))))
  17. libpthread_arch_CSRC := $(filter-out librt-%,$(filter-out libc-%,$(notdir $(wildcard $(libpthread_arch_DIR)/*.c))))
  18. libpthread_arch_CSRC := $(filter-out gen_%,$(libpthread_arch_CSRC))
  19. libpthread_arch_CSRC := $(filter-out arm-unwind-resume.% rt-arm-unwind-resume.%,$(libpthread_arch_CSRC))
  20. ifneq ($(TARGET_SUBARCH),)
  21. libpthread_subarch_SSRC := $(notdir $(wildcard $(libpthread_subarch_DIR)/*.S))
  22. libpthread_arch_SSRC := $(filter-out $(libpthread_subarch_SSRC),$(libpthread_arch_SSRC))
  23. libpthread_arch_CSRC := $(filter-out $(libpthread_subarch_SSRC:.S=.c),$(libpthread_arch_CSRC))
  24. libpthread_subarch_OBJS := $(patsubst %.S,$(libpthread_subarch_OUT)/%.o,$(libpthread_subarch_SSRC))
  25. endif
  26. libpthread_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libpthread_arch_CSRC))
  27. libpthread_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libpthread_arch_SSRC))
  28. libpthread_arch_OBJS = $(libpthread_subarch_OBJS) $(libpthread_arch_COBJ) $(libpthread_arch_SOBJ)
  29. libc_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_CSRC))
  30. libc_arch_SOBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
  31. libc_arch_OBJS = $(libc_arch_COBJ) $(libc_arch_SOBJ)
  32. libc_arch_a_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_a_CSRC))
  33. libc_arch_a_OBJS = $(libc_arch_a_COBJ)
  34. librt_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(librt_arch_CSRC))
  35. librt_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(librt_arch_SSRC))
  36. librt_arch_OBJS = $(librt_arch_COBJ) $(librt_arch_SOBJ)
  37. $(libpthread_arch_OUT)/tcb-offsets.h: $(top_srcdir)extra/scripts/gen-as-const.awk
  38. $(libpthread_arch_OUT)/tcb-offsets.h: $(libpthread_arch_DIR)/tcb-offsets.sym
  39. @$(disp_gen)
  40. $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \
  41. | $(CC) $(CFLAGS) -x c - -S -o - \
  42. | $(SED) $(PTHREAD_GENERATE_MANGLE) > $@
  43. @if test ! -s $@ ; then rm -f $@ ; false ; fi
  44. pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread_arch_OUT)/tcb-offsets.h
  45. objclean-y += CLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT))
  46. headers_clean-y+= HEADERCLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT))
  47. CLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT)):
  48. $(do_rm) $(addprefix $(libpthread_arch_OUT)/*., o os oS)
  49. HEADERCLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT)):
  50. $(do_rm) $(libpthread_arch_OUT)/tcb-offsets.h
  51. ifneq ($(TARGET_SUBARCH),)
  52. objclean-y += CLEAN_$(subst $(top_builddir),,$(libpthread_subarch_OUT))
  53. CLEAN_$(subst $(top_builddir),,$(libpthread_subarch_OUT)):
  54. $(do_rm) $(addprefix $(libpthread_subarch_OUT)/*., o os oS)
  55. endif