Makefile.commonarch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 := $(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
  10. ARCH_COBJ := $(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
  11. ARCH_SSRC := $(patsubst %.s,$(ARCH_DIR)/%.s,$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC)))
  12. ARCH_SOBJ := $(patsubst %.s,$(ARCH_OUT)/%.o,$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC)))
  13. ARCH_OBJS := $(ARCH_COBJ) $(ARCH_SOBJ)
  14. crt-y := FORCE
  15. libc-y += $(ARCH_OBJS)
  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) -fs $(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. $(RM) $(ARCH_HEADERS_OUT)
  30. endif