Replace direct calls to "make" with $(MAKE)
[reactos.git] / reactos / Makefile
index 5a23f6a..7fd18d7 100644 (file)
@@ -5,12 +5,12 @@
 PATH_TO_TOP = .
 
 #
-# Define to build WINE modules
+# Define to build ReactOS external targets
 #
-ifeq ($(ROS_BUILD_WINE),)
-ROS_BUILD_WINE = no
+ifeq ($(ROS_BUILD_EXT),)
+ROS_BUILD_EXT = no
 else
-ROS_BUILD_WINE = yes
+ROS_BUILD_EXT = yes
 endif
 
 include $(PATH_TO_TOP)/rules.mak
@@ -18,7 +18,6 @@ include $(PATH_TO_TOP)/rules.mak
 # Required to run the system
 COMPONENTS = iface_native iface_additional hallib ntoskrnl
 
-
 # Hardware Abstraction Layers
 # halx86
 HALS = halx86
@@ -31,8 +30,9 @@ BUS = acpi isapnp pci
 # advapi32 crtdll fmifs gdi32 kernel32 libpcap packet msafd msvcrt ntdll ole32
 # oleaut32 psapi rpcrt4 secur32 shell32 user32 version ws2help ws2_32 wsock32 wshirda
 DLLS = advapi32 crtdll fmifs gdi32 kernel32 packet msafd msvcrt ntdll \
-       secur32 user32 version winmm ws2help ws2_32 wshirda
-SUBSYS = smss win32k csrss
+       secur32 user32 version winedbgc ws2help ws2_32 wshirda #winmm 
+
+SUBSYS = smss win32k csrss ntvdm
 
 #
 # Select the server(s) you want to build
@@ -50,8 +50,8 @@ DRIVERS_LIB = bzip2 zlib
 
 # Kernel mode device drivers
 # Obsolete: ide
-# beep blue floppy null parallel ramdrv serenum serial vga vidport
-DEVICE_DRIVERS = beep blue floppy null serial vga vidport
+# beep blue floppy null parallel ramdrv serenum serial vga videoprt
+DEVICE_DRIVERS = beep blue floppy null serial vga videoprt
 
 # Kernel mode input drivers
 # keyboard mouclass psaux sermouse
@@ -62,8 +62,8 @@ INPUT_DRIVERS = keyboard mouclass psaux
 FS_DRIVERS = cdfs fs_rec ms np vfat mup ntfs
 
 # Kernel mode networking drivers
-# afd ndis packet tcpip tdi wshtcpip
-NET_DRIVERS = afd ndis packet tcpip tdi wshtcpip
+# afd ndis npf tcpip tdi wshtcpip
+NET_DRIVERS = afd ndis npf tcpip tdi wshtcpip
 
 # Kernel mode networking device drivers
 # ne2000
@@ -81,68 +81,43 @@ SYS_APPS = autochk services shell winlogon gstart usetup
 # rpcss eventlog
 SYS_SVC = rpcss eventlog
 
-# Test applications
-# alive apc args atomtest bench consume copymove count dump_shared_data
-# event file gditest hello isotest lpc mstest mutex nptest
-# pteb regtest sectest shm simple thread vmtest winhello
-TEST_APPS = alive apc args atomtest bench consume copymove count dump_shared_data \
-            event file gditest hello isotest lpc mstest mutex nptest \
-            pteb regtest sectest shm simple thread tokentest vmtest winhello dibtest
-
-# Test applications
-# cabman cat net objdir partinfo pice ps stats
-UTIL_APPS = cat objdir partinfo stats
-
-#
-# Win32 Subsystem support (Based on WINE)
-# FIXME: Move to this its own Makefile
-#
-
-WINE_OTHER = unicode library
+APPS = tests testsets utils
 
-WINE_TOOLS = bin2res wrc winebuild
 
-WINE_DLLS = comcat crtdll comctl32 commdlg dsound dplayx imagehlp ole32 richedit \
-shlwapi shell32 shdocvw twain wininet urlmon winspool \
-rpcrt4 mapi32 oleaut32 oledlg olepro32 olecli olesvr shfolder
+# External (sub)systems for ReactOS
+# rosapps wine posix os2 (requires c++) java (non-existant)
+EXTERNALS = rosapps wine posix os2
 
-#rpcrt4 mapi32 # needed to make rcprt4 implib 
-
-# winmm ddraw dinput dplay serialui tapi32 wintrust 
-# msinfo lzexpand (missing imports)
-
-WINE_PROGS = control expand osversioncheck regedit regsvr32 winver
-# uninstaller
-# (waiting on wrc fix for the rest of these)
-# clock cmdlgtst  notepad  progman wcmd  
-# winefile winemine winetest uninstaller
-
-
-ifeq ($(ROS_BUILD_WINE),yes)
-WINE_MODULES = $(WINE_OTHER) $(WINE_TOOLS) $(WINE_DLLS) $(WINE_PROGS)
+ifeq ($(ROS_BUILD_EXT),yes)
+EXT_MODULES = $(EXTERNALS)
 else
-WINE_MODULES =
+EXT_MODULES =
 endif
 
 KERNEL_DRIVERS = $(DRIVERS_LIB) $(DEVICE_DRIVERS) $(INPUT_DRIVERS) $(FS_DRIVERS) \
        $(NET_DRIVERS) $(NET_DEVICE_DRIVERS) $(STORAGE_DRIVERS)
 
 all: tools dk implib $(COMPONENTS) $(HALS) $(BUS) $(DLLS) $(SUBSYS) \
-     $(LOADERS) $(KERNEL_DRIVERS) $(SYS_APPS) $(SYS_SVC) $(TEST_APPS) \
-     $(UTIL_APPS) $(WINE_MODULES)
+     $(LOADERS) $(KERNEL_DRIVERS) $(SYS_APPS) $(SYS_SVC) \
+     $(APPS) $(EXT_MODULES)
+
+#config: $(TOOLS:%=%_config)
+
+depends: $(DLLS:%=%_depends) $(SUBSYS:%=%_depends) $(SYS_SVC:%=%_depends) \
+         $(EXT_MODULES:%=%_depends) $(POSIX_LIBS:%=%_depends)
 
 implib: $(COMPONENTS:%=%_implib) $(HALS:%=%_implib) $(BUS:%=%_implib) \
         $(DLLS:%=%_implib) $(LOADERS:%=%_implib) \
         $(KERNEL_DRIVERS:%=%_implib) $(SUBSYS:%=%_implib) \
         $(SYS_APPS:%=%_implib) $(SYS_SVC:%=%_implib) \
-        $(TEST_APPS:%=%_implib) $(UTIL_APPS:%=%_implib) \
-        $(WINE_MODULES:%=%_implib)
+        $(APPS:%=%_implib) $(EXT_MODULES:%=%_implib)
 
 clean: tools dk_clean $(HALS:%=%_clean) \
        $(COMPONENTS:%=%_clean) $(BUS:%=%_clean) $(DLLS:%=%_clean) \
        $(LOADERS:%=%_clean) $(KERNEL_DRIVERS:%=%_clean) $(SUBSYS:%=%_clean) \
-       $(SYS_APPS:%=%_clean) $(SYS_SVC:%=%_clean) $(TEST_APPS:%=%_clean) \
-       $(UTIL_APPS:%=%_clean) $(NET_APPS:%=%_clean) $(WINE_MODULES:%=%_clean) \
+       $(SYS_APPS:%=%_clean) $(SYS_SVC:%=%_clean) \
+       $(NET_APPS:%=%_clean) \
+       $(APPS:%=%_clean) $(EXT_MODULES:%=%_clean) \
        clean_after tools_clean
 
 clean_after:
@@ -153,35 +128,35 @@ install: tools install_dirs install_before \
          $(DLLS:%=%_install) $(LOADERS:%=%_install) \
          $(KERNEL_DRIVERS:%=%_install) $(SUBSYS:%=%_install) \
          $(SYS_APPS:%=%_install) $(SYS_SVC:%=%_install) \
-         $(TEST_APPS:%=%_install) $(UTIL_APPS:%=%_install) \
-         $(WINE_MODULES:%=%_install)
+         $(APPS:%=%_install) $(EXT_MODULES:%=%_install)
 
 dist: $(TOOLS_PATH)/rcopy$(EXE_POSTFIX) dist_clean dist_dirs \
       $(HALS:%=%_dist) $(COMPONENTS:%=%_dist) $(BUS:%=%_dist) $(DLLS:%=%_dist) \
       $(LOADERS:%=%_dist) $(KERNEL_DRIVERS:%=%_dist) $(SUBSYS:%=%_dist) \
-      $(SYS_APPS:%=%_dist) $(SYS_SVC:%=%_dist) $(TEST_APPS:%=%_dist) \
-      $(UTIL_APPS:%=%_dist) $(NET_APPS:%=%_dist) $(WINE_MODULES:%=%_dist)
+      $(SYS_APPS:%=%_dist) $(SYS_SVC:%=%_dist) \
+      $(NET_APPS:%=%_dist) \
+      $(APPS:%=%_dist) $(EXT_MODULES:%=%_dist)
 
-.PHONY: all implib clean clean_before install dist
+.PHONY: all depends implib clean clean_before install dist
 
 
 #
 # System Applications
 #
 $(SYS_APPS): %:
-       make -C subsys/system/$*
+       $(MAKE) -C subsys/system/$*
 
 $(SYS_APPS:%=%_implib): %_implib:
-       make -C subsys/system/$* implib
+       $(MAKE) -C subsys/system/$* implib
 
 $(SYS_APPS:%=%_clean): %_clean:
-       make -C subsys/system/$* clean
+       $(MAKE) -C subsys/system/$* clean
 
 $(SYS_APPS:%=%_dist): %_dist:
-       make -C subsys/system/$* dist
+       $(MAKE) -C subsys/system/$* dist
 
 $(SYS_APPS:%=%_install): %_install:
-       make -C subsys/system/$* install
+       $(MAKE) -C subsys/system/$* install
 
 .PHONY: $(SYS_APPS) $(SYS_APPS:%=%_implib) $(SYS_APPS:%=%_clean) $(SYS_APPS:%=%_install) $(SYS_APPS:%=%_dist)
 
@@ -189,159 +164,84 @@ $(SYS_APPS:%=%_install): %_install:
 # System Services
 #
 $(SYS_SVC): %:
-       make -C services/$*
+       $(MAKE) -C services/$*
+
+$(SYS_SVC:%=%_depends): %_depends:
+       $(MAKE) -C services/$* depends
 
 $(SYS_SVC:%=%_implib): %_implib:
-       make -C services/$* implib
+       $(MAKE) -C services/$* implib
 
 $(SYS_SVC:%=%_clean): %_clean:
-       make -C services/$* clean
+       $(MAKE) -C services/$* clean
 
 $(SYS_SVC:%=%_dist): %_dist:
-       make -C services/$* dist
+       $(MAKE) -C services/$* dist
 
 $(SYS_SVC:%=%_install): %_install:
-       make -C services/$* install
+       $(MAKE) -C services/$* install
 
-.PHONY: $(SYS_SVC) $(SYS_SVC:%=%_implib) $(SYS_SVC:%=%_clean) $(SYS_SVC:%=%_install) $(SYS_SVC:%=%_dist)
+.PHONY: $(SYS_SVC) $(SYS_SVC:%=%_depends) $(SYS_SVC:%=%_implib) $(SYS_SVC:%=%_clean) $(SYS_SVC:%=%_install) $(SYS_SVC:%=%_dist)
 
 
 #
-# Test Applications
+# Applications
 #
-$(TEST_APPS): %:
-       make -C apps/tests/$*
-
-$(TEST_APPS:%=%_implib): %_implib:
-       make -C apps/tests/$* implib
-
-$(TEST_APPS:%=%_clean): %_clean:
-       make -C apps/tests/$* clean
-
-$(TEST_APPS:%=%_dist): %_dist:
-       make -C apps/tests/$* dist
-
-$(TEST_APPS:%=%_install): %_install:
-       make -C apps/tests/$* install
-
-.PHONY: $(TEST_APPS) $(TEST_APPS:%=%_implib) $(TEST_APPS:%=%_clean) $(TEST_APPS:%=%_install) $(TEST_APPS:%=%_dist)
-
-
 #
-# Utility Applications
+# Extra (optional system) Applications
 #
-$(UTIL_APPS): %:
-       make -C apps/utils/$*
+$(APPS): %:
+       $(MAKE) -C apps/$*
 
-$(UTIL_APPS:%=%_implib): %_implib:
-       make -C apps/utils/$* implib
+$(APPS:%=%_implib): %_implib:
+       $(MAKE) -C apps/$* implib
 
-$(UTIL_APPS:%=%_clean): %_clean:
-       make -C apps/utils/$* clean
+$(APPS:%=%_clean): %_clean:
+       $(MAKE) -C apps/$* clean
 
-$(UTIL_APPS:%=%_dist): %_dist:
-       make -C apps/utils/$* dist
+$(APPS:%=%_dist): %_dist:
+       $(MAKE) -C apps/$* dist
 
-$(UTIL_APPS:%=%_install): %_install:
-       make -C apps/utils/$* install
+$(APPS:%=%_install): %_install:
+       $(MAKE) -C apps/$* install
 
-.PHONY: $(UTIL_APPS) $(UTIL_APPS:%=%_implib) $(UTIL_APPS:%=%_clean) $(UTIL_APPS:%=%_install) $(UTIL_APPS:%=%_dist)
+.PHONY: $(APPS) $(APPS:%=%_implib) $(APPS:%=%_clean) $(APPS:%=%_install) $(APPS:%=%_dist)
 
 
 #
-# Other Wine Modules
+# External ports and subsystem personalities
 #
-$(WINE_OTHER): %:
-       make -f makefile.ros -C $(WINE_PATH)/$*
-
-$(WINE_OTHER:%=%_implib): %_implib:
-       make -f makefile.ros -C $(WINE_PATH)/$* implib
+$(EXTERNALS): %:
+       $(MAKE) -C $(ROOT_PATH)/$*
 
-$(WINE_OTHER:%=%_clean): %_clean:
-       make -f makefile.ros -C $(WINE_PATH)/$* clean
+$(EXTERNALS:%=%_depends): %_depends:
+       $(MAKE) -C $(ROOT_PATH)/$* depends
 
-$(WINE_OTHER:%=%_dist): %_dist:
-       make -f makefile.ros -C $(WINE_PATH)/$* dist
+$(EXTERNALS:%=%_implib): %_implib:
+       $(MAKE) -C $(ROOT_PATH)/$* implib
 
-$(WINE_OTHER:%=%_install): %_install:
-       make -f makefile.ros -C $(WINE_PATH)/$* install
+$(EXTERNALS:%=%_clean): %_clean:
+       $(MAKE) -C $(ROOT_PATH)/$* clean
 
-.PHONY: $(WINE_OTHER) $(WINE_OTHER:%=%_implib) $(WINE_OTHER:%=%_clean) $(WINE_OTHER:%=%_install) $(WINE_OTHER:%=%_dist)
+$(EXTERNALS:%=%_dist): %_dist:
+       $(MAKE) -C $(ROOT_PATH)/$* dist
 
+$(EXTERNALS:%=%_install): %_install:
+       $(MAKE) -C $(ROOT_PATH)/$* install
 
-#
-# Wine Tools
-#
-$(WINE_TOOLS): %:
-       make -f makefile.ros -C $(WINE_PATH)/tools/$*
-
-$(WINE_TOOLS:%=%_implib): %_implib:
-       make -f makefile.ros -C $(WINE_PATH)/tools/$* implib
-
-$(WINE_TOOLS:%=%_clean): %_clean:
-       make -f makefile.ros -C $(WINE_PATH)/tools/$* clean
-
-$(WINE_TOOLS:%=%_dist): %_dist:
-       make -f makefile.ros -C $(WINE_PATH)/tools/$* dist
-
-$(WINE_TOOLS:%=%_install): %_install:
-       make -f makefile.ros -C $(WINE_PATH)/tools/$* install
-
-.PHONY: $(WINE_DLLS) $(WINE_DLLS:%=%_implib) $(WINE_DLLS:%=%_clean) $(WINE_DLLS:%=%_install) $(WINE_DLLS:%=%_dist)
-
-
-#
-# Wine DLLs
-#
-$(WINE_DLLS): %:
-       make -f makefile.ros -C $(WINE_PATH)/dlls/$*
-
-$(WINE_DLLS:%=%_implib): %_implib:
-       make -f makefile.ros -C $(WINE_PATH)/dlls/$* implib
-
-$(WINE_DLLS:%=%_clean): %_clean:
-       make -f makefile.ros -C $(WINE_PATH)/dlls/$* clean
-
-$(WINE_DLLS:%=%_dist): %_dist:
-       make -f makefile.ros -C $(WINE_PATH)/dlls/$* dist
-
-$(WINE_DLLS:%=%_install): %_install:
-       make -f makefile.ros -C $(WINE_PATH)/dlls/$* install
-
-.PHONY: $(WINE_DLLS) $(WINE_DLLS:%=%_implib) $(WINE_DLLS:%=%_clean) $(WINE_DLLS:%=%_install) $(WINE_DLLS:%=%_dist)
-
-
-#
-# Wine programs
-#
-$(WINE_PROGS): %:
-       make -f makefile.ros -C $(WINE_PATH)/programs/$*
-
-$(WINE_PROGS:%=%_implib): %_implib:
-       make -f makefile.ros -C $(WINE_PATH)/programs/$* implib
-
-$(WINE_PROGS:%=%_clean): %_clean:
-       make -f makefile.ros -C $(WINE_PATH)/programs/$* clean
-
-$(WINE_PROGS:%=%_dist): %_dist:
-       make -f makefile.ros -C $(WINE_PATH)/programs/$* dist
-
-$(WINE_PROGS:%=%_install): %_install:
-       make -f makefile.ros -C $(WINE_PATH)/programs/$* install
-
-.PHONY: $(WINE_PROGS) $(WINE_PROGS:%=%_implib) $(WINE_PROGS:%=%_clean) $(WINE_PROGS:%=%_install) $(WINE_PROGS:%=%_dist)
+.PHONY: $(EXTERNALS) $(EXTERNALS:%=%_depends) $(EXTERNALS:%=%_implib) $(EXTERNALS:%=%_clean) $(EXTERNALS:%=%_install) $(EXTERNALS:%=%_dist)
 
 
 #
 # Tools
 #
 tools:
-       make -C tools
+       $(MAKE) -C tools
 
 tools_implib:
 
 tools_clean:
-       make -C tools clean
+       $(MAKE) -C tools clean
 
 tools_install:
 
@@ -394,24 +294,24 @@ dk_dist:
 # Interfaces
 #
 iface_native:
-       make -C iface/native
+       $(MAKE) -C iface/native
 
 iface_native_implib:
 
 iface_native_clean:
-       make -C iface/native clean
+       $(MAKE) -C iface/native clean
 
 iface_native_install:
 
 iface_native_dist:
 
 iface_additional:
-       make -C iface/addsys
+       $(MAKE) -C iface/addsys
 
 iface_additional_implib:
 
 iface_additional_clean:
-       make -C iface/addsys clean
+       $(MAKE) -C iface/addsys clean
 
 iface_additional_install:
 
@@ -426,19 +326,19 @@ iface_additional_dist:
 # Bus driver rules
 #
 $(BUS): %:
-       make -C drivers/bus/$*
+       $(MAKE) -C drivers/bus/$*
 
 $(BUS:%=%_implib): %_implib:
-       make -C drivers/bus/$* implib
+       $(MAKE) -C drivers/bus/$* implib
 
 $(BUS:%=%_clean): %_clean:
-       make -C drivers/bus/$* clean
+       $(MAKE) -C drivers/bus/$* clean
 
 $(BUS:%=%_install): %_install:
-       make -C drivers/bus/$* install
+       $(MAKE) -C drivers/bus/$* install
 
 $(BUS:%=%_dist): %_dist:
-       make -C drivers/bus/$* dist
+       $(MAKE) -C drivers/bus/$* dist
 
 .PHONY: $(BUS) $(BUS:%=%_implib) $(BUS:%=%_clean) \
         $(BUS:%=%_install) $(BUS:%=%_dist)
@@ -447,19 +347,19 @@ $(BUS:%=%_dist): %_dist:
 # Driver support libraries rules
 #
 $(DRIVERS_LIB): %:
-       make -C drivers/lib/$*
+       $(MAKE) -C drivers/lib/$*
 
 $(DRIVERS_LIB:%=%_implib): %_implib:
-       make -C drivers/lib/$* implib
+       $(MAKE) -C drivers/lib/$* implib
 
 $(DRIVERS_LIB:%=%_clean): %_clean:
-       make -C drivers/lib/$* clean
+       $(MAKE) -C drivers/lib/$* clean
 
 $(DRIVERS_LIB:%=%_install): %_install:
-       make -C drivers/lib/$* install
+       $(MAKE) -C drivers/lib/$* install
 
 $(DRIVERS_LIB:%=%_dist): %_dist:
-       make -C drivers/lib/$* dist
+       $(MAKE) -C drivers/lib/$* dist
 
 .PHONY: $(DRIVERS_LIB) $(DRIVERS_LIB:%=%_implib) $(DRIVERS_LIB:%=%_clean) \
         $(DRIVERS_LIB:%=%_install) $(DRIVERS_LIB:%=%_dist)
@@ -468,19 +368,19 @@ $(DRIVERS_LIB:%=%_dist): %_dist:
 # Device driver rules
 #
 $(DEVICE_DRIVERS): %:
-       make -C drivers/dd/$*
+       $(MAKE) -C drivers/dd/$*
 
 $(DEVICE_DRIVERS:%=%_implib): %_implib:
-       make -C drivers/dd/$* implib
+       $(MAKE) -C drivers/dd/$* implib
 
 $(DEVICE_DRIVERS:%=%_clean): %_clean:
-       make -C drivers/dd/$* clean
+       $(MAKE) -C drivers/dd/$* clean
 
 $(DEVICE_DRIVERS:%=%_install): %_install:
-       make -C drivers/dd/$* install
+       $(MAKE) -C drivers/dd/$* install
 
 $(DEVICE_DRIVERS:%=%_dist): %_dist:
-       make -C drivers/dd/$* dist
+       $(MAKE) -C drivers/dd/$* dist
 
 .PHONY: $(DEVICE_DRIVERS) $(DEVICE_DRIVERS:%=%_implib) $(DEVICE_DRIVERS:%=%_clean) \
         $(DEVICE_DRIVERS:%=%_install) $(DEVICE_DRIVERS:%=%_dist)
@@ -489,37 +389,37 @@ $(DEVICE_DRIVERS:%=%_dist): %_dist:
 # Input driver rules
 #
 $(INPUT_DRIVERS): %:
-       make -C drivers/input/$*
+       $(MAKE) -C drivers/input/$*
 
 $(INPUT_DRIVERS:%=%_implib): %_implib:
-       make -C drivers/input/$* implib
+       $(MAKE) -C drivers/input/$* implib
 
 $(INPUT_DRIVERS:%=%_clean): %_clean:
-       make -C drivers/input/$* clean
+       $(MAKE) -C drivers/input/$* clean
 
 $(INPUT_DRIVERS:%=%_install): %_install:
-       make -C drivers/input/$* install
+       $(MAKE) -C drivers/input/$* install
 
 $(INPUT_DRIVERS:%=%_dist): %_dist:
-       make -C drivers/input/$* dist
+       $(MAKE) -C drivers/input/$* dist
 
 .PHONY: $(INPUT_DRIVERS) $(INPUT_DRIVERS:%=%_implib) $(INPUT_DRIVERS:%=%_clean)\
         $(INPUT_DRIVERS:%=%_install) $(INPUT_DRIVERS:%=%_dist)
 
 $(FS_DRIVERS): %:
-       make -C drivers/fs/$*
+       $(MAKE) -C drivers/fs/$*
 
 $(FS_DRIVERS:%=%_implib): %_implib:
-       make -C drivers/fs/$* implib
+       $(MAKE) -C drivers/fs/$* implib
 
 $(FS_DRIVERS:%=%_clean): %_clean:
-       make -C drivers/fs/$* clean
+       $(MAKE) -C drivers/fs/$* clean
 
 $(FS_DRIVERS:%=%_install): %_install:
-       make -C drivers/fs/$* install
+       $(MAKE) -C drivers/fs/$* install
 
 $(FS_DRIVERS:%=%_dist): %_dist:
-       make -C drivers/fs/$* dist
+       $(MAKE) -C drivers/fs/$* dist
 
 .PHONY: $(FS_DRIVERS) $(FS_DRIVERS:%=%_implib) $(FS_DRIVERS:%=%_clean) \
         $(FS_DRIVERS:%=%_install) $(FS_DRIVERS:%=%_dist)
@@ -528,37 +428,37 @@ $(FS_DRIVERS:%=%_dist): %_dist:
 # Network driver rules
 #
 $(NET_DRIVERS): %:
-       make -C drivers/net/$*
+       $(MAKE) -C drivers/net/$*
 
 $(NET_DRIVERS:%=%_implib): %_implib:
-       make -C drivers/net/$* implib
+       $(MAKE) -C drivers/net/$* implib
 
 $(NET_DRIVERS:%=%_clean): %_clean:
-       make -C drivers/net/$* clean
+       $(MAKE) -C drivers/net/$* clean
 
 $(NET_DRIVERS:%=%_install): %_install:
-       make -C drivers/net/$* install
+       $(MAKE) -C drivers/net/$* install
 
 $(NET_DRIVERS:%=%_dist): %_dist:
-       make -C drivers/net/$* dist
+       $(MAKE) -C drivers/net/$* dist
 
 .PHONY: $(NET_DRIVERS) $(NET_DRIVERS:%=%_implib) $(NET_DRIVERS:%=%_clean) \
         $(NET_DRIVERS:%=%_install) $(NET_DRIVERS:%=%_dist)
 
 $(NET_DEVICE_DRIVERS): %:
-       make -C drivers/net/dd/$*
+       $(MAKE) -C drivers/net/dd/$*
 
 $(NET_DEVICE_DRIVERS:%=%_implib): %_implib:
-       make -C drivers/net/dd/$* implib
+       $(MAKE) -C drivers/net/dd/$* implib
 
 $(NET_DEVICE_DRIVERS:%=%_clean): %_clean:
-       make -C drivers/net/dd/$* clean
+       $(MAKE) -C drivers/net/dd/$* clean
 
 $(NET_DEVICE_DRIVERS:%=%_install): %_install:
-       make -C drivers/net/dd/$* install
+       $(MAKE) -C drivers/net/dd/$* install
 
 $(NET_DEVICE_DRIVERS:%=%_dist): %_dist:
-       make -C drivers/net/dd/$* dist
+       $(MAKE) -C drivers/net/dd/$* dist
 
 .PHONY: $(NET_DEVICE_DRIVERS) $(NET_DEVICE_DRIVERS:%=%_clean) $(NET_DEVICE_DRIVERS:%=%_implib) \
         $(NET_DEVICE_DRIVERS:%=%_install) $(NET_DEVICE_DRIVERS:%=%_dist)
@@ -567,19 +467,19 @@ $(NET_DEVICE_DRIVERS:%=%_dist): %_dist:
 # storage driver rules
 #
 $(STORAGE_DRIVERS): %:
-       make -C drivers/storage/$*
+       $(MAKE) -C drivers/storage/$*
 
 $(STORAGE_DRIVERS:%=%_implib): %_implib:
-       make -C drivers/storage/$* implib
+       $(MAKE) -C drivers/storage/$* implib
 
 $(STORAGE_DRIVERS:%=%_clean): %_clean:
-       make -C drivers/storage/$* clean
+       $(MAKE) -C drivers/storage/$* clean
 
 $(STORAGE_DRIVERS:%=%_install): %_install:
-       make -C drivers/storage/$* install
+       $(MAKE) -C drivers/storage/$* install
 
 $(STORAGE_DRIVERS:%=%_dist): %_dist:
-       make -C drivers/storage/$* dist
+       $(MAKE) -C drivers/storage/$* dist
 
 .PHONY: $(STORAGE_DRIVERS) $(STORAGE_DRIVERS:%=%_clean) \
         $(STORAGE_DRIVERS:%=%_install) $(STORAGE_DRIVERS:%=%_dist)
@@ -589,18 +489,18 @@ $(STORAGE_DRIVERS:%=%_dist): %_dist:
 #
 
 $(LOADERS): %:
-       make -C loaders/$*
+       $(MAKE) -C loaders/$*
 
 $(LOADERS:%=%_implib): %_implib:
 
 $(LOADERS:%=%_clean): %_clean:
-       make -C loaders/$* clean
+       $(MAKE) -C loaders/$* clean
 
 $(LOADERS:%=%_install): %_install:
-       make -C loaders/$* install
+       $(MAKE) -C loaders/$* install
 
 $(LOADERS:%=%_dist): %_dist:
-       make -C loaders/$* dist
+       $(MAKE) -C loaders/$* dist
 
 .PHONY: $(LOADERS) $(LOADERS:%=%_implib) $(LOADERS:%=%_clean) $(LOADERS:%=%_install) \
         $(LOADERS:%=%_dist)
@@ -610,19 +510,19 @@ $(LOADERS:%=%_dist): %_dist:
 #
 
 ntoskrnl:
-       make -C ntoskrnl
+       $(MAKE) -C ntoskrnl
 
 ntoskrnl_implib:
-       make -C ntoskrnl implib
+       $(MAKE) -C ntoskrnl implib
 
 ntoskrnl_clean:
-       make -C ntoskrnl clean
+       $(MAKE) -C ntoskrnl clean
 
 ntoskrnl_install:
-       make -C ntoskrnl install
+       $(MAKE) -C ntoskrnl install
 
 ntoskrnl_dist:
-       make -C ntoskrnl dist
+       $(MAKE) -C ntoskrnl dist
 
 .PHONY: ntoskrnl ntoskrnl_implib ntoskrnl_clean ntoskrnl_install ntoskrnl_dist
 
@@ -631,19 +531,19 @@ ntoskrnl_dist:
 #
 
 hallib:
-       make -C hal/hal
+       $(MAKE) -C hal/hal
 
 hallib_implib:
-       make -C hal/hal implib
+       $(MAKE) -C hal/hal implib
 
 hallib_clean:
-       make -C hal/hal clean
+       $(MAKE) -C hal/hal clean
 
 hallib_install:
-       make -C hal/hal install
+       $(MAKE) -C hal/hal install
 
 hallib_dist:
-       make -C hal/hal dist
+       $(MAKE) -C hal/hal dist
 
 .PHONY: hallib hallib_implib hallib_clean hallib_install hallib_dist
 
@@ -652,19 +552,19 @@ hallib_dist:
 #
 
 $(HALS): %:
-       make -C hal/$*
+       $(MAKE) -C hal/$*
 
 $(HALS:%=%_implib): %_implib:
-       make -C hal/$* implib
+       $(MAKE) -C hal/$* implib
 
 $(HALS:%=%_clean): %_clean:
-       make -C hal/$* clean
+       $(MAKE) -C hal/$* clean
 
 $(HALS:%=%_install): %_install:
-       make -C hal/$* install
+       $(MAKE) -C hal/$* install
 
 $(HALS:%=%_dist): %_dist:
-       make -C hal/$* dist
+       $(MAKE) -C hal/$* dist
 
 .PHONY: $(HALS) $(HALS:%=%_implib) $(HALS:%=%_clean) $(HALS:%=%_install) $(HALS:%=%_dist)
 
@@ -673,42 +573,48 @@ $(HALS:%=%_dist): %_dist:
 #
 
 $(DLLS): %:
-       make -C lib/$*
+       $(MAKE) -C lib/$*
+
+$(DLLS:%=%_depends): %_depends:
+       $(MAKE) -C lib/$* depends
 
 $(DLLS:%=%_implib): %_implib:
-       make -C lib/$* implib
+       $(MAKE) -C lib/$* implib
 
 $(DLLS:%=%_clean): %_clean:
-       make -C lib/$* clean
+       $(MAKE) -C lib/$* clean
 
 $(DLLS:%=%_install): %_install:
-       make -C lib/$* install
+       $(MAKE) -C lib/$* install
 
 $(DLLS:%=%_dist): %_dist:
-       make -C lib/$* dist
+       $(MAKE) -C lib/$* dist
 
-.PHONY: $(DLLS) $(DLLS:%=%_implib) $(DLLS:%=%_clean) $(DLLS:%=%_install) $(DLLS:%=%_dist)
+.PHONY: $(DLLS) $(DLLS:%=%_depends) $(DLLS:%=%_implib) $(DLLS:%=%_clean) $(DLLS:%=%_install) $(DLLS:%=%_dist)
 
 #
 # Subsystem support modules
 #
 
 $(SUBSYS): %:
-       make -C subsys/$*
+       $(MAKE) -C subsys/$*
+
+$(SUBSYS:%=%_depends): %_depends:
+       $(MAKE) -C subsys/$* depends
 
 $(SUBSYS:%=%_implib): %_implib:
-       make -C subsys/$* implib
+       $(MAKE) -C subsys/$* implib
 
 $(SUBSYS:%=%_clean): %_clean:
-       make -C subsys/$* clean
+       $(MAKE) -C subsys/$* clean
 
 $(SUBSYS:%=%_install): %_install:
-       make -C subsys/$* install
+       $(MAKE) -C subsys/$* install
 
 $(SUBSYS:%=%_dist): %_dist:
-       make -C subsys/$* dist
+       $(MAKE) -C subsys/$* dist
 
-.PHONY: $(SUBSYS) $(SUBSYS:%=%_implib) $(SUBSYS:%=%_clean) $(SUBSYS:%=%_install) \
+.PHONY: $(SUBSYS) $(SUBSYS:%=%_depends) $(SUBSYS:%=%_implib) $(SUBSYS:%=%_clean) $(SUBSYS:%=%_install) \
         $(SUBSYS:%=%_dist)
 
 #