Index: uspace/lib/libc/Makefile
===================================================================
--- uspace/lib/libc/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,15 +28,6 @@
 #
 
--include ../../../Makefile.common
--include ../../../Makefile.config
-
-USPACE_PREFIX = $(shell pwd)/../..
-LIBS =
-
-LINK = arch/$(UARCH)/_link.ld
-
-PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
-EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
-EXTRA_OUTPUT = $(LINK)
+USPACE_PREFIX = ../..
+ROOT_PATH = $(USPACE_PREFIX)/..
 
 INCLUDE_KERNEL = include/kernel
@@ -44,5 +35,15 @@
 INCLUDE_LIBARCH = include/libarch
 
-OUTPUT = libc.a
+PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
+EXTRA_OUTPUT = $(LINKER_SCRIPT)
+EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(LINKER_SCRIPT)
+LIBRARY = libc
+
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
+
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
+-include arch/$(UARCH)/Makefile.inc
 
 GENERIC_SOURCES = \
@@ -95,5 +96,5 @@
 	$(ARCH_SOURCES)
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
 
 $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
@@ -108,4 +109,4 @@
 	ln -sfn ../$< $@
 
-$(LINK): $(LINK).in
-	$(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
+$(LINKER_SCRIPT): $(LINKER_SCRIPT).in
+	$(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@
Index: uspace/lib/libc/Makefile.toolchain
===================================================================
--- uspace/lib/libc/Makefile.toolchain	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,85 +1,0 @@
-#
-# Copyright (C) 2005 Martin Decky
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-OPTIMIZATION = 3
-
-GCC_CFLAGS = -I$(LIBC_PREFIX)/include -O$(OPTIMIZATION) -imacros $(LIBC_PREFIX)/../../../config.h \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
-	-finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \
-	-Werror-implicit-function-declaration -Wwrite-strings \
-	-Werror -pipe -g -D__$(ENDIANESS)__
-
-ICC_CFLAGS = -I$(LIBC_PREFIX)/include -O$(OPTIMIZATION) -imacros $(LIBC_PREFIX)/../../../config.h \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
-	-finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \
-	-Werror-implicit-function-declaration -Wwrite-strings \
-	-Werror -pipe -g -D__$(ENDIANESS)__
-
-CLANG_CFLAGS = -I$(LIBC_PREFIX)/include -O$(OPTIMIZATION) -imacros $(LIBC_PREFIX)/../../../config.h \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
-	-finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
-	-Werror-implicit-function-declaration -Wwrite-strings \
-	-pipe -g -arch $(CLANG_ARCH) -D__$(ENDIANESS)__
-
-LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a
-AFLAGS =
-
-## Setup platform configuration
-#
-
--include $(LIBC_PREFIX)/../../../Makefile.common
--include $(LIBC_PREFIX)/../../../Makefile.config
--include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
-
-## Compilation options
-#
-
-JOBFILE = $(LIBC_PREFIX)/../../../tools/jobfile.py
-
-ifeq ($(COMPILER),gcc_cross)
-	CFLAGS = $(GCC_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
-
-ifeq ($(COMPILER),gcc_native)
-	CFLAGS = $(GCC_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
-
-ifeq ($(COMPILER),icc)
-	CFLAGS = $(ICC_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
-
-ifeq ($(COMPILER),clang)
-	CFLAGS = $(CLANG_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
Index: uspace/lib/libc/arch/abs32le/Makefile.common
===================================================================
--- uspace/lib/libc/arch/abs32le/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/abs32le/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2010 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+ifeq ($(COMPILER),clang)
+	CLANG_ARCH = i386
+endif
+
+ENDIANESS = LE
Index: uspace/lib/libc/arch/abs32le/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/abs32le/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/abs32le/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,8 +27,4 @@
 #
 
-ifeq ($(COMPILER),clang)
-	CLANG_ARCH = i386
-endif
-
 ARCH_SOURCES = \
 	arch/$(UARCH)/src/entry.c \
@@ -39,3 +35,3 @@
 	arch/$(UARCH)/src/stacktrace.c
 
-ENDIANESS = LE
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/abs32le/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/abs32le/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/abs32le/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/amd64/Makefile.common
===================================================================
--- uspace/lib/libc/arch/amd64/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/amd64/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2005 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+CLANG_ARCH = x86_64
+GCC_CFLAGS += -fno-omit-frame-pointer
+
+ENDIANESS = LE
+
+BFD_NAME = elf64-x86-64
+BFD_ARCH = i386:x86-64
Index: uspace/lib/libc/arch/amd64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/amd64/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/amd64/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,6 +27,4 @@
 #
 
-CLANG_ARCH = x86_64
-
 ARCH_SOURCES = \
 	arch/$(UARCH)/src/entry.s \
@@ -38,9 +36,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -fno-omit-frame-pointer
-LFLAGS += -N
-
-ENDIANESS = LE
-
-BFD_NAME = elf64-x86-64
-BFD_ARCH = i386:x86-64
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/amd64/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/amd64/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/amd64/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/arm32/Makefile.common
===================================================================
--- uspace/lib/libc/arch/arm32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/arm32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2007 Michal Kebrt
+# Copyright (c) 2007 Pavel Jancik
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+GCC_CFLAGS += -ffixed-r9 -mtp=soft -mapcs-frame -fno-omit-frame-pointer
+
+ENDIANESS = LE
+
+BFD_NAME = elf32-littlearm
+BFD_ARCH = arm
Index: uspace/lib/libc/arch/arm32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/arm32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/arm32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -38,9 +38,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -ffixed-r9 -mtp=soft -mapcs-frame -fno-omit-frame-pointer
-LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
-
-ENDIANESS = LE
-
-BFD_NAME = elf32-littlearm
-BFD_ARCH = arm
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/arm32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/arm32/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/arm32/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/ia32/Makefile.common
===================================================================
--- uspace/lib/libc/arch/ia32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/ia32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2005 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+CLANG_ARCH = i386
+GCC_CFLAGS += -march=pentium
+
+ENDIANESS = LE
+
+BFD_NAME = elf32-i386
+BFD_ARCH = i386
Index: uspace/lib/libc/arch/ia32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/ia32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,6 +27,4 @@
 #
 
-CLANG_ARCH = i386
-
 ARCH_SOURCES = \
 	arch/$(UARCH)/src/entry.s \
@@ -39,9 +37,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -march=pentium
-LFLAGS += -N
-
-ENDIANESS = LE
-
-BFD_NAME = elf32-i386
-BFD_ARCH = i386
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/ia32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/ia32/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/ia32/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/ia64/Makefile.common
===================================================================
--- uspace/lib/libc/arch/ia64/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/ia64/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2005 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+GCC_CFLAGS += -fno-unwind-tables
+
+ENDIANESS = LE
+
+BFD_NAME = elf64-ia64-little
+BFD_ARCH = ia64-elf64
Index: uspace/lib/libc/arch/ia64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia64/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/ia64/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -37,9 +37,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -fno-unwind-tables
-LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
-
-ENDIANESS = LE
-
-BFD_NAME = elf64-ia64-little
-BFD_ARCH = ia64-elf64
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/ia64/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/ia64/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/ia64/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/ia64/include/types.h
===================================================================
--- uspace/lib/libc/arch/ia64/include/types.h	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/ia64/include/types.h	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -38,5 +38,5 @@
 #define __64_BITS__
 
-typedef unsigned long long sysarg_t;
+typedef unsigned long sysarg_t;
 
 typedef char int8_t;
Index: uspace/lib/libc/arch/mips32/Makefile.common
===================================================================
--- uspace/lib/libc/arch/mips32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/mips32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2005 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+GCC_CFLAGS += -mips3
+
+ENDIANESS = LE
+
+BFD_ARCH = mips
+BFD_NAME = elf32-tradlittlemips
Index: uspace/lib/libc/arch/mips32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/mips32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -36,8 +36,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -mips3
-
-ENDIANESS = LE
-
-BFD_ARCH = mips
-BFD_NAME = elf32-tradlittlemips
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/mips32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/mips32/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/mips32/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/mips32eb/Makefile.common
===================================================================
--- uspace/lib/libc/arch/mips32eb/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/mips32eb/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2005 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+GCC_CFLAGS += -mips3
+
+ENDIANESS = BE
+
+BFD_ARCH = mips
+BFD_NAME = elf32-tradbigmips
Index: uspace/lib/libc/arch/mips32eb/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -36,9 +36,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -mips3
-LFLAGS += -N
-
-ENDIANESS = BE
-
-BFD_ARCH = mips
-BFD_NAME = elf32-tradbigmips
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/ppc32/Makefile.common
===================================================================
--- uspace/lib/libc/arch/ppc32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/ppc32/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2006 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
+AFLAGS = -a32
+
+ENDIANESS = BE
+
+BFD_NAME = elf32-powerpc
+BFD_ARCH = powerpc:common
Index: uspace/lib/libc/arch/ppc32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ppc32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/ppc32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -36,10 +36,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
-AFLAGS += -a32
-LFLAGS += -N
-
-ENDIANESS = BE
-
-BFD_NAME = elf32-powerpc
-BFD_ARCH = powerpc:common
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/ppc32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/ppc32/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/ppc32/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/sparc64/Makefile.common
===================================================================
--- uspace/lib/libc/arch/sparc64/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
+++ uspace/lib/libc/arch/sparc64/Makefile.common	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2006 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+GCC_CFLAGS += -mcpu=ultrasparc -m64
+LFLAGS = -no-check-sections
+
+ENDIANESS = BE
+
+BFD_NAME = elf64-sparc
+BFD_ARCH = sparc
+
+ifeq ($(PROCESSOR),us)
+	DEFS += -DSUN4U
+endif
+
+ifeq ($(PROCESSOR),us3)
+	DEFS += -DSUN4U
+endif
+
+ifeq ($(PROCESSOR),sun4v)
+	DEFS += -DSUN4V
+endif
Index: uspace/lib/libc/arch/sparc64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/sparc64/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/sparc64/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -35,21 +35,3 @@
 	arch/$(UARCH)/src/stacktrace_asm.S
 
-GCC_CFLAGS += -mcpu=ultrasparc -m64
-LFLAGS += -no-check-sections -N
-
-ENDIANESS = BE
-
-BFD_NAME = elf64-sparc
-BFD_ARCH = sparc
-
-ifeq ($(PROCESSOR),us)
-	DEFS += -DSUN4U
-endif
-
-ifeq ($(PROCESSOR),us3)
-	DEFS += -DSUN4U
-endif
-
-ifeq ($(PROCESSOR),sun4v)
-	DEFS += -DSUN4V
-endif
+.PRECIOUS: arch/$(UARCH)/src/entry.o
Index: uspace/lib/libc/arch/sparc64/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/sparc64/_link.ld.in	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/lib/libc/arch/sparc64/_link.ld.in	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
+STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
