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