Index: uspace/srv/Makefile.common
===================================================================
--- uspace/srv/Makefile.common	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,97 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# 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.
-#
-
-## Common rules for building servers.
-#
-
-# Individual makefiles set:
-#
-#	USPACE_PREFIX	relative path to uspace/ directory
-#	LIBS		libraries to link with (with relative path)
-#	EXTRA_CFLAGS	additional flags to pass to C compiler
-#	JOB		job file name (like appname.job)
-#	OUTPUT		output binary name (like appname)
-#	SOURCES		list of source files
-#
-
-DEPEND = Makefile.depend
-DEPEND_PREV = $(DEPEND).prev
-
-LIBC_PREFIX = $(USPACE_PREFIX)/lib/libc
-LIBBLOCK_PREFIX = $(USPACE_PREFIX)/lib/libblock
-LIBFS_PREFIX = $(USPACE_PREFIX)/lib/libfs
-LIBPCI_PREFIX = $(USPACE_PREFIX)/lib/libpci
-SOFTINT_PREFIX = $(USPACE_PREFIX)/lib/softint
-
-LINK_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld
-
-JOB = $(OUTPUT).job
-
-OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
-
-include $(LIBC_PREFIX)/Makefile.toolchain
-
-CFLAGS += $(EXTRA_CFLAGS)
-
-.PHONY: all build clean
-
-all: \
-    $(LIBC_PREFIX)/../../../version \
-    $(LIBC_PREFIX)/../../../Makefile.common \
-    $(LIBC_PREFIX)/../../../Makefile.config \
-    $(LIBC_PREFIX)/../../../config.h \
-    $(LIBS) \
-    \
-    $(OUTPUT) $(OUTPUT).disasm \
-    $(EXTRA_OUTPUT)
-	-[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
-
-clean:
-	rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm $(EXTRA_OUTPUT)
-	find . -name '*.o' -follow -exec rm \{\} \;
-
-build:
-
--include $(DEPEND)
-
-$(OUTPUT).disasm: $(OUTPUT)
-	$(OBJDUMP) -d $< > $@
-
-$(OUTPUT): $(LINK_SCRIPT) $(OBJECTS) $(LIBS)
-	$(LD) -T $(LINK_SCRIPT) $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
-
-%.o: %.c $(DEPEND)
-	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
-ifeq ($(PRECHECK),y)
-	$(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
-endif
-
-$(DEPEND):
-	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
-	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Index: uspace/srv/bd/ata_bd/Makefile
===================================================================
--- uspace/srv/bd/ata_bd/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/bd/ata_bd/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = ata_bd
+BINARY = ata_bd
 
 SOURCES = \
 	ata_bd.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/bd/file_bd/Makefile
===================================================================
--- uspace/srv/bd/file_bd/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/bd/file_bd/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = file_bd
+BINARY = file_bd
 
 SOURCES = \
 	file_bd.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/bd/gxe_bd/Makefile
===================================================================
--- uspace/srv/bd/gxe_bd/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/bd/gxe_bd/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = gxe_bd
+BINARY = gxe_bd
 
 SOURCES = \
 	gxe_bd.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/bd/part/guid_part/Makefile
===================================================================
--- uspace/srv/bd/part/guid_part/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/bd/part/guid_part/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,12 +28,12 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBC_PREFIX)/libc.a
+LIBS = $(LIBBLOCK_PREFIX)/libblock.a
 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX)
 
 # Correct name is 'guid_part' but must use this because of FAT 8.3 names.
-OUTPUT = g_part
+BINARY = g_part
 
 SOURCES = \
 	guid_part.c
 
-include ../../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/bd/part/mbr_part/Makefile
===================================================================
--- uspace/srv/bd/part/mbr_part/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/bd/part/mbr_part/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,11 +29,10 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBC_PREFIX)/libc.a
+LIBS = $(LIBBLOCK_PREFIX)/libblock.a
 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX)
-
-OUTPUT = mbr_part
+BINARY = mbr_part
 
 SOURCES = \
 	mbr_part.c
 
-include ../../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/bd/rd/Makefile
===================================================================
--- uspace/srv/bd/rd/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/bd/rd/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = rd
+BINARY = rd
 
 SOURCES = \
 	rd.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/clip/Makefile
===================================================================
--- uspace/srv/clip/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/clip/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = clip
+BINARY = clip
 
 SOURCES = \
 	clip.c
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/devmap/Makefile
===================================================================
--- uspace/srv/devmap/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/devmap/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = devmap
+BINARY = devmap
 
 SOURCES = \
 	devmap.c
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/fs/devfs/Makefile
===================================================================
--- uspace/srv/fs/devfs/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/fs/devfs/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,8 +29,7 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBFS_PREFIX)/libfs.a $(LIBC_PREFIX)/libc.a
+LIBS = $(LIBFS_PREFIX)/libfs.a
 EXTRA_CFLAGS += -I$(LIBFS_PREFIX)
-
-OUTPUT = devfs
+BINARY = devfs
 
 SOURCES = \
@@ -38,3 +37,3 @@
 	devfs_ops.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/fs/fat/Makefile
===================================================================
--- uspace/srv/fs/fat/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/fs/fat/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,8 +29,7 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a $(LIBC_PREFIX)/libc.a
+LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a
 EXTRA_CFLAGS += -I$(LIBBLOCK_PREFIX) -I$(LIBFS_PREFIX)
-
-OUTPUT = fat
+BINARY = fat
 
 SOURCES = \
@@ -41,3 +40,3 @@
 	fat_fat.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/fs/tmpfs/Makefile
===================================================================
--- uspace/srv/fs/tmpfs/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/fs/tmpfs/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,8 +29,7 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a $(LIBC_PREFIX)/libc.a
+LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a
 EXTRA_CFLAGS += -I$(LIBBLOCK_PREFIX) -I$(LIBFS_PREFIX)
-
-OUTPUT = tmpfs
+BINARY = tmpfs
 
 SOURCES = \
@@ -39,3 +38,3 @@
 	tmpfs_dump.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hid/adb_mouse/Makefile
===================================================================
--- uspace/srv/hid/adb_mouse/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hid/adb_mouse/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,8 +28,6 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBC_PREFIX)/libc.a
 EXTRA_CFLAGS = -Iinclude
-
-OUTPUT = adb_ms
+BINARY = adb_ms
 
 SOURCES = \
@@ -37,3 +35,3 @@
 	adb_dev.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hid/char_mouse/Makefile
===================================================================
--- uspace/srv/hid/char_mouse/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hid/char_mouse/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,8 +29,6 @@
 
 USPACE_PREFIX = ../../..
-LIBS = $(LIBC_PREFIX)/libc.a
 EXTRA_CFLAGS = -Iinclude
-
-OUTPUT = char_ms
+BINARY = char_ms
 
 SOURCES = \
@@ -39,3 +37,3 @@
 	chardev.c
 
-include ../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hid/console/Makefile
===================================================================
--- uspace/srv/hid/console/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hid/console/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,13 +28,31 @@
 #
 
-include Makefile.common
+USPACE_PREFIX = ../../..
+BINARY = console
 
-.PHONY: all clean
+GENERIC_SOURCES = \
+	console.c \
+	screenbuffer.c \
+	keybuffer.c \
+	gcons.c
 
-all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
-	-[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
-	$(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
+IMAGES = \
+	gfx/helenos.ppm \
+	gfx/nameic.ppm \
+	gfx/cons_selected.ppm \
+	gfx/cons_idle.ppm \
+	gfx/cons_has_data.ppm \
+	gfx/cons_kernel.ppm \
+	gfx/anim_1.ppm \
+	gfx/anim_2.ppm \
+	gfx/anim_3.ppm \
+	gfx/anim_4.ppm
 
-clean:
-	rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
-	find . -name '*.o' -follow -exec rm \{\} \;
+SOURCES = \
+	$(GENERIC_SOURCES) \
+	$(IMAGES)
+
+include $(USPACE_PREFIX)/Makefile.common
+
+%.o: %.ppm
+	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) $< $@
Index: uspace/srv/hid/console/Makefile.build
===================================================================
--- uspace/srv/hid/console/Makefile.build	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,82 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# 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.
-#
-
-## Setup toolchain
-#
-
-include Makefile.common
-include $(LIBC_PREFIX)/Makefile.toolchain
-
-## Sources
-#
-
-SOURCES = \
-	console.c \
-	screenbuffer.c \
-	keybuffer.c \
-	gcons.c
-
-IMAGES = \
-	gfx/helenos.ppm \
-	gfx/nameic.ppm \
-	gfx/cons_selected.ppm \
-	gfx/cons_idle.ppm \
-	gfx/cons_has_data.ppm \
-	gfx/cons_kernel.ppm \
-	gfx/anim_1.ppm \
-	gfx/anim_2.ppm \
-	gfx/anim_3.ppm \
-	gfx/anim_4.ppm
-
-OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) $(addsuffix .o,$(basename $(IMAGES)))
-
-.PHONY: all
-
-all: $(OUTPUT) $(OUTPUT).disasm
-
--include $(DEPEND)
-
-$(OUTPUT).disasm: $(OUTPUT)
-	$(OBJDUMP) -d $< > $@
-
-$(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
-
-%.o: %.c $(DEPEND)
-	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
-ifeq ($(PRECHECK),y)
-	$(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
-endif
-
-%.o: %.ppm
-	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) $< $@
-
-$(DEPEND):
-	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
-	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Index: uspace/srv/hid/console/Makefile.common
===================================================================
--- uspace/srv/hid/console/Makefile.common	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,40 +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.
-#
-
-
-## Common names
-#
-
-LIBC_PREFIX = ../../../lib/libc
-SOFTINT_PREFIX = ../../../lib/softint
-LIBS = $(LIBC_PREFIX)/libc.a
-
-DEPEND = Makefile.depend
-DEPEND_PREV = $(DEPEND).prev
-JOB = console.job
-OUTPUT = console
Index: uspace/srv/hid/fb/Makefile
===================================================================
--- uspace/srv/hid/fb/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hid/fb/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,13 +28,55 @@
 #
 
-include Makefile.common
+USPACE_PREFIX = ../../..
+BINARY = fb
 
-.PHONY: all clean
+SOURCES = \
+	main.c \
+	ppm.c
 
-all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
-	-[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
-	$(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
+ifneq ($(UARCH),ia64)
+	SOURCES += fb.c \
+		font-8x16.c
+	EXTRA_CFLAGS = -DFB_ENABLED
+endif
 
-clean:
-	rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
-	find . -name '*.o' -follow -exec rm \{\} \;
+ifeq ($(UARCH),ia32)
+	SOURCES += ega.c
+	EXTRA_CFLAGS = -DEGA_ENABLED
+endif
+
+ifeq ($(UARCH),ia64)
+	SOURCES += ega.c \
+		ski.c \
+		serial_console.c
+	EXTRA_CFLAGS = -DSKI_ENABLED -DEGA_ENABLED
+endif
+
+ifeq ($(UARCH),amd64)
+	SOURCES += ega.c
+	EXTRA_CFLAGS = -DEGA_ENABLED
+endif
+
+ifeq ($(UARCH),mips32)
+	SOURCES += msim.c \
+		serial_console.c
+	EXTRA_CFLAGS = -DMSIM_ENABLED
+endif
+
+ifeq ($(UARCH),sparc64)
+	ifeq ($(PROCESSOR), sun4v)
+		SOURCES += niagara.c \
+			serial_console.c
+		EXTRA_CFLAGS = -DNIAGARA_ENABLED
+	endif
+
+	ifeq ($(MACHINE), serengeti)
+		SOURCES += sgcn.c \
+			serial_console.c
+		EXTRA_CFLAGS = -DSGCN_ENABLED
+	endif
+endif
+
+EXTRA_CFLAGS += -D$(UARCH)
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hid/fb/Makefile.build
===================================================================
--- uspace/srv/hid/fb/Makefile.build	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,111 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# 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.
-#
-
-## Setup toolchain
-#
-
-include Makefile.common
-include $(LIBC_PREFIX)/Makefile.toolchain
-
-## Sources
-#
-
-SOURCES = \
-	main.c \
-	ppm.c
-
-ifneq ($(UARCH),ia64)
-	SOURCES += fb.c \
-		font-8x16.c
-	CFLAGS += -DFB_ENABLED
-endif
-
-ifeq ($(UARCH),ia32)
-	SOURCES += ega.c
-	CFLAGS += -DEGA_ENABLED
-endif
-
-ifeq ($(UARCH),ia64)
-	SOURCES += ega.c \
-		ski.c \
-		serial_console.c
-	CFLAGS += -DSKI_ENABLED
-	CFLAGS += -DEGA_ENABLED
-endif
-
-ifeq ($(UARCH),amd64)
-	SOURCES += ega.c
-	CFLAGS += -DEGA_ENABLED
-endif
-
-ifeq ($(UARCH),mips32)
-	SOURCES += msim.c \
-		serial_console.c
-	CFLAGS += -DMSIM_ENABLED
-endif
-
-ifeq ($(UARCH),sparc64)
-	ifeq ($(PROCESSOR), sun4v)
-		SOURCES += niagara.c \
-			serial_console.c
-		CFLAGS += -DNIAGARA_ENABLED
-	endif
-
-	ifeq ($(MACHINE), serengeti)
-		SOURCES += sgcn.c \
-			serial_console.c
-		CFLAGS += -DSGCN_ENABLED
-	endif
-endif
-
-CFLAGS += -D$(UARCH)
-
-OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
-
-.PHONY: all
-
-all: $(OUTPUT) $(OUTPUT).disasm
-
--include $(DEPEND)
-
-$(OUTPUT).disasm: $(OUTPUT)
-	$(OBJDUMP) -d $< > $@
-
-$(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
-
-%.o: %.c $(DEPEND)
-	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
-ifeq ($(PRECHECK),y)
-	$(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
-endif
-
-$(DEPEND):
-	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
-	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Index: uspace/srv/hid/fb/Makefile.common
===================================================================
--- uspace/srv/hid/fb/Makefile.common	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,40 +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.
-#
-
-
-## Common names
-#
-
-LIBC_PREFIX = ../../../lib/libc
-SOFTINT_PREFIX = ../../../lib/softint
-LIBS = $(LIBC_PREFIX)/libc.a
-
-DEPEND = Makefile.depend
-DEPEND_PREV = $(DEPEND).prev
-JOB = fb.job
-OUTPUT = fb
Index: uspace/srv/hid/kbd/Makefile
===================================================================
--- uspace/srv/hid/kbd/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hid/kbd/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,13 +28,135 @@
 #
 
-include Makefile.common
+USPACE_PREFIX = ../../..
+ROOT_PATH = $(USPACE_PREFIX)/..
 
-.PHONY: all clean
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
 
-all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
-	-[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
-	$(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
+EXTRA_CFLAGS = -Iinclude
+BINARY = kbd
 
-clean:
-	rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
-	find . -name '*.o' -follow -exec rm \{\} \;
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
+
+## Sources
+#
+
+SOURCES = \
+	generic/kbd.c \
+	genarch/gsp.c \
+	genarch/stroke.c \
+	layout/cz.c \
+	layout/us_qwerty.c \
+	layout/us_dvorak.c
+
+ifeq ($(UARCH),amd64)
+	SOURCES += \
+		port/chardev.c \
+		ctl/pc.c
+endif
+
+ifeq ($(UARCH),arm32)
+	ifeq ($(MACHINE),testarm)
+		SOURCES += \
+			port/gxemul.c
+		
+		ifeq ($(CONFIG_FB),y)
+			SOURCES += \
+				ctl/gxe_fb.c
+		else
+			SOURCES += \
+				ctl/stty.c
+		endif
+	endif
+	ifeq ($(MACHINE),integratorcp)
+		SOURCES += \
+			port/pl050.c \
+			ctl/pl050.c
+	endif
+endif
+
+ifeq ($(UARCH),ia32)
+	SOURCES += \
+		port/chardev.c \
+		ctl/pc.c
+endif
+
+ifeq ($(MACHINE),i460GX)
+	SOURCES += \
+		port/chardev.c \
+		ctl/pc.c
+endif
+
+ifeq ($(MACHINE),ski)
+	SOURCES += \
+		port/ski.c \
+		ctl/stty.c
+endif
+
+ifeq ($(MACHINE),msim)
+	SOURCES += \
+		port/msim.c \
+		ctl/stty.c
+endif
+
+ifeq ($(MACHINE),lgxemul)
+	SOURCES += \
+		port/gxemul.c
+	
+	ifeq ($(CONFIG_FB),y)
+		SOURCES += \
+			ctl/gxe_fb.c
+	else
+		SOURCES += \
+			ctl/stty.c
+	endif
+endif
+
+ifeq ($(MACHINE),bgxemul)
+	SOURCES += \
+		port/gxemul.c
+	
+	ifeq ($(CONFIG_FB),y)
+		SOURCES += \
+			ctl/gxe_fb.c
+	else
+		SOURCES += \
+			ctl/stty.c
+	endif
+endif
+
+ifeq ($(UARCH),ppc32)
+	SOURCES += \
+		port/adb.c \
+		ctl/apple.c
+endif
+
+ifeq ($(UARCH),sparc64)
+	ifeq ($(PROCESSOR),sun4v)
+		SOURCES += \
+			port/niagara.c \
+			ctl/stty.c
+	else
+		ifeq ($(MACHINE),serengeti)
+			SOURCES += \
+				port/sgcn.c \
+				ctl/stty.c
+		endif
+		ifeq ($(MACHINE),generic)
+			SOURCES += \
+			port/sun.c \
+			port/z8530.c \
+			port/ns16550.c \
+			ctl/sun.c
+		endif
+	endif
+endif
+
+ifeq ($(UARCH),abs32le)
+	SOURCES += \
+		port/dummy.c \
+		ctl/pc.c
+endif
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hid/kbd/Makefile.build
===================================================================
--- uspace/srv/hid/kbd/Makefile.build	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,180 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# 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.
-#
-
-## Setup toolchain
-#
-
-include Makefile.common
-include $(LIBC_PREFIX)/Makefile.toolchain
-
-CFLAGS += -Iinclude
-
-## Sources
-#
-
-SOURCES = \
-	generic/kbd.c \
-	genarch/gsp.c \
-	genarch/stroke.c \
-	layout/cz.c \
-	layout/us_qwerty.c \
-	layout/us_dvorak.c
-
-ifeq ($(UARCH),amd64)
-	SOURCES += \
-		port/chardev.c \
-		ctl/pc.c
-endif
-
-ifeq ($(UARCH),arm32)
-	ifeq ($(MACHINE),testarm)
-		SOURCES += \
-			port/gxemul.c
-		
-		ifeq ($(CONFIG_FB),y)
-			SOURCES += \
-				ctl/gxe_fb.c
-		else
-			SOURCES += \
-				ctl/stty.c
-		endif
-	endif
-	ifeq ($(MACHINE),integratorcp)
-		SOURCES += \
-			port/pl050.c \
-			ctl/pl050.c
-	endif
-endif
-
-ifeq ($(UARCH),ia32)
-	SOURCES += \
-		port/chardev.c \
-		ctl/pc.c
-endif
-
-ifeq ($(MACHINE),i460GX)
-	SOURCES += \
-		port/chardev.c \
-		ctl/pc.c
-endif
-
-ifeq ($(MACHINE),ski)
-	SOURCES += \
-		port/ski.c \
-		ctl/stty.c
-endif
-
-ifeq ($(MACHINE),msim)
-	SOURCES += \
-		port/msim.c \
-		ctl/stty.c
-endif
-
-ifeq ($(MACHINE),lgxemul)
-	SOURCES += \
-		port/gxemul.c
-	
-	ifeq ($(CONFIG_FB),y)
-		SOURCES += \
-			ctl/gxe_fb.c
-	else
-		SOURCES += \
-			ctl/stty.c
-	endif
-endif
-
-ifeq ($(MACHINE),bgxemul)
-	SOURCES += \
-		port/gxemul.c
-	
-	ifeq ($(CONFIG_FB),y)
-		SOURCES += \
-			ctl/gxe_fb.c
-	else
-		SOURCES += \
-			ctl/stty.c
-	endif
-endif
-
-ifeq ($(UARCH),ppc32)
-	SOURCES += \
-		port/adb.c \
-		ctl/apple.c
-endif
-
-ifeq ($(UARCH),sparc64)
-	ifeq ($(PROCESSOR),sun4v)
-		SOURCES += \
-			port/niagara.c \
-			ctl/stty.c
-	else
-		ifeq ($(MACHINE),serengeti)
-			SOURCES += \
-				port/sgcn.c \
-				ctl/stty.c
-		endif
-		ifeq ($(MACHINE),generic)
-			SOURCES += \
-			port/sun.c \
-			port/z8530.c \
-			port/ns16550.c \
-			ctl/sun.c
-		endif
-	endif
-endif
-
-ifeq ($(UARCH),abs32le)
-	SOURCES += \
-		port/dummy.c \
-		ctl/pc.c
-endif
-
-OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
-
-.PHONY: all
-
-all: $(OUTPUT) $(OUTPUT).disasm
-
--include $(DEPEND)
-
-$(OUTPUT).disasm: $(OUTPUT)
-	$(OBJDUMP) -d $< > $@
-
-$(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
-
-%.o: %.c $(DEPEND)
-	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
-ifeq ($(PRECHECK),y)
-	$(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
-endif
-
-$(DEPEND):
-	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
-	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Index: uspace/srv/hid/kbd/Makefile.common
===================================================================
--- uspace/srv/hid/kbd/Makefile.common	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,40 +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.
-#
-
-
-## Common names
-#
-
-LIBC_PREFIX = ../../../lib/libc
-SOFTINT_PREFIX = ../../../lib/softint
-LIBS = $(LIBC_PREFIX)/libc.a
-
-DEPEND = Makefile.depend
-DEPEND_PREV = $(DEPEND).prev
-JOB = kbd.job
-OUTPUT = kbd
Index: uspace/srv/hw/bus/cuda_adb/Makefile
===================================================================
--- uspace/srv/hw/bus/cuda_adb/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hw/bus/cuda_adb/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,11 +28,8 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = cuda_adb
+BINARY = cuda_adb
 
 SOURCES = \
 	cuda_adb.c
 
-include ../../../Makefile.common
-
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hw/bus/pci/Makefile
===================================================================
--- uspace/srv/hw/bus/pci/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hw/bus/pci/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,11 +29,10 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBPCI_PREFIX)/libpci.a $(LIBC_PREFIX)/libc.a
+LIBS = $(LIBPCI_PREFIX)/libpci.a
 EXTRA_CFLAGS = -I$(LIBPCI_PREFIX)
-
-OUTPUT = pci
+BINARY = pci
 
 SOURCES = \
 	pci.c
 
-include ../../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hw/char/i8042/Makefile
===================================================================
--- uspace/srv/hw/char/i8042/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hw/char/i8042/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = i8042
+BINARY = i8042
 
 SOURCES = \
 	i8042.c
 
-include ../../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hw/cir/fhc/Makefile
===================================================================
--- uspace/srv/hw/cir/fhc/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hw/cir/fhc/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = fhc
+BINARY = fhc
 
 SOURCES = \
 	fhc.c
 
-include ../../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/hw/cir/obio/Makefile
===================================================================
--- uspace/srv/hw/cir/obio/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/hw/cir/obio/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,10 +29,8 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = obio
+BINARY = obio
 
 SOURCES = \
 	obio.c
 
-include ../../../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/loader/Makefile
===================================================================
--- uspace/srv/loader/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,15 +28,20 @@
 #
 
--include ../../../Makefile.common
--include ../../../Makefile.config
+USPACE_PREFIX = ../..
+ROOT_PATH = $(USPACE_PREFIX)/..
+
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
+
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
 -include arch/$(UARCH)/Makefile.inc
 
-USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-EXTRA_CFLAGS += -Iinclude
-LINK_SCRIPT = arch/$(UARCH)/_link.ld
+LINKER_SCRIPT = arch/$(UARCH)/_link.ld
+EXTRA_CLEAN = $(LINKER_SCRIPT)
 
-OUTPUT = loader
-EXTRA_OUTPUT = $(LINK_SCRIPT)
+EXTRA_CFLAGS = -Iinclude
+
+BINARY = loader
 
 GENERIC_SOURCES = \
@@ -45,9 +50,10 @@
 	interp.s
 
-SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES)
-OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
+SOURCES = \
+	$(GENERIC_SOURCES) \
+	$(ARCH_SOURCES)
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
 
-$(LINK_SCRIPT): $(LINK_SCRIPT).in
+$(LINKER_SCRIPT): $(LINKER_SCRIPT).in
 	$(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
Index: uspace/srv/loader/arch/abs32le/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/abs32le/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/abs32le/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,3 +27,3 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/abs32le.c
+ARCH_SOURCES = arch/$(UARCH)/abs32le.c
Index: uspace/srv/loader/arch/amd64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/amd64/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/amd64/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,3 +27,3 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/amd64.s
+ARCH_SOURCES = arch/$(UARCH)/amd64.s
Index: uspace/srv/loader/arch/arm32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/arm32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/arm32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,3 +27,3 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/arm32.s
+ARCH_SOURCES = arch/$(UARCH)/arm32.s
Index: uspace/srv/loader/arch/ia32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/ia32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,3 +27,3 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/ia32.s
+ARCH_SOURCES = arch/$(UARCH)/ia32.s
Index: uspace/srv/loader/arch/ia64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia64/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/ia64/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,4 +27,4 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/ia64.s
+ARCH_SOURCES = arch/$(UARCH)/ia64.s
 AFLAGS += -xexplicit
Index: uspace/srv/loader/arch/mips32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/mips32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/mips32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,3 +27,3 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/mips32.s
+ARCH_SOURCES = arch/$(UARCH)/mips32.s
Index: uspace/srv/loader/arch/ppc32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ppc32/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/ppc32/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,3 +27,3 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/ppc32.s
+ARCH_SOURCES = arch/$(UARCH)/ppc32.s
Index: uspace/srv/loader/arch/sparc64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/sparc64/Makefile.inc	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/loader/arch/sparc64/Makefile.inc	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -27,3 +27,3 @@
 #
 
-ARCH_SOURCES := arch/$(UARCH)/sparc64.s
+ARCH_SOURCES = arch/$(UARCH)/sparc64.s
Index: uspace/srv/net/Makefile
===================================================================
--- uspace/srv/net/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,92 +1,0 @@
-#
-# Copyright (c) 2009 Lukas Mejdrech
-# 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.
-#
-
-include ../../../Makefile.common
-include ../../../Makefile.config
-
-# keep netif drivers before nil modules
-# in order to support networking architectures build
-
-ifeq ($(CONFIG_NETIF_DP8390),y)
-	DIRS = netif/dp8390
-else
-	DIRS =
-endif
-
-DIRS += \
-	netif/lo \
-	nil/eth \
-	nil/nildummy \
-	net \
-	net/start \
-	socket \
-	app/echo \
-	app/ping \
-	app/nettest1 \
-	app/nettest2
-
-DIRS_MODULAR = \
-		il/arp \
-		il/ip \
-		tl/icmp \
-		tl/udp \
-		tl/tcp \
-
-DIRS_ALL = $(DIRS) $(DIRS_MODULAR)
-
-ifeq ($(NETWORKING), module)
-	BUILDS := $(addsuffix .build,$(DIRS))
-else
-ifeq ($(NETWORKING), modular)
-	BUILDS := $(addsuffix .build,$(DIRS_ALL))
-endif
-endif
-
-CLEANS := $(addsuffix .clean,$(DIRS_ALL))
-
-CHECKS := $(addsuffix .check,$(basename $(BUILDS)))
-
-.PHONY: all build $(BUILDS) $(CLEANS) clean
-
-all: $(BUILDS)
-
-build: $(BUILDS)
-
-check: $(CHECKS)
-
-clean: $(CLEANS)
-	find $(DIRS_ALL) ./ -name '*.o' -follow -exec rm \{\} \;
-
-$(CHECKS):
-	-$(MAKE) -C $(basename $@) check
-
-$(CLEANS):
-	-$(MAKE) -C $(basename $@) clean
-
-$(BUILDS):
-	$(MAKE) -C $(basename $@) all
Index: uspace/srv/net/Makefile.module
===================================================================
--- uspace/srv/net/Makefile.module	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#
-# Copyright (c) 2009 Lukas Mejdrech
-# 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.
-#
-
-## Setup toolchain
-#
-
-LIBC_PREFIX = $(NET_BASE)../../lib/libc
-SOFTINT_PREFIX = $(NET_BASE)../../lib/softint
-include $(LIBC_PREFIX)/Makefile.toolchain
-
-CFLAGS += -Iinclude -I../libadt/include
-CFLAGS += -Wno-strict-aliasing
-
-CHECK_CFLAGS = -fsyntax-only -Wextra -Wno-div-by-zero -Wsystem-headers -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wno-endif-labels -Wshadow -Wlarger-than-1500 -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Wunreachable-code -Winline -Winvalid-pch -Wlong-long -Wvariadic-macros -Wdisabled-optimization -Wno-pointer-sign
-#-Wtraditional
-
-LIBS += $(LIBC_PREFIX)/libc.a
-
-DEPEND = Makefile.depend
-DEPEND_PREV = $(DEPEND).prev
-
-DEFS += $(NET_DEFS)
-
-OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
-DISASMS := $(addsuffix .disasm,$(basename $(OUTPUT)))
-
-.PHONY: all clean disasm
-
-all: $(OUTPUT) $(LIB) $(DISASMS)
-
-check:
-	$(CC) $(DEFS) $(CFLAGS) $(CHECK_CFLAGS) *.c
-
--include $(DEPEND)
-
-clean:
-	-rm -f $(OUTPUT) $(LIB) $(OUTPUT).map $(addsuffix .map,$(basename $(SOURCES))) $(DISASMS) $(DEPEND)
-
-$(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
-
-$(LIB): $(OBJECTS)
-	$(AR) rc $(LIB) $(OBJECTS)
-
-disasm: $(DISASMS)
-
-%.disasm: %
-	$(OBJDUMP) -d $< >$@
-
-%.o: %.S
-	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
-
-%.o: %.s
-	$(AS) $(AFLAGS) $< -o $@
-
-%.o: %.c $(DEPEND)
-	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
-
-$(DEPEND):
-	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
-	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Index: uspace/srv/net/app/echo/Makefile
===================================================================
--- uspace/srv/net/app/echo/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/app/echo/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,22 +28,13 @@
 #
 
-NAME = echo
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+LIBS = $(NET_BASE)/socket/libsocket.a
+BINARY = echo
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	echo.c \
+	$(NET_BASE)/app/parse.c \
+	$(NET_BASE)/app/print_error.c
 
-include ../../../../../Makefile.common
-include ../../../../../Makefile.config
-
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NET_BASE)app/parse.c \
-	$(NET_BASE)app/print_error.c
-
-LIBS += ../../socket/libsocket.a
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/app/nettest1/Makefile
===================================================================
--- uspace/srv/net/app/nettest1/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/app/nettest1/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,23 +28,14 @@
 #
 
-NAME = nettest1
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+LIBS = $(NET_BASE)/socket/libsocket.a
+BINARY = nettest1
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	nettest1.c \
+	$(NET_BASE)/app/nettest.c \
+	$(NET_BASE)/app/parse.c \
+	$(NET_BASE)/app/print_error.c
 
-include ../../../../../Makefile.common
-include ../../../../../Makefile.config
-
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NET_BASE)app/nettest.c \
-	$(NET_BASE)app/parse.c \
-	$(NET_BASE)app/print_error.c
-
-LIBS += ../../socket/libsocket.a
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/app/nettest2/Makefile
===================================================================
--- uspace/srv/net/app/nettest2/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/app/nettest2/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,23 +28,14 @@
 #
 
-NAME = nettest2
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+LIBS = $(NET_BASE)/socket/libsocket.a
+BINARY = nettest2
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	nettest2.c \
+	$(NET_BASE)/app/nettest.c \
+	$(NET_BASE)/app/parse.c \
+	$(NET_BASE)/app/print_error.c
 
-include ../../../../../Makefile.common
-include ../../../../../Makefile.config
-
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NET_BASE)app/nettest.c \
-	$(NET_BASE)app/parse.c \
-	$(NET_BASE)app/print_error.c
-
-LIBS += ../../socket/libsocket.a
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/app/ping/Makefile
===================================================================
--- uspace/srv/net/app/ping/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/app/ping/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,24 +28,17 @@
 #
 
-NAME = ping
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+LIBS = $(NET_BASE)/socket/libsocket.a
+BINARY = ping
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	ping.c \
+	$(NET_BASE)/app/parse.c \
+	$(NET_BASE)/app/print_error.c \
+	$(NET_BASE)/inet.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/tl/icmp/icmp_api.c \
+	$(NET_BASE)/tl/icmp/icmp_common.c
 
-include ../../../../../Makefile.common
-include ../../../../../Makefile.config
-
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NET_BASE)app/parse.c \
-	$(NET_BASE)app/print_error.c \
-	$(NET_BASE)inet.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)tl/icmp/icmp_api.c \
-	$(NET_BASE)tl/icmp/icmp_common.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/il/arp/Makefile
===================================================================
--- uspace/srv/net/il/arp/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/il/arp/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,25 +28,20 @@
 #
 
-NAME = arp
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = arp
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	arp.c \
+	arp_module.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/nil/nil_remote.c \
+	$(NET_BASE)/structures/char_map.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NAME)_module.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)net/net_remote.c \
-	$(NET_BASE)nil/nil_remote.c \
-	$(STRUCTURES)char_map.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/il/ip/Makefile
===================================================================
--- uspace/srv/net/il/ip/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/il/ip/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,33 +28,28 @@
 #
 
-NAME = ip
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = ip
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	ip.c \
+	ip_client.c \
+	ip_module.c \
+	$(NET_BASE)/checksum.c \
+	$(NET_BASE)/inet.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/il/arp/arp_remote.c \
+	$(NET_BASE)/nil/nil_remote.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/tl/icmp/icmp_client.c \
+	$(NET_BASE)/tl/icmp/icmp_common.c \
+	$(NET_BASE)/tl/icmp/icmp_remote.c \
+	$(NET_BASE)/structures/char_map.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/module_map.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NAME)_client.c \
-	$(NAME)_module.c \
-	$(NET_BASE)checksum.c \
-	$(NET_BASE)inet.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)il/arp/arp_remote.c \
-	$(NET_BASE)nil/nil_remote.c \
-	$(NET_BASE)net/net_remote.c \
-	$(NET_BASE)tl/icmp/icmp_client.c \
-	$(NET_BASE)tl/icmp/icmp_common.c \
-	$(NET_BASE)tl/icmp/icmp_remote.c \
-	$(STRUCTURES)char_map.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)module_map.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/net/Makefile
===================================================================
--- uspace/srv/net/net/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/net/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,50 +28,50 @@
 #
 
-NAME = net
+NET_BASE = ..
+USPACE_PREFIX = ../../..
+ROOT_PATH = $(USPACE_PREFIX)/..
 
-NET_BASE = ../
-STRUCTURES = $(NET_BASE)structures/
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
 
-include $(NET_BASE)../../../Makefile.common
-include $(NET_BASE)../../../Makefile.config
+BINARY = net
 
-## Sources
-#
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
 
-OUTPUT = $(NAME)
 SOURCES = \
-	$(NAME).c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)netif/netif_remote.c \
-	$(STRUCTURES)char_map.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)module_map.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_server.c
+	net.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/netif/netif_remote.c \
+	$(NET_BASE)/structures/char_map.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/module_map.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_server.c
 
-ifeq ($(NETWORKING), module)
-
-	SOURCES +=	$(NAME)_bundle.c \
-				$(NET_BASE)checksum.c \
-				$(NET_BASE)inet.c \
-				$(NET_BASE)il/arp/arp.c \
-				$(NET_BASE)il/ip/ip.c \
-				$(NET_BASE)il/ip/ip_client.c \
-				$(NET_BASE)socket/socket_core.c \
-				$(NET_BASE)tl/icmp/icmp.c \
-				$(NET_BASE)tl/icmp/icmp_client.c \
-				$(NET_BASE)tl/tcp/tcp.c \
-				$(NET_BASE)tl/tl_common.c \
-				$(NET_BASE)tl/udp/udp.c \
-				$(STRUCTURES)dynamic_fifo.c
-
-else
-
-	SOURCES +=	$(NAME)_standalone.c \
-				$(NET_BASE)il/ip/ip_remote.c
-
+ifeq ($(CONFIG_NETWORKING),module)
+	SOURCES += \
+		net_bundle.c \
+		$(NET_BASE)/checksum.c \
+		$(NET_BASE)/inet.c \
+		$(NET_BASE)/il/arp/arp.c \
+		$(NET_BASE)/il/ip/ip.c \
+		$(NET_BASE)/il/ip/ip_client.c \
+		$(NET_BASE)/socket/socket_core.c \
+		$(NET_BASE)/tl/icmp/icmp.c \
+		$(NET_BASE)/tl/icmp/icmp_client.c \
+		$(NET_BASE)/tl/tcp/tcp.c \
+		$(NET_BASE)/tl/tl_common.c \
+		$(NET_BASE)/tl/udp/udp.c \
+		$(NET_BASE)/structures/dynamic_fifo.c
 endif
 
-include $(NET_BASE)Makefile.module
+ifeq ($(CONFIG_NETWORKING),modular)
+	SOURCES += \
+		net_standalone.c \
+		$(NET_BASE)/il/ip/ip_remote.c
+endif
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/net/start/Makefile
===================================================================
--- uspace/srv/net/net/start/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/net/start/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,24 +28,16 @@
 #
 
-NAME = netstart
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = netstart
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	netstart.c \
+	$(NET_BASE)/checksum.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/self_test.c \
+	$(NET_BASE)/structures/char_map.c \
+	$(NET_BASE)/structures/dynamic_fifo.c \
+	$(NET_BASE)/structures/measured_strings.c
 
-include ../../../../../Makefile.common
-include ../../../../../Makefile.config
-
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NET_BASE)checksum.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)self_test.c \
-	$(STRUCTURES)char_map.c \
-	$(STRUCTURES)dynamic_fifo.c \
-	$(STRUCTURES)measured_strings.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/netif/dp8390/Makefile
===================================================================
--- uspace/srv/net/netif/dp8390/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/netif/dp8390/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,41 +28,41 @@
 #
 
-NAME = dp8390
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+ROOT_PATH = $(USPACE_PREFIX)/..
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
 
-include $(NET_BASE)../../../Makefile.common
-include $(NET_BASE)../../../Makefile.config
+BINARY = dp8390
 
-## Sources
-#
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
 
-OUTPUT = $(NAME)
 SOURCES = \
-	$(NAME).c \
-	$(NAME)_module.c \
+	dp8390.c \
+	dp8390_module.c \
 	ne2000.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)netif/netif.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/netif/netif.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-ifeq ($(NETWORKING), module)
-
-	SOURCES +=	$(NET_BASE)checksum.c \
-				$(NET_BASE)nil/eth/eth.c \
-				$(NET_BASE)net/net_remote.c \
-				$(NET_BASE)netif/netif_nil_bundle.c
-
-else
-
-	SOURCES += 	$(NET_BASE)nil/nil_remote.c \
-				$(NET_BASE)netif/netif_standalone.c
-
+ifeq ($(CONFIG_NETWORKING),module)
+	SOURCES += \
+		$(NET_BASE)/checksum.c \
+		$(NET_BASE)/nil/eth/eth.c \
+		$(NET_BASE)/net/net_remote.c \
+		$(NET_BASE)/netif/netif_nil_bundle.c
 endif
 
-include $(NET_BASE)Makefile.module
+ifeq ($(CONFIG_NETWORKING),modular)
+	SOURCES += \
+		$(NET_BASE)/nil/nil_remote.c \
+		$(NET_BASE)/netif/netif_standalone.c
+endif
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/netif/lo/Makefile
===================================================================
--- uspace/srv/net/netif/lo/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/netif/lo/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,38 +28,38 @@
 #
 
-NAME = lo
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+ROOT_PATH = $(USPACE_PREFIX)/..
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
 
-include $(NET_BASE)../../../Makefile.common
-include $(NET_BASE)../../../Makefile.config
+BINARY = lo
 
-## Sources
-#
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
 
-OUTPUT = $(NAME)
 SOURCES = \
-	$(NAME).c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)net/net_remote.c \
-	$(NET_BASE)netif/netif.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
+	lo.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/netif/netif.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-ifeq ($(NETWORKING), module)
-
-	SOURCES +=	$(NET_BASE)nil/nildummy/nildummy.c \
-				$(NET_BASE)netif/netif_nil_bundle.c
-
-else
-
-	SOURCES += 	$(NET_BASE)nil/nil_remote.c \
-				$(NET_BASE)netif/netif_standalone.c
-
+ifeq ($(CONFIG_NETWORKING),module)
+	SOURCES += \
+		$(NET_BASE)/nil/nildummy/nildummy.c \
+		$(NET_BASE)/netif/netif_nil_bundle.c
 endif
 
-include $(NET_BASE)Makefile.module
+ifeq ($(CONFIG_NETWORKING),modular)
+	SOURCES += \
+		$(NET_BASE)/nil/nil_remote.c \
+		$(NET_BASE)/netif/netif_standalone.c
+endif
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/nil/eth/Makefile
===================================================================
--- uspace/srv/net/nil/eth/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/nil/eth/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,22 +28,20 @@
 #
 
-NAME = eth
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = eth
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	eth.c \
+	eth_module.c \
+	$(NET_BASE)/checksum.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/netif/netif_remote.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NAME)_module.c \
-	$(NET_BASE)checksum.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)net/net_remote.c \
-	$(NET_BASE)netif/netif_remote.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/nil/nildummy/Makefile
===================================================================
--- uspace/srv/net/nil/nildummy/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/nil/nildummy/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,21 +28,19 @@
 #
 
-NAME = nildummy
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = nildummy
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	nildummy.c \
+	nildummy_module.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/netif/netif_remote.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NAME)_module.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)net/net_remote.c \
-	$(NET_BASE)netif/netif_remote.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/socket/Makefile
===================================================================
--- uspace/srv/net/socket/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/socket/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,18 +28,13 @@
 #
 
-NAME = socket
+NET_BASE = ..
+USPACE_PREFIX = ../../..
+LIBRARY = libsocket
 
-NET_BASE = ../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	socket_client.c \
+	$(NET_BASE)/inet.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/structures/dynamic_fifo.c
 
-## Sources
-#
-
-LIB = lib$(NAME).a
-SOURCES = \
-	$(NAME)_client.c \
-	$(NET_BASE)inet.c \
-	$(NET_BASE)modules.c \
-	$(STRUCTURES)dynamic_fifo.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/tl/icmp/Makefile
===================================================================
--- uspace/srv/net/tl/icmp/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/tl/icmp/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,27 +28,22 @@
 #
 
-NAME = icmp
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = icmp
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	icmp.c \
+	icmp_module.c \
+	icmp_client.c \
+	$(NET_BASE)/checksum.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/il/ip/ip_client.c \
+	$(NET_BASE)/il/ip/ip_remote.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NAME)_module.c \
-	$(NAME)_client.c \
-	$(NET_BASE)checksum.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)il/ip/ip_client.c \
-	$(NET_BASE)il/ip/ip_remote.c \
-	$(NET_BASE)net/net_remote.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/tl/tcp/Makefile
===================================================================
--- uspace/srv/net/tl/tcp/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/tl/tcp/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,33 +28,28 @@
 #
 
-NAME = tcp
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = tcp
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	tcp.c \
+	tcp_module.c \
+	$(NET_BASE)/checksum.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/il/ip/ip_client.c \
+	$(NET_BASE)/il/ip/ip_remote.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/socket/socket_core.c \
+	$(NET_BASE)/tl/icmp/icmp_client.c \
+	$(NET_BASE)/tl/icmp/icmp_common.c \
+	$(NET_BASE)/tl/icmp/icmp_remote.c \
+	$(NET_BASE)/tl/tl_common.c \
+	$(NET_BASE)/structures/char_map.c \
+	$(NET_BASE)/structures/dynamic_fifo.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NAME)_module.c \
-	$(NET_BASE)checksum.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)il/ip/ip_client.c \
-	$(NET_BASE)il/ip/ip_remote.c \
-	$(NET_BASE)net/net_remote.c \
-	$(NET_BASE)socket/socket_core.c \
-	$(NET_BASE)tl/icmp/icmp_client.c \
-	$(NET_BASE)tl/icmp/icmp_common.c \
-	$(NET_BASE)tl/icmp/icmp_remote.c \
-	$(NET_BASE)tl/tl_common.c \
-	$(STRUCTURES)char_map.c \
-	$(STRUCTURES)dynamic_fifo.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/tl/udp/Makefile
===================================================================
--- uspace/srv/net/tl/udp/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/net/tl/udp/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -1,4 +1,5 @@
 #
-# Copyright (c) 2009 Lukas Mejdrech
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
 # All rights reserved.
 #
@@ -27,33 +28,28 @@
 #
 
-NAME = udp
+NET_BASE = ../..
+USPACE_PREFIX = ../../../..
+BINARY = udp
 
-NET_BASE = ../../
-STRUCTURES = $(NET_BASE)structures/
+SOURCES = \
+	udp.c \
+	udp_module.c \
+	$(NET_BASE)/checksum.c \
+	$(NET_BASE)/module.c \
+	$(NET_BASE)/modules.c \
+	$(NET_BASE)/il/ip/ip_client.c \
+	$(NET_BASE)/il/ip/ip_remote.c \
+	$(NET_BASE)/net/net_remote.c \
+	$(NET_BASE)/socket/socket_core.c \
+	$(NET_BASE)/tl/icmp/icmp_client.c \
+	$(NET_BASE)/tl/icmp/icmp_common.c \
+	$(NET_BASE)/tl/icmp/icmp_remote.c \
+	$(NET_BASE)/tl/tl_common.c \
+	$(NET_BASE)/structures/char_map.c \
+	$(NET_BASE)/structures/dynamic_fifo.c \
+	$(NET_BASE)/structures/measured_strings.c \
+	$(NET_BASE)/structures/packet/packet.c \
+	$(NET_BASE)/structures/packet/packet_client.c \
+	$(NET_BASE)/structures/packet/packet_remote.c
 
-## Sources
-#
-
-OUTPUT = $(NAME)
-SOURCES = \
-	$(NAME).c \
-	$(NAME)_module.c \
-	$(NET_BASE)checksum.c \
-	$(NET_BASE)module.c \
-	$(NET_BASE)modules.c \
-	$(NET_BASE)il/ip/ip_client.c \
-	$(NET_BASE)il/ip/ip_remote.c \
-	$(NET_BASE)net/net_remote.c \
-	$(NET_BASE)socket/socket_core.c \
-	$(NET_BASE)tl/icmp/icmp_client.c \
-	$(NET_BASE)tl/icmp/icmp_common.c \
-	$(NET_BASE)tl/icmp/icmp_remote.c \
-	$(NET_BASE)tl/tl_common.c \
-	$(STRUCTURES)char_map.c \
-	$(STRUCTURES)dynamic_fifo.c \
-	$(STRUCTURES)measured_strings.c \
-	$(STRUCTURES)packet/packet.c \
-	$(STRUCTURES)packet/packet_client.c \
-	$(STRUCTURES)packet/packet_remote.c
-
-include $(NET_BASE)Makefile.module
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/ns/Makefile
===================================================================
--- uspace/srv/ns/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/ns/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,7 +29,5 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = ns
+BINARY = ns
 
 SOURCES = \
@@ -39,3 +37,3 @@
 	task.c
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/taskmon/Makefile
===================================================================
--- uspace/srv/taskmon/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/taskmon/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -28,10 +28,8 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = taskmon
+BINARY = taskmon
 
 SOURCES = \
 	taskmon.c
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/vfs/Makefile
===================================================================
--- uspace/srv/vfs/Makefile	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/vfs/Makefile	(revision 1b1164e8b3cea0b45a167fb0933b14cf0c22c374)
@@ -29,7 +29,5 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = vfs
+BINARY = vfs
 
 SOURCES = \
@@ -41,3 +39,3 @@
 	vfs_register.c
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
