Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/Makefile.common	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -44,5 +44,4 @@
 #   EXTRA_CLEAN        additional cleanup targets
 #
-#   MATH               set to 'y' to use the math library
 #   POSIX_COMPAT       set to 'y' to use POSIX compatibility layer
 #
@@ -140,13 +139,7 @@
 ifeq ($(STATIC_BUILD),y)
 	BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a
-	ifeq ($(MATH),y)
-		BASE_LIBS += $(LIBMATH_PREFIX)/libmath.a
-	endif
 else
 	BASE_LIBS = $(LIBC_PREFIX)/libc.so.0 $(LIBSOFTINT_PREFIX)/libsoftint.so.0
 	LINK_DYNAMIC = y
-	ifeq ($(MATH),y)
-		BASE_LIBS += $(LIBMATH_PREFIX)/libmath.so.0
-	endif
 endif
 
@@ -168,9 +161,5 @@
 LIB_LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld
 
-ifeq ($(MATH),y)
-	INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS) $(LIBMATH_INCLUDES_FLAGS)
-else
-	INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS)
-endif
+INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS)
 
 ifneq ($(LIBRARY),)
@@ -179,4 +168,9 @@
 
 INCLUDES_FLAGS += $(foreach lib,$(LIBS), -I$(LIB_PREFIX)/$(lib) -I$(LIB_PREFIX)/$(lib)/include)
+
+# TODO: get rid of this special case
+ifneq ($(filter math, $(LIBS)),)
+	INCLUDES_FLAGS += $(LIBMATH_INCLUDES_FLAGS)
+endif
 
 # PCUT-based unit tests
Index: uspace/app/barber/Makefile
===================================================================
--- uspace/app/barber/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/barber/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,8 +30,7 @@
 
 # TODO: Should be just "gui", rest is transitive dependencies.
-LIBS = gui draw compress softrend
+LIBS = gui draw compress softrend math
 
 BINARY = barber
-MATH = y
 
 IMG = image
Index: uspace/app/fontviewer/Makefile
===================================================================
--- uspace/app/fontviewer/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/fontviewer/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,8 +30,7 @@
 
 # TODO: Should be just "gui", rest is transitive dependencies.
-LIBS = gui draw softrend compress
+LIBS = gui draw softrend compress math
 
 BINARY = fontviewer
-MATH = y
 
 SOURCES = \
Index: uspace/app/tester/Makefile
===================================================================
--- uspace/app/tester/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/tester/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -31,9 +31,8 @@
 
 # TODO: softfloat testing should be done via unit tests.
-LIBS = block softfloat drv
+LIBS = block softfloat drv math
 EXTRA_CFLAGS = -I$(LIBSOFTFLOAT_PREFIX)
 
 BINARY = tester
-MATH = y
 
 SOURCES = \
Index: uspace/app/vcalc/Makefile
===================================================================
--- uspace/app/vcalc/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/vcalc/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,8 +30,7 @@
 
 # TODO: Should be just "gui", rest is transitive dependencies.
-LIBS = gui draw softrend compress
+LIBS = gui draw softrend compress math
 
 BINARY = vcalc
-MATH = y
 
 SOURCES = \
Index: uspace/app/vdemo/Makefile
===================================================================
--- uspace/app/vdemo/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/vdemo/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,8 +30,7 @@
 
 # TODO: Should be just "gui", rest is transitive dependencies.
-LIBS = gui draw softrend compress
+LIBS = gui draw softrend compress math
 
 BINARY = vdemo
-MATH = y
 
 SOURCES = \
Index: uspace/app/viewer/Makefile
===================================================================
--- uspace/app/viewer/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/viewer/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,8 +30,7 @@
 
 # TODO: Should be just "gui", rest is transitive dependencies.
-LIBS = gui draw softrend compress
+LIBS = gui draw softrend compress math
 
 BINARY = viewer
-MATH = y
 
 SOURCES = \
Index: uspace/app/vlaunch/Makefile
===================================================================
--- uspace/app/vlaunch/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/vlaunch/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,8 +30,7 @@
 
 # TODO: Should be just "gui", rest is transitive dependencies.
-LIBS = gui draw softrend compress
+LIBS = gui draw softrend compress math
 
 BINARY = vlaunch
-MATH = y
 
 IMG = image
Index: uspace/app/vterm/Makefile
===================================================================
--- uspace/app/vterm/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/app/vterm/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,8 +30,7 @@
 
 # TODO: Should be just "gui graph", rest is transitive dependencies.
-LIBS = gui graph draw softrend compress
+LIBS = gui graph draw softrend compress math
 
 BINARY = vterm
-MATH = y
 
 SOURCES = \
Index: uspace/lib/math/Makefile
===================================================================
--- uspace/lib/math/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/lib/math/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -34,5 +34,6 @@
 LIBRARY = libmath
 SOVERSION = 0.0
-MATH = y
+
+EXTRA_CFLAGS += -Iarch/$(UARCH)/include
 
 -include $(CONFIG_MAKEFILE)
Index: uspace/lib/softfloat/Makefile
===================================================================
--- uspace/lib/softfloat/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/lib/softfloat/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -30,5 +30,5 @@
 USPACE_PREFIX = ../..
 LIBRARY = libsoftfloat
-MATH = y
+EXTRA_CFLAGS += $(LIBMATH_INCLUDES_FLAGS)
 
 SOURCES = \
Index: uspace/lib/softrend/Makefile
===================================================================
--- uspace/lib/softrend/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/lib/softrend/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -29,5 +29,5 @@
 USPACE_PREFIX = ../..
 LIBRARY = libsoftrend
-MATH = y
+LIBS = math
 
 SOURCES = \
Index: uspace/srv/hid/compositor/Makefile
===================================================================
--- uspace/srv/hid/compositor/Makefile	(revision d2e7a513a8d7f320da5fca1d9125f218a50907f3)
+++ uspace/srv/hid/compositor/Makefile	(revision 9d8b12da8c497c2a0001860cd8545439328c6071)
@@ -29,8 +29,7 @@
 USPACE_PREFIX = ../../..
 
-LIBS = draw softrend drv compress
+LIBS = draw softrend drv compress math
 
 BINARY = compositor
-MATH = y
 
 SOURCES = \
