| lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 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 | |
| 8 | ARCH_DIR := $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) |
| 9 | ARCH_OUT := $(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH) |
| 10 | |
| 11 | ARCH_CSRC := $(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC)) |
| 12 | ARCH_COBJ := $(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC)) |
| 13 | ARCH_SSRC = $(patsubst %.s,$(ARCH_DIR)/%.s,$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))) |
| 14 | ARCH_SOBJ = $(patsubst %.s,$(ARCH_OUT)/%.o,$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))) |
| 15 | |
| 16 | ARCH_OBJS = $(ARCH_COBJ) $(ARCH_SOBJ) |
| 17 | |
| 18 | crt-y := FORCE |
| 19 | libc-y += $(ARCH_OBJS) |
| 20 | libc-nomulti-y += $(ARCH_SOBJ) |
| 21 | objclean-y += CLEAN_$(subst $(top_builddir),,$(ARCH_OUT)) |
| 22 | |
| 23 | CFLAGS-crti.S+=$(PICFLAG) |
| 24 | CFLAGS-crtn.S+=$(PICFLAG) |
| 25 | |
| 26 | CLEAN_$(subst $(top_builddir),,$(ARCH_OUT)): |
| 27 | $(do_rm) $(addprefix $(ARCH_OUT)/*., o os oS) $(CTOR_TARGETS) $(CRTS) |
| 28 | |
| 29 | ifneq ($(ARCH_HEADERS),) |
| 30 | |
| 31 | ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS)) |
| 32 | |
| 33 | $(ARCH_HEADERS_OUT): |
| 34 | $(do_ln) $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@ |
| 35 | |
| 36 | headers-y += $(ARCH_HEADERS_OUT) |
| 37 | headers_clean-y += HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT)) |
| 38 | HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT)): |
| 39 | $(do_rm) $(ARCH_HEADERS_OUT) |
| 40 | |
| 41 | endif |