Index: header.mak
===================================================================
--- header.mak	(revision 183)
+++ header.mak	(working copy)
@@ -23,6 +23,7 @@
 !         if "$(BLD_TYPE)"!="debugsrc"
 !         error Unsupported build type!  We only differentiate between retail and debug
 !         else
+# BLD_TYPE == debugsrc (internal debug logic and source debugging)
 # _ACPI_DEBUG - Turn on output to comport
 # ACPI_DEBUG  - Turn on output Intel ACPI CA message
 DBG_CFLAGS= /Ti+  /DACPI_DEBUG /DACPI_FULL_DEBUG
@@ -32,6 +33,7 @@
 DBG_LFLAGS= /de
 !         endif
 !      else
+# BLD_TYPE == debug (internal debug logic only)
 DBG_CFLAGS=  /DACPI_DEBUG /DACPI_FULL_DEBUG
 DBG_AFLAGS= 
 LFLAGS = /map /nod /exepack 
@@ -39,10 +41,13 @@
 DBG_LFLAGS= /de
 !      endif
 !   else
+# BLD_TYPE == retail
 DBG_CFLAGS=
 DBG_AFLAGS=
 LFLAGS = /map /nod /exepack
 !   endif
+!else
+!         error BLD_TYPE must be defined
 !endif
 
 DBG_C16FLAGS=
@@ -66,7 +71,6 @@
 LEX          =	flex
 LEXFLAGS     = -i
 
-
 #
 # Assembler - ALP
 #
@@ -74,55 +78,55 @@
 #AINC = -I:$(SBASE)\$(SUBSYS_RELATIVE)\..\include -I:$(R_OS2_HDR)\inc -I:$(SBASE)\common\include
 AS          = alp
 
-
 #
 # Linker - ilink from VAC 3.6.5
 #
 LINK        = ilink /nofree
 #LINK        = link386 
 
-
 #
 # Librarian - ilib from VAC 3.6.5
 #
 LIBUTIL     = ilib
 
-
 #
 # Import Librarian - implib from VAC 3.6.5
 #
 IMPLIB      = implib
 
-
 #
 # Object directory
 #
+!ifdef SUBSYS
 OBASE       = $(ROOT)\obj\$(SUBSYS)
-O           = $(OBASE)\$(SUBSYS_RELATIVE)
+O           = $(OBASE)\$(SUBSYS_RELATIVE)\$(BLD_TYPE)
+!endif
 
-
 #
-# Div stubs
+# Imported libraries
 #
 R_OS2_LIB   = $(ROOT)\lib
 
+#
+# Generated libraries
+#
+ACPILIBDIR   = $(ROOT)\lib\$(BLD_TYPE)
 
 #
 # Output paths. (OS2 system tree root dir is '$(ROOT)\bin')
 #
-OS2         = $(ROOT)\bin\os2
-DLL         = $(OS2)\dll
+OS2         = $(ROOT)\bin\os2\$(BLD_TYPE)
+# DLL         = $(OS2)\dll
 
-
 #
 # Create-path tool.
 #
 CREATE_PATH = $(ROOT)\createpath.cmd $(@D)
 
-
 #
 # Create object path.
 #
+!ifdef O
 !if [$(ROOT)\createpath.cmd $(O)]
 !endif
-
+!endif
Index: src/acpi/test/makefile
===================================================================
--- src/acpi/test/makefile	(revision 183)
+++ src/acpi/test/makefile	(working copy)
@@ -147,7 +147,7 @@
 LIBDDE  = cpprss36.lib libcssi.lib
 KEELIB  = $(R_OS2_LIB)\kee.lib
 FSHELP  = $(R_OS2_LIB)\fshelper.lib
-ACPILIB = $(R_OS2_LIB)\acpi.lib
+ACPILIB = $(ACPILIBDIR)\acpi.lib
 LIBS    = $(LIB386) $(ACPILIB) $(LIBDDE)
 # $(LIBP)
 # $(LIBDDE)
Index: src/acpi/vpic/makefile
===================================================================
--- src/acpi/vpic/makefile	(revision 183)
+++ src/acpi/vpic/makefile	(working copy)
@@ -190,8 +190,8 @@
 LIBDDE  = cpprns36.lib
 KEELIB  = $(R_OS2_LIB)\kee.lib
 FSHELP  = $(R_OS2_LIB)\fshelper.lib
-ACPIDEV = $(R_OS2_LIB)\AcpiDrv.lib
-LIBS    = dhcalls.lib vdh.lib $(KEELIB) $(LIBP) $(ACPIDEV)
+ACPIDRVLIB = $(ACPILIBDIR)\AcpiDrv.lib
+LIBS    = dhcalls.lib vdh.lib $(KEELIB) $(LIBP) $(ACPIDRVLIB)
 # $(LIBDDE)
 
 OBJASM = $(O)\start.obj
Index: src/acpi/DrvLib/makefile
===================================================================
--- src/acpi/DrvLib/makefile	(revision 183)
+++ src/acpi/DrvLib/makefile	(working copy)
@@ -150,7 +150,7 @@
 
 LIBS    =  libconv.lib+cpprss36.lib+os2386.lib
 
-OBJS = $(OBASE)\DrvLib\acpi.obj $(OBASE)\DrvLib\FindAddress.obj $(OBASE)\DrvLib\misc.obj $(OBASE)\DrvLib\debug.obj
+OBJS = $(O)\acpi.obj $(O)\FindAddress.obj $(O)\misc.obj $(O)\debug.obj
 
 #--------------------------------------------------------------------------
 # The all target is used to specify a list of targets that need to be built
@@ -159,13 +159,13 @@
 # Please look at the example for more details.
 #-------------------------------------------------------------------------
 
-all: $(R_OS2_LIB)\AcpiDrv.lib
+all: $(ACPILIBDIR)\AcpiDrv.lib
 
-$(R_OS2_LIB)\AcpiDrv.lib: makefile $(OBJS)
-        if exist $(R_OS2_LIB)\$(@B).lib del $(R_OS2_LIB)\$(@B).lib
+$(ACPILIBDIR)\AcpiDrv.lib: makefile $(OBJS)
+        if exist $(ACPILIBDIR)\$(@B).lib del $(ACPILIBDIR)\$(@B).lib
         $(CREATE_PATH)
         -4$(LIBUTIL) /NOFREE @<<$(O)\$(@B).def
-$(R_OS2_LIB)\$(@B).lib
+$(ACPILIBDIR)\$(@B).lib
 y
 $(OBJS: =&^
 )
@@ -178,7 +178,4 @@
 # Include Footer.mak at this point.
 #***************************************************************************
 
-
-
-
 !include $(ROOT)\footer.mak
Index: src/acpi/Daemon/makefile
===================================================================
--- src/acpi/Daemon/makefile	(revision 183)
+++ src/acpi/Daemon/makefile	(working copy)
@@ -160,7 +160,7 @@
 LIBDDE  = cpprss36.lib libcssi.lib
 KEELIB  = $(R_OS2_LIB)\kee.lib
 FSHELP  = $(R_OS2_LIB)\fshelper.lib
-ACPILIB = $(R_OS2_LIB)\acpi32.lib 
+ACPILIB = $(ACPILIBDIR)\acpi32.lib 
 # $(R_OS2_LIB)\videopmi.lib
 LIBS    = $(LIB386) $(ACPILIB) $(LIBDDE)
 # $(LIBP)
Index: src/acpi/psd/makefile
===================================================================
--- src/acpi/psd/makefile	(revision 183)
+++ src/acpi/psd/makefile	(working copy)
@@ -177,10 +177,10 @@
 LIBDDE  = cpprns36.lib
 KEELIB  = $(R_OS2_LIB)\kee.lib
 FSHELP  = $(R_OS2_LIB)\fshelper.lib
-ACPILIB = $(R_OS2_LIB)\acpi.lib
-ACPIDEV = $(R_OS2_LIB)\AcpiDrv.lib
+ACPILIB = $(ACPILIBDIR)\acpi.lib
+ACPIDRVLIB = $(ACPILIBDIR)\AcpiDrv.lib
 VDHLIB  = $(R_OS2_LIB)\vdh.lib
-LIBS    = $(LIBP) $(ACPILIB) $(KEELIB) $(LIBDDE) $(VDHLIB) $(ACPIDEV)
+LIBS    = $(LIBP) $(ACPILIB) $(KEELIB) $(LIBDDE) $(VDHLIB) $(ACPIDRVLIB)
 # $(LIBP)
 # $(LIBDDE)
 #          $(R_OS2_LIB)\doscalls.lib
Index: src/acpi/iasl/makefile
===================================================================
--- src/acpi/iasl/makefile	(revision 183)
+++ src/acpi/iasl/makefile	(working copy)
@@ -185,7 +185,7 @@
 LIBDDE  = cpprss36.lib libcssi.lib
 KEELIB  = $(R_OS2_LIB)\kee.lib
 FSHELP  = $(R_OS2_LIB)\fshelper.lib
-ACPILIB = $(R_OS2_LIB)\acpi.lib
+ACPILIB = $(ACPILIBDIR)\acpi.lib
 LIBS    = $(LIB386) $(LIBDDE)
 # $(LIBP)
 # $(LIBDDE)
Index: src/acpi/dll/makefile
===================================================================
--- src/acpi/dll/makefile	(revision 183)
+++ src/acpi/dll/makefile	(working copy)
@@ -174,7 +174,7 @@
 LIBDDE  = cpprss36.lib 
 KEELIB  = $(R_OS2_LIB)\resources.lib
 FSHELP  = $(R_OS2_LIB)\fshelper.lib
-# ACPILIB = $(R_OS2_LIB)\acpi.lib
+# ACPILIB = $(ACPILIBDIR)\acpi.lib
 LIBS    = $(LIB386) $(LIBDDE)
 # $(LIBP)
 # $(LIBDDE)
@@ -191,7 +191,7 @@
 # Please look at the example for more details.
 #-------------------------------------------------------------------------
 
-all: dep $(OS2)\acpi32.dll $(R_OS2_LIB)\acpi32.lib
+all: dep $(OS2)\acpi32.dll $(ACPILIBDIR)\acpi32.lib
 
 #32 bit IFS
 $(OS2)\acpi32.dll: $(OBJS) $(O)\$(@B).def makefile
@@ -207,7 +207,7 @@
 <<keep
         cd $(@D)
         mapsym $(O)\$(@B).map
-        implib $(R_OS2_LIB)\acpi32.lib $(OS2)\acpi32.dll 
+        implib $(ACPILIBDIR)\acpi32.lib $(OS2)\acpi32.dll 
         cd $(MAKEDIR)
        
 
@@ -298,8 +298,8 @@
 #        @del trc012F.tff
 #        cd $(MAKEDIR)
 
-$(R_OS2_LIB)\acpi32.lib:
-            implib $(R_OS2_LIB)\acpi32.lib $(OS2)\acpi32.dll
+$(ACPILIBDIR)\acpi32.lib:
+            implib $(ACPILIBDIR)\acpi32.lib $(OS2)\acpi32.dll
 #***************************************************************************
 # Include Footer.mak at this point.
 #***************************************************************************
Index: src/acpi/intel/makefile
===================================================================
--- src/acpi/intel/makefile	(revision 183)
+++ src/acpi/intel/makefile	(working copy)
@@ -1,4 +1,4 @@
-# $Id: 1$ 
+# $Id: $ 
 # @makefile
 # Main for build Intel source
 #
@@ -117,55 +117,65 @@
 
 LIBS    =  libconv.lib+cpprss36.lib+os2386.lib
 
-OBJS = $(OBASE)\intel\interpreter\dispatcher\dswstate.obj $(OBASE)\intel\interpreter\dispatcher\dsfield.obj \
-       $(OBASE)\intel\interpreter\dispatcher\dsinit.obj $(OBASE)\intel\interpreter\dispatcher\dsmethod.obj \
-       $(OBASE)\intel\interpreter\dispatcher\dsmthdat.obj $(OBASE)\intel\interpreter\dispatcher\dsobject.obj \
-       $(OBASE)\intel\interpreter\dispatcher\dsopcode.obj $(OBASE)\intel\interpreter\dispatcher\dsutils.obj \
-       $(OBASE)\intel\interpreter\dispatcher\dswexec.obj $(OBASE)\intel\interpreter\dispatcher\dswload.obj \
-       $(OBASE)\intel\interpreter\dispatcher\dswscope.obj \
-       $(OBASE)\intel\interpreter\executer\exoparg1.obj $(OBASE)\intel\interpreter\executer\exstorob.obj \
-       $(OBASE)\intel\interpreter\executer\exoparg2.obj $(OBASE)\intel\interpreter\executer\exsystem.obj \
-       $(OBASE)\intel\interpreter\executer\exconfig.obj $(OBASE)\intel\interpreter\executer\exoparg3.obj \
-       $(OBASE)\intel\interpreter\executer\exutils.obj $(OBASE)\intel\interpreter\executer\exconvrt.obj \
-       $(OBASE)\intel\interpreter\executer\exoparg6.obj $(OBASE)\intel\interpreter\executer\excreate.obj \
-       $(OBASE)\intel\interpreter\executer\exprep.obj $(OBASE)\intel\interpreter\executer\exdump.obj \
-       $(OBASE)\intel\interpreter\executer\exregion.obj $(OBASE)\intel\interpreter\executer\exfield.obj \
-       $(OBASE)\intel\interpreter\executer\exresnte.obj $(OBASE)\intel\interpreter\executer\exfldio.obj \
-       $(OBASE)\intel\interpreter\executer\exresolv.obj $(OBASE)\intel\interpreter\executer\exmisc.obj \
-       $(OBASE)\intel\interpreter\executer\exresop.obj $(OBASE)\intel\interpreter\executer\exmutex.obj \
-       $(OBASE)\intel\interpreter\executer\exstore.obj $(OBASE)\intel\interpreter\executer\exnames.obj \
-       $(OBASE)\intel\interpreter\executer\exstoren.obj \
-       $(OBASE)\intel\interpreter\parser\psargs.obj $(OBASE)\intel\interpreter\parser\psopcode.obj \
-       $(OBASE)\intel\interpreter\parser\psparse.obj $(OBASE)\intel\interpreter\parser\psscope.obj \
-       $(OBASE)\intel\interpreter\parser\pstree.obj $(OBASE)\intel\interpreter\parser\psutils.obj \
-       $(OBASE)\intel\interpreter\parser\pswalk.obj $(OBASE)\intel\interpreter\parser\psxface.obj \
-       $(OBASE)\intel\interpreter\parser\psloop.obj \
-       $(OBASE)\intel\namespace\nssearch.obj $(OBASE)\intel\namespace\nsaccess.obj $(OBASE)\intel\namespace\nsutils.obj \
-       $(OBASE)\intel\namespace\nsalloc.obj $(OBASE)\intel\namespace\nswalk.obj $(OBASE)\intel\namespace\nsdump.obj \
-       $(OBASE)\intel\namespace\nsxfeval.obj $(OBASE)\intel\namespace\nsxfname.obj \
-       $(OBASE)\intel\namespace\nseval.obj $(OBASE)\intel\namespace\nsxfobj.obj $(OBASE)\intel\namespace\nsinit.obj \
-       $(OBASE)\intel\namespace\nsload.obj $(OBASE)\intel\namespace\nsnames.obj $(OBASE)\intel\namespace\nsobject.obj \
-       $(OBASE)\intel\namespace\nsparse.obj $(OBASE)\intel\namespace\nspredef.obj \
-       $(OBASE)\intel\utilities\utobject.obj $(OBASE)\intel\utilities\utalloc.obj $(OBASE)\intel\utilities\utxface.obj \
-       $(OBASE)\intel\utilities\utclib.obj $(OBASE)\intel\utilities\utcopy.obj $(OBASE)\intel\utilities\utdebug.obj \
-       $(OBASE)\intel\utilities\utdelete.obj $(OBASE)\intel\utilities\uteval.obj $(OBASE)\intel\utilities\utglobal.obj \
-       $(OBASE)\intel\utilities\utinit.obj $(OBASE)\intel\utilities\utmath.obj $(OBASE)\intel\utilities\utmisc.obj \
-       $(OBASE)\intel\utilities\utcache.obj $(OBASE)\intel\utilities\utmutex.obj $(OBASE)\intel\utilities\utstate.obj\
-       $(OBASE)\intel\utilities\utresrc.obj \
-       $(OBASE)\intel\tables\tbfadt.obj $(OBASE)\intel\tables\tbfind.obj \
-       $(OBASE)\intel\tables\tbinstal.obj $(OBASE)\intel\tables\tbutils.obj \
-       $(OBASE)\intel\tables\tbxface.obj $(OBASE)\intel\tables\tbxfroot.obj \
-       $(OBASE)\intel\events\evevent.obj $(OBASE)\intel\events\evgpe.obj $(OBASE)\intel\events\evgpeblk.obj \
-       $(OBASE)\intel\events\evmisc.obj $(OBASE)\intel\events\evregion.obj $(OBASE)\intel\events\evrgnini.obj \
-       $(OBASE)\intel\events\evsci.obj $(OBASE)\intel\events\evxface.obj $(OBASE)\intel\events\evxfevnt.obj \
-       $(OBASE)\intel\events\evxfregn.obj \
-       $(OBASE)\intel\hardware\hwacpi.obj $(OBASE)\intel\hardware\hwgpe.obj $(OBASE)\intel\hardware\hwregs.obj \
-       $(OBASE)\intel\hardware\hwsleep.obj $(OBASE)\intel\hardware\hwtimer.obj $(OBASE)\intel\hardware\hwxface.obj \
-       $(OBASE)\intel\resources\rsutils.obj $(OBASE)\intel\resources\rsxface.obj $(OBASE)\intel\resources\rsaddr.obj \
-       $(OBASE)\intel\resources\rscalc.obj $(OBASE)\intel\resources\rscreate.obj $(OBASE)\intel\resources\rsdump.obj \
-       $(OBASE)\intel\resources\rsio.obj $(OBASE)\intel\resources\rsirq.obj $(OBASE)\intel\resources\rslist.obj \
-       $(OBASE)\intel\resources\rsmemory.obj $(OBASE)\intel\resources\rsmisc.obj $(OBASE)\intel\resources\rsinfo.obj
+DISPATCHERDIR = $(OBASE)\intel\interpreter\dispatcher\$(BLD_TYPE)
+EVENTSDIR = $(OBASE)\intel\events\$(BLD_TYPE)
+EXECUTERDIR = $(OBASE)\intel\interpreter\executer\$(BLD_TYPE)
+HARDWAREDIR = $(OBASE)\intel\hardware\$(BLD_TYPE)
+NAMESPACEDIR = $(OBASE)\intel\namespace\$(BLD_TYPE)
+PARSERDIR = $(OBASE)\intel\interpreter\parser\$(BLD_TYPE)
+RESOURCESDIR = $(OBASE)\intel\resources\$(BLD_TYPE)
+TABLESDIR = $(OBASE)\intel\tables\$(BLD_TYPE)
+UTILITIESDIR = $(OBASE)\intel\utilities\$(BLD_TYPE)
 
+OBJS = $(DISPATCHERDIR)\dswstate.obj $(DISPATCHERDIR)\dsfield.obj \
+       $(DISPATCHERDIR)\dsinit.obj $(DISPATCHERDIR)\dsmethod.obj \
+       $(DISPATCHERDIR)\dsmthdat.obj $(DISPATCHERDIR)\dsobject.obj \
+       $(DISPATCHERDIR)\dsopcode.obj $(DISPATCHERDIR)\dsutils.obj \
+       $(DISPATCHERDIR)\dswexec.obj $(DISPATCHERDIR)\dswload.obj \
+       $(DISPATCHERDIR)\dswscope.obj \
+       $(EXECUTERDIR)\exoparg1.obj $(EXECUTERDIR)\exstorob.obj \
+       $(EXECUTERDIR)\exoparg2.obj $(EXECUTERDIR)\exsystem.obj \
+       $(EXECUTERDIR)\exconfig.obj $(EXECUTERDIR)\exoparg3.obj \
+       $(EXECUTERDIR)\exutils.obj $(EXECUTERDIR)\exconvrt.obj \
+       $(EXECUTERDIR)\exoparg6.obj $(EXECUTERDIR)\excreate.obj \
+       $(EXECUTERDIR)\exprep.obj $(EXECUTERDIR)\exdump.obj \
+       $(EXECUTERDIR)\exregion.obj $(EXECUTERDIR)\exfield.obj \
+       $(EXECUTERDIR)\exresnte.obj $(EXECUTERDIR)\exfldio.obj \
+       $(EXECUTERDIR)\exresolv.obj $(EXECUTERDIR)\exmisc.obj \
+       $(EXECUTERDIR)\exresop.obj $(EXECUTERDIR)\exmutex.obj \
+       $(EXECUTERDIR)\exstore.obj $(EXECUTERDIR)\exnames.obj \
+       $(EXECUTERDIR)\exstoren.obj \
+       $(PARSERDIR)\psargs.obj $(PARSERDIR)\psopcode.obj \
+       $(PARSERDIR)\psparse.obj $(PARSERDIR)\psscope.obj \
+       $(PARSERDIR)\pstree.obj $(PARSERDIR)\psutils.obj \
+       $(PARSERDIR)\pswalk.obj $(PARSERDIR)\psxface.obj \
+       $(PARSERDIR)\psloop.obj \
+       $(NAMESPACEDIR)\nssearch.obj $(NAMESPACEDIR)\nsaccess.obj $(NAMESPACEDIR)\nsutils.obj \
+       $(NAMESPACEDIR)\nsalloc.obj $(NAMESPACEDIR)\nswalk.obj $(NAMESPACEDIR)\nsdump.obj \
+       $(NAMESPACEDIR)\nsxfeval.obj $(NAMESPACEDIR)\nsxfname.obj \
+       $(NAMESPACEDIR)\nseval.obj $(NAMESPACEDIR)\nsxfobj.obj $(NAMESPACEDIR)\nsinit.obj \
+       $(NAMESPACEDIR)\nsload.obj $(NAMESPACEDIR)\nsnames.obj $(NAMESPACEDIR)\nsobject.obj \
+       $(NAMESPACEDIR)\nsparse.obj $(NAMESPACEDIR)\nspredef.obj \
+       $(UTILITIESDIR)\utobject.obj $(UTILITIESDIR)\utalloc.obj $(UTILITIESDIR)\utxface.obj \
+       $(UTILITIESDIR)\utclib.obj $(UTILITIESDIR)\utcopy.obj $(UTILITIESDIR)\utdebug.obj \
+       $(UTILITIESDIR)\utdelete.obj $(UTILITIESDIR)\uteval.obj $(UTILITIESDIR)\utglobal.obj \
+       $(UTILITIESDIR)\utinit.obj $(UTILITIESDIR)\utmath.obj $(UTILITIESDIR)\utmisc.obj \
+       $(UTILITIESDIR)\utcache.obj $(UTILITIESDIR)\utmutex.obj $(UTILITIESDIR)\utstate.obj\
+       $(UTILITIESDIR)\utresrc.obj \
+       $(TABLESDIR)\tbfadt.obj $(TABLESDIR)\tbfind.obj \
+       $(TABLESDIR)\tbinstal.obj $(TABLESDIR)\tbutils.obj \
+       $(TABLESDIR)\tbxface.obj $(TABLESDIR)\tbxfroot.obj \
+       $(EVENTSDIR)\evevent.obj $(EVENTSDIR)\evgpe.obj $(EVENTSDIR)\evgpeblk.obj \
+       $(EVENTSDIR)\evmisc.obj $(EVENTSDIR)\evregion.obj $(EVENTSDIR)\evrgnini.obj \
+       $(EVENTSDIR)\evsci.obj $(EVENTSDIR)\evxface.obj $(EVENTSDIR)\evxfevnt.obj \
+       $(EVENTSDIR)\evxfregn.obj \
+       $(HARDWAREDIR)\hwacpi.obj $(HARDWAREDIR)\hwgpe.obj $(HARDWAREDIR)\hwregs.obj \
+       $(HARDWAREDIR)\hwsleep.obj $(HARDWAREDIR)\hwtimer.obj $(HARDWAREDIR)\hwxface.obj \
+       $(RESOURCESDIR)\rsutils.obj $(RESOURCESDIR)\rsxface.obj $(RESOURCESDIR)\rsaddr.obj \
+       $(RESOURCESDIR)\rscalc.obj $(RESOURCESDIR)\rscreate.obj $(RESOURCESDIR)\rsdump.obj \
+       $(RESOURCESDIR)\rsio.obj $(RESOURCESDIR)\rsirq.obj $(RESOURCESDIR)\rslist.obj \
+       $(RESOURCESDIR)\rsmemory.obj $(RESOURCESDIR)\rsmisc.obj $(RESOURCESDIR)\rsinfo.obj
+
 #--------------------------------------------------------------------------
 # The all target is used to specify a list of targets that need to be built
 # Please don't delete "dep" from the target list.  It is used to generate the
@@ -173,7 +183,7 @@
 # Please look at the example for more details.
 #-------------------------------------------------------------------------
 
-all: intel $(R_OS2_LIB)\acpi.lib
+all: intel $(ACPILIBDIR)\acpi.lib
 
 intel:
       @cd interpreter
@@ -198,11 +208,11 @@
       @$(MAKE) -$(MAKEFLAGS) $(OPT)
       @CD ..\
 
-$(R_OS2_LIB)\acpi.lib: makefile $(OBJS)
-        if exist $(R_OS2_LIB)\$(@B).lib del $(R_OS2_LIB)\$(@B).lib
+$(ACPILIBDIR)\acpi.lib: makefile $(OBJS)
+        if exist $@ del $@
         $(CREATE_PATH)
         -4$(LIBUTIL) /NOFREE @<<$(O)\$(@B).def
-$(R_OS2_LIB)\$(@B).lib
+$@
 y
 $(OBJS: =&^
 )
Index: src/acpi/apm/makefile
===================================================================
--- src/acpi/apm/makefile	(revision 183)
+++ src/acpi/apm/makefile	(working copy)
@@ -191,8 +191,8 @@
 LIBDDE  = cpprns36.lib
 KEELIB  = $(R_OS2_LIB)\kee.lib
 FSHELP  = $(R_OS2_LIB)\fshelper.lib
-ACPIDEV = $(R_OS2_LIB)\AcpiDrv.lib
-LIBS    = dhcalls.lib rmcalls.lib $(KEELIB) $(LIBP) $(ACPIDEV)
+ACPIDRVLIB = $(ACPILIBDIR)\AcpiDrv.lib
+LIBS    = dhcalls.lib rmcalls.lib $(KEELIB) $(LIBP) $(ACPIDRVLIB)
 # $(LIBDDE)
 
 OBJASM = $(O)\dmsegs.obj $(O)\dmheader.obj $(O)\strat1.obj $(O)\thunk.obj \
@@ -239,9 +239,9 @@
 # dminit.obj, causing the code to be discarded when the initialization
 # code is discarded (bad).
 #
-#$(OBJOBJ): $(R_OS2_LIB)\libh.lib
+#$(OBJOBJ): $(ACPILIBDIR)\libh.lib
 #        cd $(O)
-#        lib $(R_OS2_LIB)\libh.lib *$@;
+#        lib $(ACPILIBDIR)\libh.lib *$@;
 #        cd $(MAKEDIR)
 
 # Link
Index: makefile
===================================================================
--- makefile	(revision 183)
+++ makefile	(working copy)
@@ -13,6 +13,30 @@
 #------------------------------------------------------------------------------
 #
 
+ROOT            = $(MAKEDIR)
+
+# Do no define SUBSYS here
+
+!include $(ROOT)\header.mak
+
+#
+# Ensure directory for generated libraries exists
+#
+!if [$(ROOT)\createpath.cmd $(ACPILIBDIR)]
+!endif
+
+#
+# Ensure output directory for generated binaries exists
+#
+!if [$(ROOT)\createpath.cmd $(ACPILIBDIR)]
+!endif
+
+#
+# Ensure binary executables output directory exists
+#
+!if [$(ROOT)\createpath.cmd $(OS2)]
+!endif
+
 allall: all
 
 all dep clean:
