Index: pjproject/trunk/Makefile
===================================================================
--- pjproject/trunk/Makefile	(revision 4726)
+++ pjproject/trunk/Makefile	(revision 4727)
@@ -22,5 +22,5 @@
 lib:
 	for dir in $(LIB_DIRS); do \
-		if $(MAKE) $(MAKE_FLAGS) -C $$dir all; then \
+		if $(MAKE) $(MAKE_FLAGS) -C $$dir lib; then \
 		    true; \
 		else \
Index: pjproject/trunk/pjlib-util/build/Makefile
===================================================================
--- pjproject/trunk/pjlib-util/build/Makefile	(revision 4726)
+++ pjproject/trunk/pjlib-util/build/Makefile	(revision 4727)
@@ -61,10 +61,10 @@
 ###############################################################################
 # Main entry
-#
-# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
-#
-TARGETS := $(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SONAME) $(UTIL_TEST_EXE)
+TARGETS := $(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SONAME)
+TARGETS_EXE := $(UTIL_TEST_EXE)
 
-all: $(TARGETS)
+all: $(TARGETS) $(TARGETS_EXE)
+
+lib: $(TARGETS)
 
 doc:
Index: pjproject/trunk/pjlib/build/Makefile
===================================================================
--- pjproject/trunk/pjlib/build/Makefile	(revision 4726)
+++ pjproject/trunk/pjlib/build/Makefile	(revision 4727)
@@ -67,5 +67,7 @@
 #
 
-all: $(TARGETS)
+all: $(TARGETS) $(TARGETS_EXE)
+
+lib: $(TARGETS)
 
 doc:
Index: pjproject/trunk/pjlib/build/os-auto.mak.in
===================================================================
--- pjproject/trunk/pjlib/build/os-auto.mak.in	(revision 4726)
+++ pjproject/trunk/pjlib/build/os-auto.mak.in	(revision 4727)
@@ -31,6 +31,6 @@
 # operating system.
 #
-export TARGETS	    =	$(PJLIB_LIB) $(PJLIB_SONAME) $(TEST_EXE)
+export TARGETS	    =	$(PJLIB_LIB) $(PJLIB_SONAME)
+export TARGETS_EXE  =   $(TEST_EXE)
 
 
-
Index: pjproject/trunk/pjmedia/build/Makefile
===================================================================
--- pjproject/trunk/pjmedia/build/Makefile	(revision 4726)
+++ pjproject/trunk/pjmedia/build/Makefile	(revision 4727)
@@ -179,8 +179,10 @@
 	   $(PJMEDIA_VIDEODEV_LIB) $(PJMEDIA_VIDEODEV_SONAME) \
 	   $(PJMEDIA_AUDIODEV_LIB) $(PJMEDIA_AUDIODEV_SONAME) \
-	   $(PJSDP_LIB) $(PJSDP_SONAME) \
-	   $(PJMEDIA_TEST_EXE)
-
-all: $(TARGETS)
+	   $(PJSDP_LIB) $(PJSDP_SONAME)
+TARGETS_EXE := $(PJMEDIA_TEST_EXE)
+
+all: $(TARGETS) $(TARGETS_EXE)
+
+lib: $(TARGETS)
 
 doc:
Index: pjproject/trunk/pjnath/build/Makefile
===================================================================
--- pjproject/trunk/pjnath/build/Makefile	(revision 4726)
+++ pjproject/trunk/pjnath/build/Makefile	(revision 4727)
@@ -84,10 +84,10 @@
 ###############################################################################
 # Main entry
-#
-# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
-#
-TARGETS := $(PJNATH_LIB) $(PJNATH_SONAME) $(PJNATH_TEST_EXE) $(PJTURN_CLIENT_EXE) $(PJTURN_SRV_EXE)
+TARGETS := $(PJNATH_LIB) $(PJNATH_SONAME)
+TARGETS_EXE := $(PJNATH_TEST_EXE) $(PJTURN_CLIENT_EXE) $(PJTURN_SRV_EXE)
 
-all: $(TARGETS)
+all: $(TARGETS) $(TARGETS_EXE)
+
+lib: $(TARGETS)
 
 doc:
Index: pjproject/trunk/pjsip/build/Makefile
===================================================================
--- pjproject/trunk/pjsip/build/Makefile	(revision 4726)
+++ pjproject/trunk/pjsip/build/Makefile	(revision 4727)
@@ -195,9 +195,10 @@
 	   $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) \
 	   $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) \
-	   $(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME) \
-	   $(TEST_EXE) \
-	   $(PJSUA2_TEST_EXE)
-
-all: $(TARGETS)
+	   $(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME)
+TARGETS_EXE := $(TEST_EXE) $(PJSUA2_TEST_EXE)
+
+all: $(TARGETS) $(TARGETS_EXE)
+
+lib: $(TARGETS)
 
 doc:
Index: pjproject/trunk/third_party/build/Makefile
===================================================================
--- pjproject/trunk/third_party/build/Makefile	(revision 4726)
+++ pjproject/trunk/third_party/build/Makefile	(revision 4727)
@@ -13,4 +13,13 @@
 	done
 
+lib:
+	for dir in $(DIRS); do \
+		if $(MAKE) $(MAKE_FLAGS) -C $$dir all; then \
+		    true; \
+		else \
+		    exit 1; \
+		fi; \
+	done
+
 doc:
 	
