Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 6d15572dfd149e15e038621d23fb73f4628be9de)
+++ uspace/Makefile	(revision d432c028782d85132212255a1f5ce1cb777ca66d)
@@ -202,5 +202,9 @@
 #
 
-LIBC = lib/c
+BASE_LIBS = \
+	lib/c \
+	lib/softint \
+	lib/softfloat
+
 LIBS = \
 	lib/fs \
@@ -213,6 +217,4 @@
 	lib/scsi \
 	lib/compress \
-	lib/softint \
-	lib/softfloat \
 	lib/drv \
 	lib/graph \
@@ -241,16 +243,15 @@
 	lib/ieee80211
 
-LIBC_BUILD = $(addsuffix .build,$(LIBC))
-LIBS_BUILD = $(addsuffix .build,$(LIBS))
-BUILDS := $(addsuffix .build,$(DIRS))
-BUILDS_TESTS := $(addsuffix .build-test,$(DIRS) $(LIBS) lib/c)
-
-CLEANS := $(addsuffix .clean,$(DIRS)) $(addsuffix .clean,$(LIBS)) $(addsuffix .clean,$(LIBC))
-
-.PHONY: all $(LIBC_BUILD) $(LIBS_BUILD) $(BUILDS) $(CLEANS) clean
+BASE_BUILDS := $(addsuffix .build,$(BASE_LIBS))
+BUILDS := $(addsuffix .build,$(DIRS) $(LIBS))
+BUILDS_TESTS := $(addsuffix .build-test,$(DIRS) $(LIBS) $(BASE_LIBS))
+DEPS = $(addsuffix /deps.mk,$(DIRS) $(LIBS))
+CLEANS := $(addsuffix .clean,$(DIRS) $(LIBS) $(BASE_LIBS))
+
+.PHONY: all $(BASE_BUILDS) $(BUILDS) $(BUILDS_TESTS) $(CLEANS) clean
 
 all: $(BUILDS) $(BUILDS_TESTS)
 
-$(BUILDS_TESTS): $(LIBC_BUILD) $(LIBS_BUILD)
+$(BUILDS_TESTS): $(BASE_BUILDS) $(BUILDS)
 	$(MAKE) -r -C $(basename $@) all-test PRECHECK=$(PRECHECK)
 
@@ -264,10 +265,15 @@
 	-$(MAKE) -r -C $(basename $@) clean
 
-$(BUILDS): $(LIBC_BUILD) $(LIBS_BUILD)
+$(BASE_BUILDS) $(BUILDS):
 	$(MAKE) -r -C $(basename $@) all PRECHECK=$(PRECHECK)
 
-$(LIBS_BUILD): $(LIBC_BUILD)
-	$(MAKE) -r -C $(basename $@) all PRECHECK=$(PRECHECK)
-
-$(LIBC_BUILD):
-	$(MAKE) -r -C $(basename $@) all PRECHECK=$(PRECHECK)
+$(DEPS): %/deps.mk: %/Makefile
+	$(MAKE) -r -C $(@D) deps.mk SELF_TARGET="$(@D).build"
+
+# Special case for base libraries.
+lib/c.build: lib/softfloat.build lib/softint.build
+
+$(BUILDS): $(BASE_BUILDS)
+
+-include $(DEPS)
+
