Makefile.commonarch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 %.S,$(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_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libc_arch_a_SSRC))
  34. libc_arch_a_OBJS = $(libc_arch_a_COBJ) $(libc_arch_a_SOBJ)
  35. librt_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(librt_arch_CSRC))
  36. librt_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(librt_arch_SSRC))
  37. librt_arch_OBJS = $(librt_arch_COBJ) $(librt_arch_SOBJ)
  38. $(libpthread_arch_OUT)/tcb-offsets.h: $(top_srcdir)extra/scripts/gen-as-const.awk
  39. $(libpthread_arch_OUT)/tcb-offsets.h: $(libpthread_arch_DIR)/tcb-offsets.sym
  40. @$(disp_gen)
  41. $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \
  42. | $(CC) $(CFLAGS) -x c - -S -o - \
  43. | $(SED) $(PTHREAD_GENERATE_MANGLE) > $@
  44. @if test ! -s $@ ; then rm -f $@ ; false ; fi
  45. pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread_arch_OUT)/tcb-offsets.h
  46. objclean-y += CLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT))
  47. headers_clean-y+= HEADERCLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT))
  48. CLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT)):
  49. $(do_rm) $(addprefix $(libpthread_arch_OUT)/*., o os oS)
  50. HEADERCLEAN_$(subst $(top_builddir),,$(libpthread_arch_OUT)):
  51. $(do_rm) $(libpthread_arch_OUT)/tcb-offsets.h
  52. ifneq ($(TARGET_SUBARCH),)
  53. objclean-y += CLEAN_$(subst $(top_builddir),,$(libpthread_subarch_OUT))
  54. CLEAN_$(subst $(top_builddir),,$(libpthread_subarch_OUT)):
  55. $(do_rm) $(addprefix $(libpthread_subarch_OUT)/*., o os oS)
  56. endif