Quellcode durchsuchen

unify common code thus making arch-specific Makefiles very simple :)

Mike Frysinger vor 19 Jahren
Ursprung
Commit
4ed896210a

+ 44 - 0
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

+ 5 - 23
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

+ 5 - 23
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

+ 5 - 24
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

+ 4 - 23
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

+ 6 - 35
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

+ 5 - 23
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

+ 4 - 22
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

+ 5 - 23
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

+ 4 - 23
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