Makefile.commonarch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. 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-a-y += $(ARCH_OBJS)
  16. libc-so-y += $(ARCH_OBJS:.o=.os)
  17. libc-multi-y += $(ARCH_CSRC)
  18. libc-nomulti-y += $(ARCH_SOBJ)
  19. objclean-y += arch_objclean
  20. arch_objclean:
  21. $(RM) $(ARCH_OUT)/*.{o,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. headers-y += arch_headers
  26. arch_headers:
  27. $(SECHO) $(LN) -fs $(ARCH_HEADERS) $(top_builddir)include/
  28. @for h in $(ARCH_HEADERS_IN) ; do \
  29. $(LN) -fs $$h $(top_builddir)include/ ; \
  30. done
  31. headers_clean-y += arch_headers_clean
  32. arch_headers_clean:
  33. $(RM) $(ARCH_HEADERS_OUT)
  34. endif