Makefile.arch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Makefile template to be included by sysdeps/linux/<ARCH>/Makefile.arch
  2. #
  3. # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. ifeq ($(TARGET_ARCH),)
  8. $(error TARGET_ARCH is not set, no .config exists in topdir)
  9. endif
  10. ARCH_DIR := $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
  11. ARCH_OUT := $(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH)
  12. ARCH_CSRC := $(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
  13. ARCH_COBJ := $(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
  14. ARCH_SSRC := $(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
  15. ARCH_SOBJ := $(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
  16. ARCH_OBJS := $(ARCH_COBJ) $(ARCH_SOBJ)
  17. crt-y := create
  18. libc-a-y += $(ARCH_OBJS)
  19. libc-so-y += $(ARCH_OBJS:.o=.os)
  20. libc-multi-y += $(ARCH_CSRC)
  21. libc-nomulti-y += $(ARCH_SOBJ)
  22. objclean-y += arch_objclean
  23. arch_objclean:
  24. $(RM) $(ARCH_OUT)/*.{o,os} $(CTOR_TARGETS) $(CRTS)
  25. ifneq ($(ARCH_HEADERS),)
  26. ARCH_HEADERS_IN := $(patsubst %,../libc/sysdeps/linux/$(TARGET_ARCH)/%,$(ARCH_HEADERS))
  27. ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS))
  28. headers-y += arch_headers
  29. arch_headers:
  30. $(SECHO) $(LN) -fs $(ARCH_HEADERS) $(top_builddir)include/
  31. @for h in $(ARCH_HEADERS_IN) ; do \
  32. $(LN) -fs $$h $(top_builddir)include/ ; \
  33. done
  34. headers_clean-y += arch_headers_clean
  35. arch_headers_clean:
  36. $(RM) $(ARCH_HEADERS_OUT)
  37. endif