Makefile.commonarch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Makefile template to be included by sysdeps/linux/<ARCH>/Makefile.arch
  2. #
  3. # Copyright (C) 2000-2006 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 := create
  15. libc-y += $(ARCH_OBJS)
  16. libc-nomulti-y += $(ARCH_SOBJ)
  17. objclean-y += arch_objclean
  18. arch_objclean:
  19. $(RM) $(ARCH_OUT)/*.{o,os} $(CTOR_TARGETS) $(CRTS)
  20. ifneq ($(ARCH_HEADERS),)
  21. ARCH_HEADERS_IN := $(patsubst %,../libc/sysdeps/linux/$(TARGET_ARCH)/%,$(ARCH_HEADERS))
  22. ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS))
  23. headers-y += arch_headers
  24. arch_headers:
  25. $(SECHO) $(LN) -fs $(ARCH_HEADERS) $(top_builddir)include/
  26. @for h in $(ARCH_HEADERS_IN) ; do \
  27. $(LN) -fs $$h $(top_builddir)include/ ; \
  28. done
  29. headers_clean-y += arch_headers_clean
  30. arch_headers_clean:
  31. $(RM) $(ARCH_HEADERS_OUT)
  32. endif