summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-11-04 23:55:18 +0000
committerMike Frysinger <vapier@gentoo.org>2005-11-04 23:55:18 +0000
commit4ed896210a0bd7597bf9c9df0909af4a6fc6d881 (patch)
tree84c7dbf60c0f8991b857e3dac6f0f43f388b3d73 /libc/sysdeps/linux
parentf3adfd4dece9cce115d4740465b32e019b534da7 (diff)
unify common code thus making arch-specific Makefiles very simple :)
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/Makefile.arch44
-rw-r--r--libc/sysdeps/linux/alpha/Makefile.arch28
-rw-r--r--libc/sysdeps/linux/arm/Makefile.arch28
-rw-r--r--libc/sysdeps/linux/cris/Makefile.arch29
-rw-r--r--libc/sysdeps/linux/i386/Makefile.arch27
-rw-r--r--libc/sysdeps/linux/mips/Makefile.arch41
-rw-r--r--libc/sysdeps/linux/powerpc/Makefile.arch28
-rw-r--r--libc/sysdeps/linux/sh/Makefile.arch26
-rw-r--r--libc/sysdeps/linux/sparc/Makefile.arch28
-rw-r--r--libc/sysdeps/linux/x86_64/Makefile.arch27
10 files changed, 87 insertions, 219 deletions
diff --git a/libc/sysdeps/linux/Makefile.arch b/libc/sysdeps/linux/Makefile.arch
new file mode 100644
index 000000000..776fff235
--- /dev/null
+++ b/libc/sysdeps/linux/Makefile.arch
@@ -0,0 +1,44 @@
+# Makefile template to be included by sysdeps/linux/<ARCH>/Makefile.arch
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+ARCH_DIR := $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
+ARCH_OUT := $(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH)
+
+ARCH_CSRC := $(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
+ARCH_COBJ := $(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
+ARCH_SSRC := $(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
+ARCH_SOBJ := $(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
+
+ARCH_OBJS := $(ARCH_COBJ) $(ARCH_SOBJ)
+
+crt-y := create
+libc-a-y += $(ARCH_OBJS)
+libc-so-y += $(ARCH_OBJS:.o=.os)
+libc-multi-y += $(ARCH_CSRC)
+libc-nomulti-y += $(ARCH_SOBJ)
+objclean-y += arch_objclean
+
+arch_objclean:
+ $(RM) $(ARCH_OUT)/*.{o,os} $(CTOR_TARGETS) $(CRTS)
+
+ifneq ($(ARCH_HEADERS),)
+
+ARCH_HEADERS_IN := $(patsubst %,$(ARCH_DIR)/%,$(ARCH_HEADERS))
+ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS))
+
+headers-y += arch_headers
+arch_headers:
+ $(SECHO) $(LN) -fs $(ARCH_HEADERS) $(top_builddir)include/
+ @for h in $(ARCH_HEADERS_IN) ; do \
+ $(LN) -fs ../libc/sysdeps/linux/$(TARGET_ARCH)/$$h $(top_builddir)include/ ; \
+ done
+
+headers_clean-y += arch_headers_clean
+arch_headers_clean:
+ $(RM) $(ARCH_HEADERS_OUT)
+
+endif
diff --git a/libc/sysdeps/linux/alpha/Makefile.arch b/libc/sysdeps/linux/alpha/Makefile.arch
index 7022f636a..aafb4a826 100644
--- a/libc/sysdeps/linux/alpha/Makefile.arch
+++ b/libc/sysdeps/linux/alpha/Makefile.arch
@@ -5,28 +5,10 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=sysdep.c #brk.c
-SSRC:= __longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \
- divl.S divq.S reml.S remq.S setjmp.S
-
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/alpha
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/alpha
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
+CSRC := sysdep.c #brk.c
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
+SSRC := \
+ __longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \
+ divl.S divq.S reml.S remq.S setjmp.S
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/arm/Makefile.arch b/libc/sysdeps/linux/arm/Makefile.arch
index dfea3b72f..c6edc12a1 100644
--- a/libc/sysdeps/linux/arm/Makefile.arch
+++ b/libc/sysdeps/linux/arm/Makefile.arch
@@ -5,28 +5,10 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=brk.c syscall.c ioperm.c iopl.c sigaction.c __syscall_error.c
-SSRC:= __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
- bsd-_setjmp.S sigrestorer.S mmap64.S
-
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/arm
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/arm
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
+CSRC := brk.c syscall.c ioperm.c iopl.c sigaction.c __syscall_error.c
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
+SSRC := \
+ __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
+ bsd-_setjmp.S sigrestorer.S mmap64.S
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/cris/Makefile.arch b/libc/sysdeps/linux/cris/Makefile.arch
index f7bb743af..ba2040f0d 100644
--- a/libc/sysdeps/linux/cris/Makefile.arch
+++ b/libc/sysdeps/linux/cris/Makefile.arch
@@ -5,30 +5,11 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=__init_brk.c brk.c sbrk.c
-SSRC:=setjmp.S __longjmp.S clone.S sysdep.S syscall.S
+CSRC := __init_brk.c brk.c sbrk.c
+
+SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S
ifeq ($(UNIFIED_SYSCALL),y)
-SSRC+=__uClibc_syscall.S
+SSRC += __uClibc_syscall.S
endif
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/cris
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/cris
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
-
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
-
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/i386/Makefile.arch b/libc/sysdeps/linux/i386/Makefile.arch
index a5c969bce..c0f4f2f40 100644
--- a/libc/sysdeps/linux/i386/Makefile.arch
+++ b/libc/sysdeps/linux/i386/Makefile.arch
@@ -5,29 +5,10 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=brk.c sigaction.c __syscall_error.c
+CSRC := brk.c sigaction.c __syscall_error.c
-SSRC:= __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
+SSRC := \
+ __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
bsd-_setjmp.S syscall.S mmap.S mmap64.S
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/i386
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/i386
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
-
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
-
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/mips/Makefile.arch b/libc/sysdeps/linux/mips/Makefile.arch
index 792ac5340..f88e99686 100644
--- a/libc/sysdeps/linux/mips/Makefile.arch
+++ b/libc/sysdeps/linux/mips/Makefile.arch
@@ -5,42 +5,13 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:= __longjmp.c brk.c setjmp_aux.c mmap.c __syscall_error.c \
+CSRC := \
+ __longjmp.c brk.c setjmp_aux.c mmap.c __syscall_error.c \
cacheflush.c pread_write.c sysmips.c _test_and_set.c sigaction.c
-SSRC:=bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S syscall.S pipe.S
+SSRC := bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S syscall.S pipe.S
+ARCH_HEADERS := sgidefs.h
+# regdef.h
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/mips
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/mips
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
-
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
-
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
-
-headers_clean-y+=arch_headers_clean
-
-arch_headers_clean:
- $(RM) $(top_builddir)include/sgidefs.h
- #$(RM) $(top_builddir)include/regdef.h
-
-headers-y+=arch_headers
-
-arch_headers:
- $(LN) -fs ../libc/sysdeps/linux/mips/sgidefs.h $(top_builddir)include/
-# $(LN) -fs ../libc/sysdeps/linux/mips/regdef.h $(top_builddir)include/
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/powerpc/Makefile.arch b/libc/sysdeps/linux/powerpc/Makefile.arch
index d3ee147c1..125ebc397 100644
--- a/libc/sysdeps/linux/powerpc/Makefile.arch
+++ b/libc/sysdeps/linux/powerpc/Makefile.arch
@@ -5,28 +5,10 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=mmap.c __syscall_error.c pread_write.c ioctl.c
-SSRC:= __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
- clone.S __uClibc_syscall.S syscall.S vfork.S
-
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/powerpc
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/powerpc
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
+CSRC := mmap.c __syscall_error.c pread_write.c ioctl.c
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
+SSRC := \
+ __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
+ clone.S __uClibc_syscall.S syscall.S vfork.S
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/sh/Makefile.arch b/libc/sysdeps/linux/sh/Makefile.arch
index e3a9fd936..33ea8a94f 100644
--- a/libc/sysdeps/linux/sh/Makefile.arch
+++ b/libc/sysdeps/linux/sh/Makefile.arch
@@ -6,27 +6,9 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=mmap.c longjmp.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c
-SSRC:=setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S
+CSRC := \
+ mmap.c longjmp.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/sh
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/sh
+SSRC := setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
-
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
-
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/sparc/Makefile.arch b/libc/sysdeps/linux/sparc/Makefile.arch
index b7899b1cd..6730206b4 100644
--- a/libc/sysdeps/linux/sparc/Makefile.arch
+++ b/libc/sysdeps/linux/sparc/Makefile.arch
@@ -5,28 +5,10 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=brk.c __syscall_error.c
-SSRC:= __longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
- urem.S udiv.S umul.S sdiv.S rem.S
-
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/sparc
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/sparc
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
+CSRC := brk.c __syscall_error.c
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
+SSRC := \
+ __longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
+ urem.S udiv.S umul.S sdiv.S rem.S
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch
diff --git a/libc/sysdeps/linux/x86_64/Makefile.arch b/libc/sysdeps/linux/x86_64/Makefile.arch
index 5ba47ce2e..2cd9b2389 100644
--- a/libc/sysdeps/linux/x86_64/Makefile.arch
+++ b/libc/sysdeps/linux/x86_64/Makefile.arch
@@ -5,28 +5,9 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC:=brk.c sigaction.c __syscall_error.c mmap.c
+CSRC := brk.c sigaction.c __syscall_error.c mmap.c
-SSRC:=__longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S
+SSRC := \
+ __longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S
-ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/x86_64
-ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/x86_64
-
-ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
-ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
-ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
-ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
-
-ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
-
-crt-y:=create
-libc-a-y+=$(ARCH_OBJS)
-libc-so-y+=$(ARCH_OBJS:.o=.os)
-
-libc-multi-y+=$(ARCH_CSRC)
-libc-nomulti-y+=$(ARCH_SOBJ)
-
-objclean-y+=arch_objclean
-
-arch_objclean:
- $(RM) $(ARCH_OUT)/*.{o,os}
+include $(top_srcdir)libc/sysdeps/linux/Makefile.arch