Makefile.commonarch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 += arch_clean
  18. CFLAGS-crti.S+=$(PICFLAG)
  19. CFLAGS-crtn.S+=$(PICFLAG)
  20. arch_clean:
  21. $(do_rm) $(addprefix $(ARCH_OUT)/*., o os oS) $(CTOR_TARGETS) $(CRTS)
  22. ifneq ($(ARCH_HEADERS),)
  23. ARCH_HEADERS_IN := $(patsubst %,../libc/sysdeps/linux/$(TARGET_ARCH)/%,$(ARCH_HEADERS))
  24. ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS))
  25. $(ARCH_HEADERS_OUT):
  26. $(do_ln) -fs ../libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@
  27. headers-y += $(ARCH_HEADERS_OUT)
  28. headers_clean-y += arch_headers_clean
  29. arch_headers_clean:
  30. $(RM) $(ARCH_HEADERS_OUT)
  31. endif