Makefile.commonarch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Makefile template to be included by sysdeps/linux/<ARCH>/Makefile.arch
  2. #
  3. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. ARCH_DIR := $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
  8. ARCH_OUT := $(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH)
  9. ARCH_CSRC := $(addprefix $(ARCH_DIR)/,$(CSRC-y))
  10. ARCH_COBJ := $(addprefix $(ARCH_OUT)/,$(CSRC-y:.c=.o))
  11. ARCH_SSRC = $(addprefix $(ARCH_DIR)/,$(SSRC-y))
  12. ARCH_SOBJ = $(patsubst %.s,%.o,$(patsubst %.S,%.o,$(addprefix $(ARCH_OUT)/,$(SSRC-y))))
  13. ARCH_OBJS-y = $(ARCH_COBJ) $(ARCH_SOBJ)
  14. crt-y := FORCE
  15. libc-y += $(ARCH_OBJS-y)
  16. libc-nomulti-y += $(ARCH_SOBJ)
  17. objclean-y += CLEAN_$(subst $(top_builddir),,$(ARCH_OUT))
  18. CFLAGS-crti.S+=$(PICFLAG)
  19. CFLAGS-crtn.S+=$(PICFLAG)
  20. CLEAN_$(subst $(top_builddir),,$(ARCH_OUT)):
  21. $(do_rm) $(addprefix $(ARCH_OUT)/*., o os oS) $(CTOR_TARGETS) $(CRTS)
  22. ifneq ($(ARCH_HEADERS),)
  23. ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS))
  24. $(ARCH_HEADERS_OUT):
  25. $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@
  26. headers-y += $(ARCH_HEADERS_OUT)
  27. headers_clean-y += HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT))
  28. HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT)):
  29. $(do_rm) $(ARCH_HEADERS_OUT)
  30. endif
  31. CFLAGS-ucontext_i.c = -S
  32. $(ARCH_OUT)/ucontext_i.c: $(ARCH_DIR)/ucontext_i.sym
  33. $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@
  34. $(ARCH_OUT)/ucontext_i.s: $(ARCH_OUT)/ucontext_i.c
  35. $(compile.c)
  36. $(ARCH_OUT)/ucontext_i.h: $(ARCH_OUT)/ucontext_i.s
  37. $(do_sed) $(PTHREAD_GENERATE_MANGLE) $< > $@
  38. pregen-headers-$(UCLIBC_HAS_CONTEXT_FUNCS) += $(ARCH_OUT)/ucontext_i.h
  39. headers_clean-$(UCLIBC_HAS_CONTEXT_FUNCS) += \
  40. HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT)/ucontext_i)
  41. HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT)/ucontext_i):
  42. $(do_rm) $(addprefix $(ARCH_OUT)/ucontext_i., c h s)