Merge 13831:14550 from trunk
authorCasper Hornstrup <chorns@users.sourceforge.net>
Sun, 10 Apr 2005 14:32:30 +0000 (14:32 +0000)
committerCasper Hornstrup <chorns@users.sourceforge.net>
Sun, 10 Apr 2005 14:32:30 +0000 (14:32 +0000)
svn path=/branches/xmlbuildsystem/; revision=14575

58 files changed:
1  2 
reactos/Makefile
reactos/ReactOS.xml
reactos/apps/utils/net/ping/ping.xml
reactos/apps/utils/net/route/route.xml
reactos/baseaddress.xml
reactos/drivers/dd/serial/serial.xml
reactos/drivers/net/tcpip/tcpip/main.c
reactos/hal/hal/hal.c
reactos/hal/halx86/mp/halmp.xml
reactos/include/directory.xml
reactos/include/funcs.h
reactos/include/idl/idl.xml
reactos/lib/adns/adns.xml
reactos/lib/cpl/sysdm/sysdm.xml
reactos/lib/directory.xml
reactos/lib/gdi32/gdi32.xml
reactos/lib/iphlpapi/ifenum_reactos.c
reactos/lib/kernel32/kernel32.xml
reactos/lib/kernel32/makefile
reactos/lib/kernel32/misc/dllmain.c
reactos/lib/ntdll/ntdll.xml
reactos/lib/ole32/ole32.xml
reactos/lib/oleaut32/oleaut32.xml
reactos/lib/psapi/psapi.xml
reactos/lib/riched20/riched20.xml
reactos/lib/richedit/riched32.xml
reactos/lib/rtl/rtl.xml
reactos/lib/setupapi/cfgmgr.c
reactos/lib/setupapi/setupapi.xml
reactos/lib/smdll/smdll.xml
reactos/lib/smlib/smlib.xml
reactos/lib/uuid/uuid.c
reactos/media/themes/.gitignore
reactos/ntoskrnl/io/pnpreport.c
reactos/ntoskrnl/kd/gdbstub.c
reactos/ntoskrnl/ntoskrnl.xml
reactos/regtests/regtests/regtests.xml
reactos/services/rpcss/rpcss.xml
reactos/services/umpnpmgr/umpnpmgr.c
reactos/services/umpnpmgr/umpnpmgr.xml
reactos/subsys/smss/smss.xml
reactos/subsys/system/explorer/explorer.xml
reactos/subsys/system/explorer/taskbar/startmenu.cpp
reactos/subsys/system/format/format.xml
reactos/subsys/system/services/services.xml
reactos/subsys/win32k/main/dllmain.c
reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.h
reactos/tools/rbuild/bootstrap.cpp
reactos/tools/rbuild/module.cpp
reactos/tools/rbuild/rbuild.h
reactos/tools/rbuild/rbuild.txt
reactos/tools/tools.mak
reactos/tools/widl/widl.mak
reactos/tools/wrc/parser.y
reactos/tools/wrc/wrc.mak
reactos/tools/wrc/y.tab.c

 -# $Id$
 -#
 -# Global makefile
 -#
 -
 -PATH_TO_TOP = .
 -
 -include $(PATH_TO_TOP)/rules.mak
 -include $(PATH_TO_TOP)/config
 -
 -#
 -# Define to build ReactOS external targets
 -#
 -ifeq ($(ROS_BUILD_EXT),)
 -ROS_BUILD_EXT = no
 +# Accepted environment variables:
 +#
 +#    ROS_INTERMEDIATE
 +#        This variable controls where to put intermediate files. Intermediate
 +#        files are generated files that are needed to generate the final
 +#        output files. Examples of intermediate files include *.o, *.a, and
 +#        *.coff. N.B. Don't put a path separator at the end. The variable
 +#        defaults to .\obj-i386.
 +#
 +#    ROS_OUTPUT
 +#        This variable controls where to put output files. Output files are
 +#        generated files that makes up the result of the build process.
 +#        Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't
 +#        put a path separator at the end. The variable defaults to .\output-i386.
 +#
 +#    ROS_TEMPORARY
 +#        This variable controls where to put temporary files. Temporary files
 +#        are (usually small) generated files that are needed to generate the
 +#        intermediate or final output files. Examples of temporary files include
 +#        *.rci (preprocessed .rc files for wrc), *.tmp, and *.exp. N.B. Don't put
 +#        a path separator at the end. The variable defaults to the current
 +#        directory.
 +#
 +#    ROS_INSTALL
 +#        This variable controls where to install output files to when using
 +#        'make install'. N.B. Don't put a path separator at the end. The variable
 +#        defaults to .\reactos.
 +#
 +#    ROS_BUILDMAP
 +#        This variable controls if map files are to be generated for executable
 +#        output files. Map files have the extension .map. The value can be either
 +#        full (to build map files with assembly code), yes (to build map files
 +#        without source code) or no (to not build any map files). The variable
 +#        defaults to no.
 +#
 +#    ROS_RBUILDFLAGS
 +#        Pass parameters to rbuild.
 +#
 +
 +.PHONY: all
 +.PHONY: clean
 +all: makefile.auto
 +
 +.SUFFIXES:
 +
 +ifeq ($(HOST),)
 +ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32)
 +HOST=mingw32-windows
  else
 -ROS_BUILD_EXT = yes
 +HOST=mingw32-linux
 +endif
  endif
  
 -ifneq ($(MINIMALDEPENDENCIES),no)
 -IMPLIB =
 +# Default to half-verbose mode
 +ifeq ($(VERBOSE),no)
 +  Q = @
 +  HALFVERBOSEECHO = no
 +  BUILDNO_QUIET = -q
 +else
 +ifeq ($(VERBOSE),yes)
 +  Q =
 +  HALFVERBOSEECHO = no
 +  BUILDNO_QUIET =
  else
 -IMPLIB = implib
 +  Q = @
 +  HALFVERBOSEECHO = yes
 +  BUILDNO_QUIET = -q
  endif
 -
 -# Boot loaders
 -BOOT_LOADERS = freeldr
 -
 -# Required to run the system
 -COMPONENTS = ntoskrnl
 -
 -# Hardware Abstraction Layers
 -# halx86
 -HALS = halx86/up halx86/mp
 -
 -# Bus drivers
 -# acpi isapnp pci serenum
 -BUS = acpi isapnp pci serenum
 -
 -# Filesystem libraries
 -# vfatlib
 -LIB_FSLIB = vfatlib
 -
 -# libunicode, must be empty!
 -LIBUNICODE = 
 -
 -# Static libraries
 -LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh adns dxguid strmiids crt rossym wdmguid
 -
 -# Keyboard layout libraries
 -DLLS_KBD = kbdda kbddv kbdes kbdfr kbdgr kbdse kbduk kbdus
 -
 -# Control Panels
 -DLLS_CPL = cpl
 -
 -# Shell extensions
 -DLLS_SHELLEXT = shellext
 -
 -# User mode libraries
 -# libpcap packet epsapi
 -DLLS = acledit aclui advapi32 advpack cabinet cards comctl32 crtdll comdlg32 d3d8thk dbghelp expat fmifs freetype \
 -      gdi32 gdiplus glu32 hid imagehlp imm32 iphlpapi kernel32 lzexpand mesa32 midimap mmdrv mpr msacm msafd \
 -      msgina msi msimg32 msvcrt20 msvideo mswsock netapi32 ntdll ole32 oleaut32 oledlg olepro32 opengl32 \
 -      packet psapi riched20 richedit rpcrt4 samlib secur32 serialui setupapi shell32 shlwapi smlib smdll snmpapi \
 -      syssetup twain user32 userenv version wininet winmm winspool ws2help ws2_32 wsock32 wshirda dnsapi \
 -      urlmon shdocvw dinput dinput8 dxdiagn devenum dsound lsasrv $(DLLS_KBD) $(DLLS_CPL) $(DLLS_SHELLEXT)
 -
 -SUBSYS = smss win32k csrss ntvdm
 -
 -#
 -# Select the server(s) you want to build
 -#
 -#SERVERS = posix linux os2
 -SERVERS = win32
 -
 -# Driver support libraries
 -#bzip2 zlib oskittcp
 -DRIVERS_LIB = bzip2 oskittcp ip csq
 -
 -# Kernel mode device drivers
 -# Obsolete: ide
 -# beep blue floppy null parallel ramdrv serenum serial
 -DEVICE_DRIVERS = beep blue debugout null serial bootvid
 -
 -# Kernel mode input drivers
 -INPUT_DRIVERS = keyboard mouclass psaux sermouse
 -
 -# Kernel mode file system drivers
 -# cdfs ext2 fs_rec ms np vfat
 -FS_DRIVERS = cdfs fs_rec ms np vfat mup ntfs
 -
 -# Kernel mode networking drivers
 -# afd ndis npf tcpip tdi wshtcpip
 -NET_DRIVERS = afd ndis npf tcpip tdi wshtcpip
 -
 -# Kernel mode networking device drivers
 -# ne2000 pcnet
 -NET_DEVICE_DRIVERS = ne2000 pcnet
 -
 -# Kernel mode storage drivers
 -# atapi cdrom class2 disk scsiport
 -STORAGE_DRIVERS = atapi cdrom class2 disk floppy scsiport diskdump
 -
 -# System applications
 -# autochk cmd format services setup usetup welcome winlogon msiexec 
 -SYS_APPS = autochk calc cmd explorer expand format ibrowser msiexec regsvr32 \
 -  reporterror services setup taskmgr userinit usetup welcome vmwinst rundll32 \
 -  winlogon regedit winefile notepad reactos lsass
 -
 -# System services
 -SYS_SVC = rpcss eventlog umpnpmgr
 -
 -APPS = testsets utils
 -
 -
 -# External modules and (sub)systems for ReactOS
 -# rosapps posix os2 (requires c++) java (non-existant)
 -EXTERNALS = rosapps
 -
 -ifeq ($(ROS_BUILD_EXT),yes)
 -EXT_MODULES = $(EXTERNALS)
 +endif
 +ifeq ($(HALFVERBOSEECHO),yes)
 +  ECHO_CP      =@echo [COPY]     $@
 +  ECHO_MKDIR   =@echo [MKDIR]    $@
 +  ECHO_BUILDNO =@echo [BUILDNO]  $@
 +  ECHO_INVOKE  =@echo [INVOKE]   $<
 +  ECHO_PCH     =@echo [PCH]      $@
 +  ECHO_CC      =@echo [CC]       $<
 +  ECHO_GAS     =@echo [GAS]      $<
 +  ECHO_NASM    =@echo [NASM]     $<
 +  ECHO_AR      =@echo [AR]       $@
 +  ECHO_WINEBLD =@echo [WINEBLD]  $@
 +  ECHO_WRC     =@echo [WRC]      $@
++  ECHO_WIDL    =@echo [WIDL]     $@
 +  ECHO_BIN2RES =@echo [BIN2RES]  $<
 +  ECHO_DLLTOOL =@echo [DLLTOOL]  $@
 +  ECHO_LD      =@echo [LD]       $@
 +  ECHO_NM      =@echo [NM]       $@
 +  ECHO_OBJDUMP =@echo [OBJDUMP]  $@
 +  ECHO_RBUILD  =@echo [RBUILD]   $@
 +  ECHO_RSYM    =@echo [RSYM]     $@
 +  ECHO_WMC     =@echo [WMC]      $@
 +  ECHO_NCI     =@echo [NCI]      $@
 +  ECHO_CABMAN  =@echo [CABMAN]   $<
 +  ECHO_CDMAKE  =@echo [CDMAKE]   $@
 +  ECHO_MKHIVE  =@echo [MKHIVE]   $@
 +  ECHO_REGTESTS=@echo [REGTESTS] $@
 +  ECHO_TEST    =@echo [TEST]     $@
  else
 -EXT_MODULES =
 +  ECHO_CP      =
 +  ECHO_MKDIR   =
 +  ECHO_BUILDNO =
 +  ECHO_INVOKE  =
 +  ECHO_PCH     =
 +  ECHO_CC      =
 +  ECHO_GAS     =
 +  ECHO_NASM    =
 +  ECHO_AR      =
 +  ECHO_WINEBLD =
 +  ECHO_WRC     =
++  ECHO_WIDL    =
 +  ECHO_BIN2RES =
 +  ECHO_DLLTOOL =
 +  ECHO_LD      =
 +  ECHO_NM      =
 +  ECHO_OBJDUMP =
 +  ECHO_RBUILD  =
 +  ECHO_RSYM    =
 +  ECHO_WMC     =
 +  ECHO_NCI     =
 +  ECHO_CABMAN  =
 +  ECHO_CDMAKE  =
 +  ECHO_MKHIVE  =
 +  ECHO_REGTESTS=
 +  ECHO_TEST    =
  endif
  
 -KERNEL_DRIVERS = $(DRIVERS_LIB) $(DEVICE_DRIVERS) $(INPUT_DRIVERS) $(FS_DRIVERS) \
 -      $(NET_DRIVERS) $(NET_DEVICE_DRIVERS) $(STORAGE_DRIVERS) VIDEO_DRIVERS USB_DRIVERS
 -
 -# Regression tests
 -REGTESTS = regtests
 -
 -all: bootstrap $(BOOT_LOADERS) $(COMPONENTS) $(REGTESTS) $(HALS) $(BUS) $(LIB_FSLIB) \
 -     $(DLLS) $(SUBSYS) $(KERNEL_DRIVERS) $(SYS_APPS) $(SYS_SVC) $(APPS) $(EXT_MODULES)
 -
 -bootstrap: dk implib iface_native
 -
 -depends: $(LIB_STATIC:%=%_depends) $(LIB_FSLIB:%=%_depends) msvcrt_depends $(DLLS:%=%_depends) \
 -         $(SUBSYS:%=%_depends) $(SYS_SVC:%=%_depends) \
 -         $(EXT_MODULES:%=%_depends) $(POSIX_LIBS:%=%_depends)
 -
 -implib: hallib $(LIB_STATIC) $(LIB_FSLIB) $(COMPONENTS:%=%_implib) $(HALS:%=%_implib) \
 -        $(BUS:%=%_implib) $(LIB_STATIC:%=%_implib) $(LIB_FSLIB:%=%_implib) \
 -        msvcrt_implib $(DLLS:%=%_implib) $(KERNEL_DRIVERS:%=%_implib) \
 -        $(SUBSYS:%=%_implib) $(SYS_APPS:%=%_implib) $(SYS_SVC:%=%_implib) \
 -        $(EXT_MODULES:%=%_implib) $(REGTESTS:%=%_implib)
 -
 -test: $(BOOT_LOADERS:%=%_test) $(COMPONENTS:%=%_test) $(HALS:%=%_test) $(BUS:%=%_test) \
 -          $(LIB_STATIC:%=%_test) $(LIB_FSLIB:%=%_test) msvcrt_test $(DLLS:%=%_test) \
 -          $(KERNEL_DRIVERS:%=%_test) $(SUBSYS:%=%_test) \
 -          $(SYS_SVC:%=%_test) $(EXT_MODULES:%=%_test)
 -
 -clean: tools dk_clean iface_native_clean hallib_clean \
 -       $(BOOT_LOADERS:%=%_clean) $(HALS:%=%_clean) $(COMPONENTS:%=%_clean) \
 -       $(BUS:%=%_clean) $(LIB_STATIC:%=%_clean) $(LIB_FSLIB:%=%_clean) \
 -       msvcrt_clean $(DLLS:%=%_clean) $(KERNEL_DRIVERS:%=%_clean) \
 -       $(SUBSYS:%=%_clean) $(SYS_APPS:%=%_clean) $(SYS_SVC:%=%_clean) \
 -       $(NET_APPS:%=%_clean) $(APPS:%=%_clean) $(EXT_MODULES:%=%_clean) \
 -       $(REGTESTS:%=%_clean) clean_after tools_clean
 -
 -clean_after:
 -      $(HALFVERBOSEECHO) [RM]      /include/roscfg.h
 -      $(RM) $(PATH_TO_TOP)/include/roscfg.h
 -
 -fastinstall: tools install_dirs install_before $(COMPONENTS:%=%_install) $(HALS:%=%_install) \
 -         $(BUS:%=%_install) $(LIB_STATIC:%=%_install) $(LIB_FSLIB:%=%_install) \
 -         msvcrt_install $(DLLS:%=%_install) $(KERNEL_DRIVERS:%=%_install) \
 -         $(SUBSYS:%=%_install) $(SYS_APPS:%=%_install) $(SYS_SVC:%=%_install) \
 -         $(APPS:%=%_install) $(EXT_MODULES:%=%_install) $(REGTESTS:%=%_install)
 -install: fastinstall registry
 -
 -FREELDR_DIR = boot/freeldr
 -
 -bootcd_directory_layout:
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(BOOTCD_DIR)
 -      $(RMKDIR) $(BOOTCD_DIR)
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(BOOTCD_DIR)/bootdisk
 -      $(RMKDIR) $(BOOTCD_DIR)/bootdisk
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(BOOTCD_DIR)/loader
 -      $(RMKDIR) $(BOOTCD_DIR)/loader
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(BOOTCD_DIR)/reactos
 -      $(RMKDIR) $(BOOTCD_DIR)/reactos
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(BOOTCD_DIR)/reactos/system32
 -      $(RMKDIR) $(BOOTCD_DIR)/reactos/system32
 -
 -bootcd_bootstrap_files: $(BOOT_LOADERS:%=%_bootcd) $(COMPONENTS:%=%_bootcd) \
 -      $(HALS:%=%_bootcd) $(BUS:%=%_bootcd) $(LIB_STATIC:%=%_bootcd) \
 -      $(LIB_FSLIB:%=%_bootcd) msvcrt_bootcd $(DLLS:%=%_bootcd) \
 -      $(KERNEL_DRIVERS:%=%_bootcd) $(SUBSYS:%=%_bootcd) $(SYS_APPS:%=%_bootcd)
 -
 -bootcd_install_before:
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/autorun.inf to $(BOOTCD_DIR)/autorun.inf
 -      $(RLINE) bootdata/autorun.inf $(BOOTCD_DIR)/autorun.inf
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/readme.txt to $(BOOTCD_DIR)/readme.txt
 -      $(RLINE) bootdata/readme.txt $(BOOTCD_DIR)/readme.txt
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/hivecls.inf to $(BOOTCD_DIR)/reactos/hivecls.inf
 -      $(RLINE) bootdata/hivecls.inf $(BOOTCD_DIR)/reactos/hivecls.inf
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/hivedef.inf to $(BOOTCD_DIR)/reactos/hivedef.inf
 -      $(RLINE) bootdata/hivedef.inf $(BOOTCD_DIR)/reactos/hivedef.inf
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/hivesft.inf to $(BOOTCD_DIR)/reactos/hivesft.inf
 -      $(RLINE) bootdata/hivesft.inf $(BOOTCD_DIR)/reactos/hivesft.inf
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/hivesys.inf to $(BOOTCD_DIR)/reactos/hivesys.inf
 -      $(RLINE) bootdata/hivesys.inf $(BOOTCD_DIR)/reactos/hivesys.inf
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/txtsetup.sif to $(BOOTCD_DIR)/reactos/txtsetup.sif
 -      $(RLINE) bootdata/txtsetup.sif $(BOOTCD_DIR)/reactos/txtsetup.sif
 -      $(HALFVERBOSEECHO) [COPY]    bootdata/icon.ico to $(BOOTCD_DIR)/icon.ico
 -      $(CP) bootdata/icon.ico $(BOOTCD_DIR)/icon.ico
 -      $(HALFVERBOSEECHO) [COPY]    subsys/system/welcome/welcome.exe  to $(BOOTCD_DIR)/reactos/welcome.exe
 -      $(CP) subsys/system/welcome/welcome.exe $(BOOTCD_DIR)/reactos/welcome.exe
 -      $(HALFVERBOSEECHO) [COPY]    subsys/system/reactos/reactos.exe  to $(BOOTCD_DIR)/reactos/reactos.exe
 -      $(CP) subsys/system/reactos/reactos.exe $(BOOTCD_DIR)/reactos/reactos.exe
 -      $(HALFVERBOSEECHO) [COPY]    media/nls/c_1252.nls to $(BOOTCD_DIR)/reactos/c_1252.nls
 -      $(CP) media/nls/c_1252.nls $(BOOTCD_DIR)/reactos/c_1252.nls
 -      $(HALFVERBOSEECHO) [COPY]    media/nls/c_437.nls to $(BOOTCD_DIR)/reactos/c_437.nls
 -      $(CP) media/nls/c_437.nls $(BOOTCD_DIR)/reactos/c_437.nls
 -      $(HALFVERBOSEECHO) [COPY]    media/nls/l_intl.nls to $(BOOTCD_DIR)/reactos/l_intl.nls
 -      $(CP) media/nls/l_intl.nls $(BOOTCD_DIR)/reactos/l_intl.nls
 -      $(HALFVERBOSEECHO) [COPY]    media/drivers/etc/services to $(BOOTCD_DIR)/reactos/services
 -      $(CP) media/drivers/etc/services $(BOOTCD_DIR)/reactos/services
 -      $(HALFVERBOSEECHO) [COPY]    media/drivers/etc/KDBinit to $(BOOTCD_DIR)/reactos/KDBinit
 -      $(CP) media/drivers/etc/KDBinit $(BOOTCD_DIR)/reactos/KDBinit
 -
 -bootcd_basic: bootcd_directory_layout bootcd_bootstrap_files bootcd_install_before
 -
 -bootcd_makecd:
 -      $(CABMAN) /C bootdata/packages/reactos.dff /L $(BOOTCD_DIR)/reactos /I
 -      $(CABMAN) /C bootdata/packages/reactos.dff /RC $(BOOTCD_DIR)/reactos/reactos.inf /L $(BOOTCD_DIR)/reactos /N
 -      - $(RM) $(BOOTCD_DIR)/reactos/reactos.inf
 -      $(HALFVERBOSEECHO) [CDMAKE]  ReactOS.iso
 -      $(CDMAKE) -v -m -b $(BOOTCD_DIR)/../isoboot.bin $(BOOTCD_DIR) REACTOS ReactOS.iso
 -
 -ubootcd_unattend:
 -      $(HALFVERBOSEECHO) [COPY]    bootdata/unattend.inf to $(BOOTCD_DIR)/reactos/unattend.inf
 -      $(CP) bootdata/unattend.inf $(BOOTCD_DIR)/reactos/unattend.inf
 -
 -livecd_directory_layout:
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(LIVECD_DIR)
 -      $(RMKDIR) $(LIVECD_DIR)
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(LIVECD_DIR)/loader
 -      $(RMKDIR) $(LIVECD_DIR)/loader
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(LIVECD_DIR)/reactos
 -      $(RMKDIR) $(LIVECD_DIR)/reactos
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(LIVECD_DIR)/Profiles/All\ Users/Desktop
 -      $(RMKDIR) $(LIVECD_DIR)/Profiles/All\ Users/Desktop
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(LIVECD_DIR)/Profiles/Default\ User/Desktop
 -      $(RMKDIR) $(LIVECD_DIR)/Profiles/Default\ User/Desktop
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(LIVECD_DIR)/Profiles/Default\ User/My\ Documents
 -      $(RMKDIR) $(LIVECD_DIR)/Profiles/Default\ User/My\ Documents
 -      $(HALFVERBOSEECHO) [COPY]    ${FREELDR_DIR}/bootsect/isoboot.bin to ${LIVECD_DIR}/../isoboot.bin
 -      $(CP) ${FREELDR_DIR}/bootsect/isoboot.bin ${LIVECD_DIR}/../isoboot.bin
 -      $(HALFVERBOSEECHO) [COPY]    ${FREELDR_DIR}/freeldr/freeldr.sys to ${LIVECD_DIR}/loader/setupldr.sys
 -      $(CP) ${FREELDR_DIR}/freeldr/freeldr.sys ${LIVECD_DIR}/loader/setupldr.sys
 -      $(HALFVERBOSEECHO) [RLINE]   bootdata/livecd.ini to $(LIVECD_DIR)/freeldr.ini
 -      $(RLINE) bootdata/livecd.ini $(LIVECD_DIR)/freeldr.ini
 -
 -livecd_bootstrap_files:
 -      $(MAKE) LIVECD_INSTALL=yes fastinstall
 -
 -livecd_install_before:
 -      $(MKHIVE) bootdata $(LIVECD_DIR)/reactos/system32/config bootdata/livecd.inf bootdata/hiveinst.inf
 -
 -livecd_basic: livecd_directory_layout livecd_bootstrap_files livecd_install_before
 -
 -livecd_makecd:
 -      $(HALFVERBOSEECHO) [CDMAKE]  roslive.iso
 -      $(CDMAKE) -m -j -b $(LIVECD_DIR)/../isoboot.bin $(LIVECD_DIR) REACTOS roslive.iso
 -
 -bootcd: bootcd_basic bootcd_makecd
 -
 -ubootcd: bootcd_basic ubootcd_unattend bootcd_makecd
 -
 -livecd: livecd_basic livecd_makecd
 -
 -registry: tools
 -      $(MKHIVE) bootdata $(INSTALL_DIR)/system32/config bootdata/hiveinst.inf
 -
 -.PHONY: all bootstrap depends implib test clean clean_before install bootcd_directory_layout \
 -bootcd_bootstrap_files bootcd_install_before bootcd_basic bootcd_makecd ubootcd_unattend bootcd
 -
 -
 -#
 -# Boot Loaders
 -#
 -$(BOOT_LOADERS): %:
 -      $(MAKE) -C boot/$*
 -
 -$(BOOT_LOADERS:%=%_test): %_test:
 -      $(MAKE) -C boot/$* test
 -
 -$(BOOT_LOADERS:%=%_clean): %_clean:
 -      $(MAKE) -C boot/$* clean
 -
 -$(BOOT_LOADERS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C boot/$* bootcd
 -
 -.PHONY: $(BOOT_LOADERS) $(BOOT_LOADERS:%=%_test) $(BOOT_LOADERS:%=%_clean) \
 -        $(BOOT_LOADERS:%=%_bootcd)
 -
 -$(COMPONENTS): dk
 -
 -#
 -# System Applications
 -#
 -$(SYS_APPS): %: $(IMPLIB)
 -      $(MAKE) -C subsys/system/$*
 -
 -$(SYS_APPS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C subsys/system/$* implib
 -
 -$(SYS_APPS:%=%_test): %_test:
 -      $(MAKE) -C subsys/system/$* test
 -
 -$(SYS_APPS:%=%_clean): %_clean:
 -      $(MAKE) -C subsys/system/$* clean
 -
 -$(SYS_APPS:%=%_install): %_install:
 -      $(MAKE) -C subsys/system/$* install
 -
 -$(SYS_APPS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C subsys/system/$* bootcd
 -
 -.PHONY: $(SYS_APPS) $(SYS_APPS:%=%_implib) $(SYS_APPS:%=%_test) \
 -  $(SYS_APPS:%=%_clean) $(SYS_APPS:%=%_install) $(SYS_APPS:%=%_bootcd)
 -
 -#
 -# System Services
 -#
 -$(SYS_SVC): %: $(IMPLIB)
 -      $(MAKE) -C services/$*
 -
 -$(SYS_SVC:%=%_depends): %_depends:
 -      $(MAKE) -C services/$* depends
 -
 -$(SYS_SVC:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C services/$* implib
 -
 -$(SYS_SVC:%=%_test): %_test:
 -      $(MAKE) -C services/$* test
 -
 -$(SYS_SVC:%=%_clean): %_clean:
 -      $(MAKE) -C services/$* clean
 -
 -$(SYS_SVC:%=%_install): %_install:
 -      $(MAKE) -C services/$* install
 -
 -.PHONY: $(SYS_SVC) $(SYS_SVC:%=%_depends) $(SYS_SVC:%=%_implib) \
 -  $(SYS_SVC:%=%_test) $(SYS_SVC:%=%_clean) $(SYS_SVC:%=%_install)
 -
 -
 -#
 -# Applications
 -#
 -#
 -# Extra (optional system) Applications
 -#
 -$(APPS): %: $(IMPLIB)
 -      $(MAKE) -C apps/$*
 -
 -# Not needed
 -# $(APPS:%=%_implib): %_implib: dk
 -#     $(MAKE) --silent -C apps/$* implib
 -
 -$(APPS:%=%_test): %_test:
 -      $(MAKE) -C apps/$* test
 -
 -$(APPS:%=%_clean): %_clean:
 -      $(MAKE) -C apps/$* clean
 -
 -$(APPS:%=%_install): %_install:
 -      $(MAKE) -C apps/$* install
 -
 -.PHONY: $(APPS) $(APPS:%=%_test) $(APPS:%=%_clean) $(APPS:%=%_install)
 -
 -
 -#
 -# External ports and subsystem personalities
 -#
 -$(EXTERNALS): %:
 -      $(MAKE) -C $(ROOT_PATH)/$*
 -
 -$(EXTERNALS:%=%_depends): %_depends:
 -      $(MAKE) -C $(ROOT_PATH)/$* depends
 -
 -$(EXTERNALS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C $(ROOT_PATH)/$* implib
 -
 -$(EXTERNALS:%=%_clean): %_clean:
 -      $(MAKE) -C $(ROOT_PATH)/$* clean
 -
 -$(EXTERNALS:%=%_install): %_install:
 -      $(MAKE) -C $(ROOT_PATH)/$* install
 -
 -.PHONY: $(EXTERNALS) $(EXTERNALS:%=%_depends) $(EXTERNALS:%=%_implib) $(EXTERNALS:%=%_clean) $(EXTERNALS:%=%_install)
 -
 -
 -#
 -# Tools
 -#
 -tools:
 -      $(MAKE) --silent -C tools
 -
 -tools_implib:
 -      
 -
 -tools_test:
 -      
 -
 -tools_clean:
 -      $(MAKE) -C tools clean
 -
 -tools_install:
 -
 -.PHONY: tools tools_implib tools_test tools_clean tools_install
 -
 -
 -#
 -# Developer Kits
 -#
 -dk: tools
 -      @$(RMKDIR) $(DK_PATH)
 -      @$(RMKDIR) $(DDK_PATH)
 -      @$(RMKDIR) $(DDK_PATH_LIB)
 -      @$(RMKDIR) $(DDK_PATH_INC)
 -      @$(RMKDIR) $(SDK_PATH)
 -      @$(RMKDIR) $(SDK_PATH_LIB)
 -      @$(RMKDIR) $(SDK_PATH_INC)
 -      @$(RMKDIR) $(XDK_PATH)
 -      @$(RMKDIR) $(XDK_PATH_LIB)
 -#     @$(RMKDIR) $(XDK_PATH_INC)
 -
 -dk_implib:
 -
 -# WARNING! Be very sure that there are no important files
 -#          in these directories before cleaning them!!!
 -dk_clean:
 -      $(HALFVERBOSEECHO) [RM]      $(DDK_PATH_LIB)/*.a
 -      $(RM) $(DDK_PATH_LIB)/*.a
 -#     $(HALFVERBOSEECHO) [RM]      $(DDK_PATH_INC)/*.h
 -#     $(RM) $(DDK_PATH_INC)/*.h
 -      $(HALFVERBOSEECHO) [RMDIR]   $(DDK_PATH_LIB)
 -      $(RMDIR) $(DDK_PATH_LIB)
 -#     $(HALFVERBOSEECHO) [RMDIR]   $(DDK_PATH_INC)
 -#     $(RMDIR) $(DDK_PATH_INC)
 -      $(HALFVERBOSEECHO) [RM]      $(SDK_PATH_LIB)/*.a
 -      $(RM) $(SDK_PATH_LIB)/*.a
 -#     $(HALFVERBOSEECHO) [RM]      $(SDK_PATH_INC)/*.h
 -#     $(RM) $(SDK_PATH_INC)/*.h
 -      $(HALFVERBOSEECHO) [RMDIR]   $(SDK_PATH_LIB)
 -      $(RMDIR) $(SDK_PATH_LIB)
 -#     $(HALFVERBOSEECHO) [RMDIR]   $(SDK_PATH_INC)
 -#     $(RMDIR) $(SDK_PATH_INC)
 -      $(HALFVERBOSEECHO) [RM]      $(XDK_PATH_LIB)/*.a
 -      $(RM) $(XDK_PATH_LIB)/*.a
 -#     $(HALFVERBOSEECHO) [RM]      $(XDK_PATH_INC)/*.h
 -#     $(RM) $(XDK_PATH_INC)/*.h
 -      $(HALFVERBOSEECHO) [RMDIR]   $(XDK_PATH_LIB)
 -      $(RMDIR) $(XDK_PATH_LIB)
 -#     $(HALFVERBOSEECHO) [RMDIR]   $(XDK_PATH_INC)
 -#     $(RMDIR) $(XDK_PATH_INC)
 -
 -dk_install:
 -
 -.PHONY: dk dk_implib dk_clean dk_install
 -
 -
 -#
 -# Interfaces
 -#
 -iface_native:
 -      $(MAKE) --silent -C tools/nci
 -
 -iface_native_implib:
 -      
 -iface_native_test:
 -      
 -iface_native_clean:
 -      $(MAKE) --silent -C tools/nci clean
 -
 -iface_native_install:
 -
 -iface_native_bootcd:
 -
 -.PHONY: iface_native iface_native_implib iface_native_test iface_native_clean \
 -        iface_native_install iface_native_bootcd
 -
 -
 -#
 -# Bus driver rules
 -#
 -$(BUS): %: $(IMPLIB)
 -      $(MAKE) -C drivers/bus/$*
 -
 -$(BUS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/bus/$* implib
 -
 -$(BUS:%=%_test): %_test:
 -      $(MAKE) -C drivers/bus/$* test
 -
 -$(BUS:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/bus/$* clean
 -
 -$(BUS:%=%_install): %_install:
 -      $(MAKE) -C drivers/bus/$* install
 -
 -$(BUS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/bus/$* bootcd
 -
 -.PHONY: $(BUS) $(BUS:%=%_implib) $(BUS:%=%_clean) \
 -        $(BUS:%=%_install) $(BUS:%=%_bootcd)
 -
 -
 -#
 -# Driver support libraries rules
 -#
 -$(DRIVERS_LIB): %: $(IMPLIB)
 -      $(MAKE) -C drivers/lib/$*
 -
 -$(DRIVERS_LIB:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/lib/$* implib
 -
 -$(DRIVERS_LIB:%=%_test): %_test:
 -      $(MAKE) -C drivers/lib/$* test
 -
 -$(DRIVERS_LIB:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/lib/$* clean
 -
 -$(DRIVERS_LIB:%=%_install): %_install:
 -      $(MAKE) -C drivers/lib/$* install
 -
 -$(DRIVERS_LIB:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/lib/$* bootcd
 -
 -.PHONY: $(DRIVERS_LIB) $(DRIVERS_LIB:%=%_implib) $(DRIVERS_LIB:%=%_test) \
 -        $(DRIVERS_LIB:%=%_clean) $(DRIVERS_LIB:%=%_install) $(DRIVERS_LIB:%=%_bootcd)
 -
 -
 -#
 -# Device driver rules
 -#
 -$(DEVICE_DRIVERS): %: $(IMPLIB)
 -      $(MAKE) -C drivers/dd/$*
 -
 -$(DEVICE_DRIVERS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/dd/$* implib
 -
 -$(DEVICE_DRIVERS:%=%_test): %_test:
 -      $(MAKE) -C drivers/dd/$* test
 -
 -$(DEVICE_DRIVERS:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/dd/$* clean
 -
 -$(DEVICE_DRIVERS:%=%_install): %_install:
 -      $(MAKE) -C drivers/dd/$* install
 -
 -$(DEVICE_DRIVERS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/dd/$* bootcd
 -
 -.PHONY: $(DEVICE_DRIVERS) $(DEVICE_DRIVERS:%=%_implib) $(DEVICE_DRIVERS:%=%_test) \
 -        $(DEVICE_DRIVERS:%=%_clean) $(DEVICE_DRIVERS:%=%_install) $(DEVICE_DRIVERS:%=%_bootcd)
 -
 -
 -#
 -# Video device driver rules
 -#
 -VIDEO_DRIVERS: $(IMPLIB)
 -      $(MAKE) -C drivers/video
 -
 -VIDEO_DRIVERS_implib: dk
 -      $(MAKE) --silent -C drivers/video implib
 -
 -VIDEO_DRIVERS_test:
 -      $(MAKE) -C drivers/video test
 -
 -VIDEO_DRIVERS_clean:
 -      $(MAKE) -C drivers/video clean
 -
 -VIDEO_DRIVERS_install:
 -      $(MAKE) -C drivers/video install
 -
 -VIDEO_DRIVERS_bootcd:
 -      $(MAKE) -C drivers/video bootcd
 -
 -.PHONY: VIDEO_DRIVERS VIDEO_DRIVERS_implib VIDEO_DRIVERS_test\
 -        VIDEO_DRIVERS_clean VIDEO_DRIVERS_install VIDEO_DRIVERS_bootcd
 -
 -#
 -# USB device driver rules
 -#
 -USB_DRIVERS: $(IMPLIB)
 -      $(MAKE) -C drivers/usb
 -
 -USB_DRIVERS_implib: dk
 -      $(MAKE) --silent -C drivers/usb implib
 -
 -USB_DRIVERS_test:
 -      $(MAKE) -C drivers/usb test
 -
 -USB_DRIVERS_clean:
 -      $(MAKE) -C drivers/usb clean
 -
 -USB_DRIVERS_install:
 -      $(MAKE) -C drivers/usb install
 -
 -USB_DRIVERS_bootcd:
 -      $(MAKE) -C drivers/usb bootcd
 -
 -.PHONY: USB_DRIVERS USB_DRIVERS_implib USB_DRIVERS_test\
 -        USB_DRIVERS_clean USB_DRIVERS_install USB_DRIVERS_bootcd
 -
 -
 -#
 -# Input driver rules
 -#
 -$(INPUT_DRIVERS): %: $(IMPLIB)
 -      $(MAKE) -C drivers/input/$*
 -
 -$(INPUT_DRIVERS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/input/$* implib
 -
 -$(INPUT_DRIVERS:%=%_test): %_test:
 -      $(MAKE) -C drivers/input/$* test
 -
 -$(INPUT_DRIVERS:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/input/$* clean
 -
 -$(INPUT_DRIVERS:%=%_install): %_install:
 -      $(MAKE) -C drivers/input/$* install
 -
 -$(INPUT_DRIVERS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/input/$* bootcd
 -
 -.PHONY: $(INPUT_DRIVERS) $(INPUT_DRIVERS:%=%_implib) $(INPUT_DRIVERS:%=%_test) \
 -        $(INPUT_DRIVERS:%=%_clean) $(INPUT_DRIVERS:%=%_install) $(INPUT_DRIVERS:%=%_bootcd)
 -
 -#
 -# Filesystem driver rules
 -#
 -$(FS_DRIVERS): %: $(IMPLIB)
 -      $(MAKE) -C drivers/fs/$*
 -
 -$(FS_DRIVERS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/fs/$* implib
 -
 -$(FS_DRIVERS:%=%_test): %_test:
 -      $(MAKE) -C drivers/fs/$* test
 -
 -$(FS_DRIVERS:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/fs/$* clean
 -
 -$(FS_DRIVERS:%=%_install): %_install:
 -      $(MAKE) -C drivers/fs/$* install
 -
 -$(FS_DRIVERS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/fs/$* bootcd
 -
 -.PHONY: $(FS_DRIVERS) $(FS_DRIVERS:%=%_implib) $(FS_DRIVERS:%=%_test) \
 -        $(FS_DRIVERS:%=%_clean) $(FS_DRIVERS:%=%_install) $(FS_DRIVERS:%=%_bootcd)
 -
 -
 -#
 -# Network driver rules
 -#
 -$(NET_DRIVERS): %: $(IMPLIB)
 -      $(MAKE) -C drivers/net/$*
 -
 -$(NET_DRIVERS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/net/$* implib
 -
 -$(NET_DRIVERS:%=%_test): %_test:
 -      $(MAKE) -C drivers/net/$* test
 -
 -$(NET_DRIVERS:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/net/$* clean
 -
 -$(NET_DRIVERS:%=%_install): %_install:
 -      $(MAKE) -C drivers/net/$* install
 -
 -$(NET_DRIVERS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/net/$* bootcd
 -
 -.PHONY: $(NET_DRIVERS) $(NET_DRIVERS:%=%_implib) $(NET_DRIVERS:%=%_test) \
 -        $(NET_DRIVERS:%=%_clean) $(NET_DRIVERS:%=%_install) $(NET_DRIVERS:%=%_bootcd)
 -
 -
 -#
 -# Network device driver rules
 -#
 -$(NET_DEVICE_DRIVERS): %: $(IMPLIB)
 -      $(MAKE) -C drivers/net/dd/$*
 -
 -$(NET_DEVICE_DRIVERS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/net/dd/$* implib
 -
 -$(NET_DEVICE_DRIVERS:%=%_test): %_test:
 -      $(MAKE) -C drivers/net/dd/$* test
 -
 -$(NET_DEVICE_DRIVERS:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/net/dd/$* clean
 -
 -$(NET_DEVICE_DRIVERS:%=%_install): %_install:
 -      $(MAKE) -C drivers/net/dd/$* install
 -
 -$(NET_DEVICE_DRIVERS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/net/dd/$* bootcd
 -
 -.PHONY: $(NET_DEVICE_DRIVERS) $(NET_DEVICE_DRIVERS:%=%_clean) \
 -        $(NET_DEVICE_DRIVERS:%=%_implib) $(NET_DEVICE_DRIVERS:%=%_test) \
 -        $(NET_DEVICE_DRIVERS:%=%_install) $(NET_DEVICE_DRIVERS:%=%_bootcd)
 -
 -
 -#
 -# storage driver rules
 -#
 -$(STORAGE_DRIVERS): %: $(IMPLIB)
 -      $(MAKE) -C drivers/storage/$*
 -
 -$(STORAGE_DRIVERS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C drivers/storage/$* implib
 -
 -$(STORAGE_DRIVERS:%=%_test): %_test:
 -      $(MAKE) -C drivers/storage/$* test
 -
 -$(STORAGE_DRIVERS:%=%_clean): %_clean:
 -      $(MAKE) -C drivers/storage/$* clean
 -
 -$(STORAGE_DRIVERS:%=%_install): %_install:
 -      $(MAKE) -C drivers/storage/$* install
 -
 -$(STORAGE_DRIVERS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C drivers/storage/$* bootcd
 -
 -.PHONY: $(STORAGE_DRIVERS) $(STORAGE_DRIVERS:%=%_clean) \
 -        $(STORAGE_DRIVERS:%=%_implib) $(STORAGE_DRIVERS:%=%_test) \
 -        $(STORAGE_DRIVERS:%=%_install) $(STORAGE_DRIVERS:%=%_bootcd)
 -
 -
 -#
 -# Required system components
 -#
 -ntoskrnl: bootstrap
 -      $(MAKE) -C ntoskrnl
 -
 -ntoskrnl_implib: dk
 -      $(MAKE) --silent -C ntoskrnl implib
 -
 -ntoskrnl_test:
 -      $(MAKE) -C ntoskrnl test
 -
 -ntoskrnl_clean:
 -      $(MAKE) -C ntoskrnl clean
 -
 -ntoskrnl_install:
 -      $(MAKE) -C ntoskrnl install
 -
 -ntoskrnl_bootcd:
 -      $(MAKE) -C ntoskrnl bootcd
 -
 -.PHONY: ntoskrnl ntoskrnl_implib ntoskrnl_test \
 -        ntoskrnl_clean ntoskrnl_install ntoskrnl_bootcd
 -
 -
 -#
 -# Hardware Abstraction Layer import library
 -#
 -hallib: $(PATH_TO_TOP)/include/roscfg.h ntoskrnl_implib
 -      $(MAKE) --silent -C hal/hal
 -
 -hallib_implib: dk ntoskrnl_implib
 -      $(MAKE) --silent -C hal/hal implib
 -
 -hallib_test:
 -      $(MAKE) -C hal/hal test
 -
 -hallib_clean:
 -      $(MAKE) -C hal/hal clean
 -
 -hallib_install:
 -      $(MAKE) -C hal/hal install
 -
 -hallib_bootcd:
 -      $(MAKE) -C hal/hal bootcd
 -
 -.PHONY: hallib hallib_implib hallib_test hallib_clean \
 -        hallib_install hallib_bootcd
  
 +host_gcc = $(Q)gcc
 +host_gpp = $(Q)g++
 +host_ld = $(Q)ld
 +host_ar = $(Q)ar
 +host_objcopy = $(Q)objcopy
 +ifeq ($(HOST),mingw32-linux)
 +      EXEPREFIX = ./
 +      EXEPOSTFIX =
 +      SEP = /
 +      mkdir = -$(Q)mkdir -p
 +      gcc = $(Q)mingw32-gcc
 +      gpp = $(Q)mingw32-g++
 +      ld = $(Q)mingw32-ld
 +      nm = $(Q)mingw32-nm
 +      objdump = $(Q)mingw32-objdump
 +      ar = $(Q)mingw32-ar
 +      objcopy = $(Q)mingw32-objcopy
 +      dlltool = $(Q)mingw32-dlltool
 +      windres = $(Q)mingw32-windres
 +      rm = $(Q)rm -f
 +      cp = $(Q)cp
 +      NUL = /dev/null
 +else # mingw32-windows
 +      EXEPREFIX =
 +      EXEPOSTFIX = .exe
 +      ROS_EMPTY =
 +      SEP = \$(ROS_EMPTY)
 +      mkdir = -$(Q)mkdir
 +      gcc = $(Q)gcc
 +      gpp = $(Q)g++
 +      ld = $(Q)ld
 +      nm = $(Q)nm
 +      objdump = $(Q)objdump
 +      ar = $(Q)ar
 +      objcopy = $(Q)objcopy
 +      dlltool = $(Q)dlltool
 +      windres = $(Q)windres
 +      rm = $(Q)del /f /q
 +      cp = $(Q)copy /y
 +      NUL = NUL
 +endif
  
 -#
 -# Hardware Abstraction Layers
 -#
 -ifeq ($(CONFIG_SMP),1)
 -halx86: halx86/mp
 +ifneq ($(ROS_INTERMEDIATE),)
 +  INTERMEDIATE := $(ROS_INTERMEDIATE)
  else
 -halx86: halx86/up
 +  INTERMEDIATE := obj-i386
  endif
 +INTERMEDIATE_ := $(INTERMEDIATE)$(SEP)
  
 -$(HALS): %: $(IMPLIB)
 -      $(MAKE) -C hal/$*
 -
 -$(HALS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C hal/$* implib
 -
 -$(HALS:%=%_test): %_test:
 -      $(MAKE) -C hal/$* test
 -
 -$(HALS:%=%_clean): %_clean:
 -      $(MAKE) -C hal/$* clean
 -
 -$(HALS:%=%_install): %_install:
 -      $(MAKE) -C hal/$* install
 -
 -$(HALS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C hal/$* bootcd
 -
 -.PHONY: $(HALS) $(HALS:%=%_implib) $(HALS:%=%_test) \
 -        $(HALS:%=%_clean) $(HALS:%=%_install) $(HALS:%=%_bootcd)
 -
 -
 -#
 -# File system libraries
 -#
 -$(LIB_FSLIB): %: dk
 -      $(MAKE) -C lib/fslib/$*
 -
 -$(LIB_FSLIB:%=%_depends): %_depends:
 -      $(MAKE) -C lib/fslib/$* depends
 -
 -$(LIB_FSLIB:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C lib/fslib/$* implib
 -
 -$(LIB_FSLIB:%=%_test): %_test:
 -      $(MAKE) -C lib/fslib/$* test
 -
 -$(LIB_FSLIB:%=%_clean): %_clean:
 -      $(MAKE) -C lib/fslib/$* clean
 -
 -$(LIB_FSLIB:%=%_install): %_install:
 -      $(MAKE) -C lib/fslib/$* install
 -
 -$(LIB_FSLIB:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C lib/fslib/$* bootcd
 -
 -.PHONY: $(LIB_FSLIB) $(LIB_FSLIB:%=%_depends) $(LIB_FSLIB:%=%_implib) \
 -        $(LIB_FSLIB:%=%_test) $(LIB_FSLIB:%=%_clean) \
 -        $(LIB_FSLIB:%=%_install) $(LIB_FSLIB:%=%_bootcd)
 -
 -
 -#
 -# Static libraries
 -#
 -$(LIB_STATIC): %: dk
 -      $(MAKE) --silent -C lib/$*
 -
 -$(LIB_STATIC:%=%_depends): %_depends:
 -      $(MAKE) -C lib/string depends
 -
 -$(LIB_STATIC:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C lib/$* implib
 -
 -$(LIB_STATIC:%=%_test): %_test:
 -      $(MAKE) -C lib/$* test
 -
 -$(LIB_STATIC:%=%_clean): %_clean:
 -      $(MAKE) -C lib/$* clean
 -
 -$(LIB_STATIC:%=%_install): %_install:
 -      $(MAKE) -C lib/$* install
 -
 -$(LIB_STATIC:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C lib/$* bootcd
 -
 -.PHONY: $(LIB_STATIC) $(LIB_STATIC:%=%_depends) $(LIB_STATIC:%=%_implib) \
 -        $(LIB_STATIC:%=%_test) $(LIB_STATIC:%=%_clean) \
 -        $(LIB_STATIC:%=%_install) $(LIB_STATIC:%=%_bootcd)
 -
 -
 -#
 -# MSVCRT is seperate since CRTDLL depend on this
 -#
 -msvcrt: $(IMPLIB)
 -      $(MAKE) -C lib/msvcrt
 -
 -msvcrt_depends:
 -      $(MAKE) -C lib/msvcrt depends
 -
 -msvcrt_implib: dk
 -      $(MAKE) --silent -C lib/msvcrt implib
 -
 -msvcrt_test:
 -      $(MAKE) -C lib/msvcrt test
 -
 -msvcrt_clean:
 -      $(MAKE) -C lib/msvcrt clean
 -
 -msvcrt_install:
 -      $(MAKE) -C lib/msvcrt install
 -
 -msvcrt_bootcd:
 -      $(MAKE) -C lib/msvcrt bootcd
 -
 -.PHONY: msvcrt msvcrt_depends msvcrt_implib msvcrt_test \
 -        msvcrt_clean msvcrt_install msvcrt_bootcd
 -
 -
 -#
 -# DLLs
 -#
 -$(DLLS): %: $(IMPLIB) msvcrt
 -      $(MAKE) -C lib/$*
 -
 -$(DLLS:%=%_depends): %_depends:
 -      $(MAKE) -C lib/$* depends
 -
 -$(DLLS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C lib/$* implib
 -
 -$(DLLS:%=%_test): %_test:
 -      $(MAKE) -C lib/$* test
 -
 -$(DLLS:%=%_clean): %_clean:
 -      $(MAKE) -C lib/$* clean
 -
 -$(DLLS:%=%_install): %_install:
 -      $(MAKE) -C lib/$* install
 -
 -$(DLLS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C lib/$* bootcd
 -
 -.PHONY: $(DLLS) $(DLLS:%=%_depends) $(DLLS:%=%_implib) $(DLLS:%=%_test) \
 -        $(DLLS:%=%_clean) $(DLLS:%=%_install) $(DLLS:%=%_bootcd)
 -
 -
 -#
 -# Subsystem support modules
 -#
 -$(SUBSYS): %: $(IMPLIB)
 -      $(MAKE) -C subsys/$*
 -
 -$(SUBSYS:%=%_depends): %_depends:
 -      $(MAKE) -C subsys/$* depends
 -
 -$(SUBSYS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C subsys/$* implib
 -
 -$(SUBSYS:%=%_test): %_test:
 -      $(MAKE) -C subsys/$* test
 -
 -$(SUBSYS:%=%_clean): %_clean:
 -      $(MAKE) -C subsys/$* clean
 -
 -$(SUBSYS:%=%_install): %_install:
 -      $(MAKE) -C subsys/$* install
 -
 -$(SUBSYS:%=%_bootcd): %_bootcd:
 -      $(MAKE) -C subsys/$* bootcd
 -
 -.PHONY: $(SUBSYS) $(SUBSYS:%=%_depends) $(SUBSYS:%=%_implib) $(SUBSYS:%=%_test) \
 -        $(SUBSYS:%=%_clean) $(SUBSYS:%=%_install) $(SUBSYS:%=%_bootcd)
 -
 -#
 -# Regression testsuite
 -#
 -
 -$(REGTESTS): %: $(IMPLIB)
 -      $(MAKE) --silent -C regtests
 -
 -$(REGTESTS:%=%_implib): %_implib: dk
 -      $(MAKE) --silent -C regtests implib
 -
 -$(REGTESTS:%=%_clean): %_clean:
 -      $(MAKE) -C regtests clean
 -
 -$(REGTESTS:%=%_install): %_install:
 -      $(MAKE) -C regtests install
 -
 -.PHONY: $(REGTESTS) $(REGTESTS:%=%_depends) $(SUBSYS:%=%_clean) $(REGTESTS:%=%_install)
 -
 -
 -#
 -# Create an installation
 -#
 -
 -install_clean:
 -      $(HALFVERBOSEECHO) [RM]      $(INSTALL_DIR)/system32/drivers/*.*
 -      $(RM) $(INSTALL_DIR)/system32/drivers/*.*
 -      $(HALFVERBOSEECHO) [RM]      $(INSTALL_DIR)/system32/config/*.*
 -      $(RM) $(INSTALL_DIR)/system32/config/*.*
 -      $(HALFVERBOSEECHO) [RM]      $(INSTALL_DIR)/system32/*.*
 -      $(RM) $(INSTALL_DIR)/system32/*.*
 -      $(HALFVERBOSEECHO) [RM]      $(INSTALL_DIR)/media/fonts/*.*
 -      $(RM) $(INSTALL_DIR)/media/fonts/*.*
 -      $(HALFVERBOSEECHO) [RM]      $(INSTALL_DIR)/media/*.*
 -      $(RM) $(INSTALL_DIR)/media/*.*
 -      $(HALFVERBOSEECHO) [RM]      $(INSTALL_DIR)/inf/*.*
 -      $(RM) $(INSTALL_DIR)/inf/*.*
 -      $(HALFVERBOSEECHO) [RM]      $(INSTALL_DIR)/bin/*.*
 -      $(RM) $(INSTALL_DIR)/bin/*.*
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)/system32/drivers
 -      $(RMDIR) $(INSTALL_DIR)/system32/drivers
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)/system32/config
 -      $(RMDIR) $(INSTALL_DIR)/system32/config
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)/system32
 -      $(RMDIR) $(INSTALL_DIR)/system32
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)/media/fonts
 -      $(RMDIR) $(INSTALL_DIR)/media/fonts
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)/media
 -      $(RMDIR) $(INSTALL_DIR)/media
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)/inf
 -      $(RMDIR) $(INSTALL_DIR)/inf
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)/bin
 -      $(RMDIR) $(INSTALL_DIR)/bin
 -      $(HALFVERBOSEECHO) [RMDIR]   $(INSTALL_DIR)
 -      $(RMDIR) $(INSTALL_DIR)
 -
 -install_dirs:
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)
 -      $(RMKDIR) $(INSTALL_DIR)
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/bin
 -      $(RMKDIR) $(INSTALL_DIR)/bin
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/inf
 -      $(RMKDIR) $(INSTALL_DIR)/inf
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/media
 -      $(RMKDIR) $(INSTALL_DIR)/media
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/media/fonts
 -      $(RMKDIR) $(INSTALL_DIR)/media/fonts
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/system32
 -      $(RMKDIR) $(INSTALL_DIR)/system32
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/system32/config
 -      $(RMKDIR) $(INSTALL_DIR)/system32/config
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/system32/drivers
 -      $(RMKDIR) $(INSTALL_DIR)/system32/drivers
 -      $(HALFVERBOSEECHO) [RMKDIR]  $(INSTALL_DIR)/system32/drivers/etc
 -      $(RMKDIR) $(INSTALL_DIR)/system32/drivers/etc
 -
 -install_before:
 -      $(HALFVERBOSEECHO) [INSTALL] media/inf to $(INSTALL_DIR)/inf
 -      $(CP) media/inf $(INSTALL_DIR)/inf
 -      $(HALFVERBOSEECHO) [INSTALL] media/fonts to $(INSTALL_DIR)/media/fonts
 -      $(CP) media/fonts $(INSTALL_DIR)/media/fonts
 -      $(HALFVERBOSEECHO) [INSTALL] media/nls to $(INSTALL_DIR)/system32
 -      $(CP) media/nls $(INSTALL_DIR)/system32
 -      $(HALFVERBOSEECHO) [INSTALL] media/nls/c_1252.nls to $(INSTALL_DIR)/system32/ansi.nls
 -      $(CP) media/nls/c_1252.nls $(INSTALL_DIR)/system32/ansi.nls
 -      $(HALFVERBOSEECHO) [INSTALL] media/nls/c_437.nls to $(INSTALL_DIR)/system32/oem.nls
 -      $(CP) media/nls/c_437.nls $(INSTALL_DIR)/system32/oem.nls
 -      $(HALFVERBOSEECHO) [INSTALL] media/nls/l_intl.nls to $(INSTALL_DIR)/system32/casemap.nls
 -      $(CP) media/nls/l_intl.nls $(INSTALL_DIR)/system32/casemap.nls
 -      $(HALFVERBOSEECHO) [INSTALL] media/drivers/etc/services to $(INSTALL_DIR)/system32/drivers/etc/services
 -      $(CP) media/drivers/etc/services $(INSTALL_DIR)/system32/drivers/etc/services
 -      $(HALFVERBOSEECHO) [INSTALL] media/drivers/etc/KDBinit to $(INSTALL_DIR)/system32/drivers/etc/KDBinit
 -      $(CP) media/drivers/etc/KDBinit $(INSTALL_DIR)/system32/drivers/etc/KDBinit
 -
 -.PHONY: install_clean install_dirs install_before
 +ifneq ($(ROS_OUTPUT),)
 +  OUTPUT := $(ROS_OUTPUT)
 +else
 +  OUTPUT := output-i386
 +endif
 +OUTPUT_ := $(OUTPUT)$(SEP)
  
 +ifneq ($(ROS_TEMPORARY),)
 +  TEMPORARY := $(ROS_TEMPORARY)
 +else
 +  TEMPORARY :=
 +endif
 +TEMPORARY_ := $(TEMPORARY)$(SEP)
  
 -etags:
 -      find . -name "*.[ch]" -print | etags --language=c -
 +ifneq ($(ROS_INSTALL),)
 +  INSTALL := $(ROS_INSTALL)
 +else
 +  INSTALL := reactos
 +endif
 +INSTALL_ := $(INSTALL)$(SEP)
  
 +$(INTERMEDIATE):
 +      ${mkdir} $@
  
 -docu:
 -      echo generating ReactOS NTOSKRNL documentation ...
 -      $(MAKE) -C ntoskrnl docu
 +ifneq ($(INTERMEDIATE),$(OUTPUT))
 +$(OUTPUT):
 +      ${mkdir} $@
 +endif
  
 -      echo generating ReactOS drivers documentation ...
 -      $(MAKE) -C drivers docu
  
 -      echo generating ReactOS NTDLL documentation ...
 -      $(MAKE) -C lib/ntdll docu
 +NTOSKRNL_MC = ntoskrnl$(SEP)ntoskrnl.mc
 +KERNEL32_MC = lib$(SEP)kernel32$(SEP)kernel32.mc
 +BUILDNO_H = include$(SEP)reactos$(SEP)buildno.h
 +BUGCODES_H = include$(SEP)reactos$(SEP)bugcodes.h
 +BUGCODES_RC = ntoskrnl$(SEP)bugcodes.rc
 +ERRCODES_H = include$(SEP)reactos$(SEP)errcodes.h
 +ERRCODES_RC = lib$(SEP)kernel32$(SEP)errcodes.rc
  
 -      echo generating ReactOS Freetype documentation ...
 -      $(MAKE) -C lib/freetype docu
 +include lib/lib.mak
 +include tools/tools.mak
 +-include makefile.auto
  
 -      echo generating ReactOS libs documentation ...
 -      $(MAKE) -C lib docu
 +PREAUTO := \
 +      $(BUILDNO_H) \
 +      $(BUGCODES_H) \
 +      $(BUGCODES_RC) \
 +      $(ERRCODES_H) \
 +      $(ERRCODES_RC) \
 +      $(NCI_SERVICE_FILES)
  
 -      echo generating ReactOS WIN32K documentation ...
 -      $(MAKE) -C subsys/win32k docu
 +makefile.auto: $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
 +      $(ECHO_RBUILD)
 +      $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) mingw
  
 -      echo generating ReactOS apps+tools documentation ...
 -      $(MAKE) -C apps docu
  
 -      echo generating ReactOS explorer documentation ...
 -      $(MAKE) -C subsys/system/explorer full-docu
 +$(BUGCODES_H) $(BUGCODES_RC): $(WMC_TARGET) $(NTOSKRNL_MC)
 +      $(ECHO_WMC)
 +      $(Q)$(WMC_TARGET) -i -H $(BUGCODES_H) -o $(BUGCODES_RC) $(NTOSKRNL_MC)
  
 -      echo generating remaining ReactOS documentation ...
 -      doxygen Doxyfile
 +$(ERRCODES_H) $(ERRCODES_RC): $(WMC_TARGET) $(KERNEL32_MC)
 +      $(ECHO_WMC)
 +      $(Q)$(WMC_TARGET) -i -H $(ERRCODES_H) -o $(ERRCODES_RC) $(KERNEL32_MC)
  
 -.PHONY: docu
 +.PHONY: makefile_auto_clean
 +makefile_auto_clean:
 +      -@$(rm) makefile.auto $(PREAUTO) 2>$(NUL)
  
 -include $(TOOLS_PATH)/config.mk
 +.PHONY: clean
 +clean: makefile_auto_clean
index 284e19b,0000000..12437ee
mode 100644,000000..100644
--- /dev/null
@@@ -1,62 -1,0 +1,65 @@@
 +<?xml version="1.0"?>\r
 +<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">\r
 +<project name="ReactOS" makefile="makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">\r
 +      <xi:include href="config.xml">\r
 +              <xi:fallback>\r
 +                      <xi:include href="config.template.xml" />\r
 +              </xi:fallback>\r
 +      </xi:include>\r
 +\r
 +      <xi:include href="baseaddress.xml" />\r
 +\r
 +      <define name="_M_IX86" />\r
 +      <if property="DBG" value="1">\r
 +              <define name="DBG" value="1" />\r
 +              <property name="DBG_OR_KDBG" value="true" />\r
 +      </if>\r
 +      <if property="KDBG" value="1">\r
 +              <define name="KDBG" value="1" />\r
 +              <property name="DBG_OR_KDBG" value="true" />\r
 +      </if>\r
 +\r
 +      <include>include</include>\r
 +      <include>w32api/include</include>\r
 +      <include>w32api/include/ddk</include>\r
 +\r
 +      <directory name="apps">\r
 +              <xi:include href="apps/directory.xml" />\r
 +      </directory>\r
 +      <directory name="boot">\r
 +              <xi:include href="boot/boot.xml" />\r
 +      </directory>\r
 +      <directory name="bootdata">\r
 +              <xi:include href="bootdata/bootdata.xml" />\r
 +      </directory>\r
 +      <directory name="drivers">\r
 +              <xi:include href="drivers/directory.xml" />\r
 +      </directory>\r
 +      <directory name="hal">\r
 +              <xi:include href="hal/directory.xml" />\r
 +      </directory>\r
++      <directory name="include">\r
++              <xi:include href="include/directory.xml" />\r
++      </directory>\r
 +      <directory name="lib">\r
 +              <xi:include href="lib/directory.xml" />\r
 +      </directory>\r
 +      <directory name="media">\r
 +              <xi:include href="media/directory.xml" />\r
 +      </directory>\r
 +      <directory name="ntoskrnl">\r
 +              <xi:include href="ntoskrnl/ntoskrnl.xml" />\r
 +      </directory>\r
 +      <directory name="regtests">\r
 +              <xi:include href="regtests/directory.xml" />\r
 +      </directory>\r
 +      <directory name="services">\r
 +              <xi:include href="services/directory.xml" />\r
 +      </directory>\r
 +      <directory name="subsys">\r
 +              <xi:include href="subsys/directory.xml" />\r
 +      </directory>\r
 +\r
 +      <module name="bootcd" type="iso">\r
 +      </module>\r
 +</project>\r
index 2e6a501,0000000..c604abd
mode 100644,000000..100644
--- /dev/null
@@@ -1,10 -1,0 +1,11 @@@
 +<module name="ping" type="win32cui" installbase="system32" installname="ping.exe">\r
 +      <include base="ping">.</include>\r
++      <define name="__USE_W32API" />\r
 +      <define name="__USE_W32_SOCKETS" />\r
 +      <define name="_WIN32_IE">0x600</define>\r
 +      <define name="_WIN32_WINNT">0x501</define>\r
 +      <library>kernel32</library>\r
 +      <library>ws2_32</library>\r
 +      <file>ping.c</file>\r
 +      <file>ping.rc</file>\r
 +</module>\r
index c1a435e,0000000..0760122
mode 100644,000000..100644
--- /dev/null
@@@ -1,8 -1,0 +1,9 @@@
 +<module name="route" type="win32cui">\r
 +      <include base="route">.</include>\r
++      <define name="__USE_W32API" />\r
 +      <library>kernel32</library>\r
 +      <library>ws2_32</library>\r
 +      <library>iphlpapi</library>\r
 +      <file>route.c</file>\r
 +      <file>route.rc</file>\r
 +</module>\r
index 56dafd3,0000000..2af4618
mode 100644,000000..100644
--- /dev/null
@@@ -1,101 -1,0 +1,102 @@@
 +<property name="BASEADDRESS_REGTESTS" value="0x07000000" />\r
 +<property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" />\r
 +<property name="BASEADDRESS_DEVENUM" value="0x35680000" />\r
 +<property name="BASEADDRESS_DINPUT" value="0x5F580000" />\r
 +<property name="BASEADDRESS_TIMEDATE" value="0x64DA0000" />\r
 +<property name="BASEADDRESS_SYSDM" value="0x64DD0000" />\r
 +<property name="BASEADDRESS_MAIN" value="0x64F40000" />\r
 +<property name="BASEADDRESS_INTL" value="0x64FB0000" />\r
 +<property name="BASEADDRESS_DESK" value="0x65080000" />\r
 +<property name="BASEADDRESS_APPWIZ" value="0x65100000" />\r
 +<property name="BASEADDRESS_ACCESS" value="0x65180000" />\r
 +<property name="BASEADDRESS_PSAPI" value="0x68f70000" />\r
 +<property name="BASEADDRESS_MSIMG32" value="0x69cc0000" />\r
 +<property name="BASEADDRESS_UNICODE" value="0x6b200000" />\r
 +<property name="BASEADDRESS_ADVPACK" value="0x6b300000" />\r
 +<property name="BASEADDRESS_CONTROL" value="0x6b310000" />\r
 +<property name="BASEADDRESS_NCPA" value="0x6b320000" />\r
 +<property name="BASEADDRESS_DBGHELP" value="0x6b330000" />\r
 +<property name="BASEADDRESS_DINPUT8" value="0x6b340000" />\r
 +<property name="BASEADDRESS_DXDIAGN" value="0x6b350000" />\r
 +<property name="BASEADDRESS_DSOUND" value="0x6b360000" />\r
 +<property name="BASEADDRESS_GLU32" value="0x6b370000" />\r
 +<property name="BASEADDRESS_MESA32" value="0x6b380000" />\r
 +<property name="BASEADDRESS_OPENGL32" value="0x6b390000" />\r
 +<property name="BASEADDRESS_SECUR32" value="0x6b3A0000" />\r
 +<property name="BASEADDRESS_SMDLL" value="0x6b3B0000" />\r
 +<property name="BASEADDRESS_URLMON" value="0x6b3C0000" />\r
 +<property name="BASEADDRESS_CARDS" value="0x701a0000" />\r
 +<property name="BASEADDRESS_WININET" value="0x70200000" />\r
 +<property name="BASEADDRESS_ACLUI" value="0x71550000" />\r
 +<property name="BASEADDRESS_SHDOCVW" value="0x71700000" />\r
 +<property name="BASEADDRESS_WSOCK32" value="0x71ab0000" />\r
 +<property name="BASEADDRESS_ACLEDIT" value="0x71b70000" />\r
 +<property name="BASEADDRESS_NETAPI32" value="0x71c00000" />\r
 +<property name="BASEADDRESS_LZ32" value="0x73d80000" />\r
 +<property name="BASEADDRESS_USERENV" value="0x74850000" />\r
 +<property name="BASEADDRESS_SYSSETUP" value="0x74a30000" />\r
 +<property name="BASEADDRESS_SAMLIB" value="0x750C0000" />\r
 +<property name="BASEADDRESS_CABINET" value="0x75120000" />\r
 +<property name="BASEADDRESS_MSGINA" value="0x75970000" />\r
 +<property name="BASEADDRESS_IMM32" value="0x75e60000" />\r
 +<property name="BASEADDRESS_RPCRT4" value="0x76000000" />\r
 +<property name="BASEADDRESS_SHLWAPI" value="0x76120000" />\r
 +<property name="BASEADDRESS_COMCTL32" value="0x76160000" />\r
 +<property name="BASEADDRESS_COMDLG32" value="0x76200000" />\r
 +<property name="BASEADDRESS_OLEAUT32" value="0x76260000" />\r
 +<property name="BASEADDRESS_RICHED32" value="0x76340000" />\r
++<property name="BASEADDRESS_RICHED20" value="0x76360000" />\r
 +<property name="BASEADDRESS_TWAIN_32" value="0x76380000" />\r
 +<property name="BASEADDRESS_MIDIMAP" value="0x76600000" />\r
 +<property name="BASEADDRESS_MPR" value="0x76620000" />\r
 +<property name="BASEADDRESS_SETUPAPI" value="0x76660000" />\r
 +<property name="BASEADDRESS_GDIPLUS" value="0x76a00000" />\r
 +<property name="BASEADDRESS_IMAGEHLP" value="0x76c90000" />\r
 +<property name="BASEADDRESS_FMIFS" value="0x76df0000" />\r
 +<property name="BASEADDRESS_SHELL32" value="0x77260000" />\r
 +<property name="BASEADDRESS_IPHLPAPI" value="0x77300000" />\r
 +<property name="BASEADDRESS_MMDRV" value="0x77500000" />\r
 +<property name="BASEADDRESS_CRTDLL" value="0x77630000" />\r
 +<property name="BASEADDRESS_MSAFD" value="0x777a0000" />\r
 +<property name="BASEADDRESS_SNMPAPI" value="0x777c0000" />\r
 +<property name="BASEADDRESS_WINMM" value="0x777d0000" />\r
 +<property name="BASEADDRESS_WS2HELP" value="0x777e0000" />\r
 +<property name="BASEADDRESS_WSHIRDA" value="0x777f0000" />\r
 +<property name="BASEADDRESS_WINSPOOL" value="0x77800000" />\r
 +<property name="BASEADDRESS_VERSION" value="0x77a90000" />\r
 +<property name="BASEADDRESS_WS2_32" value="0x777aa000" />\r
 +<property name="BASEADDRESS_OLE32" value="0x77a50000" />\r
 +<property name="BASEADDRESS_OLEPRO32" value="0x77aa0000" />\r
 +<property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" />\r
 +<property name="BASEADDRESS_USER32" value="0x77e60000" />\r
 +<property name="BASEADDRESS_GDI32" value="0x77ed0000" />\r
 +<property name="BASEADDRESS_DNSAPI" value="0x77f00000" />\r
 +<property name="BASEADDRESS_KERNEL32" value="0x77800000" />\r
 +<property name="BASEADDRESS_MSVCRT" value="0x78000000" />\r
 +<property name="BASEADDRESS_MSVCRT20" value="0x78500000" />\r
 +<property name="BASEADDRESS_NTDLL" value="0x7C900000" />\r
 +<property name="BASEADDRESS_FREETYPE" value="0x7F000000" />\r
 +\r
 +<property name="BASEADDRESS_SLAYER" value="0x5C7E0000" />\r
 +<property name="BASEADDRESS_NCPL" value="0x64EA0000" />\r
 +<property name="BASEADDRESS_HID" value="0x688F0000" />\r
 +<property name="BASEADDRESS_PSXDLL" value="0x68eb0000" />\r
 +<property name="BASEADDRESS_NETPLWIZ" value="0x6a240000" />\r
 +<property name="BASEADDRESS_DISPLAY" value="DISPLAY" />\r
 +<property name="BASEADDRESS_ACLUI" value="0x71550000" />\r
 +<property name="BASEADDRESS_MSWSOCK" value="0x71a30000" />\r
 +<property name="BASEADDRESS_WINFAX" value="0x722C0000" />\r
 +<property name="BASEADDRESS_DEVMGR" value="0x72a90000" />\r
 +<property name="BASEADDRESS_WINSCARD" value="0x723D0000" />\r
 +<property name="BASEADDRESS_COREDLL" value="0x73d80000" />\r
 +<property name="BASEADDRESS_OLEDLG" value="0x74d00000" />\r
 +<property name="BASEADDRESS_COMMCTRL" value="0x75e60000" />\r
 +<property name="BASEADDRESS_D3D8THK" value="0x76340000" />\r
 +<property name="BASEADDRESS_LSASRV" value="0x76540000" />\r
 +<property name="BASEADDRESS_ODBC32" value="0x76660000" />\r
 +<property name="BASEADDRESS_MSACM32" value="0x77400000" />\r
 +<property name="BASEADDRESS_PACKET" value="0x77780000" />\r
 +<property name="BASEADDRESS_W2_32" value="0x77780000" />\r
 +<property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" />\r
 +<property name="BASEADDRESS_WSHTCPIP" value="0x777c0000" />\r
 +<property name="BASEADDRESS_EXPAT" value="0x79000000" />\r
index 4d23158,0000000..04c24f4
mode 100644,000000..100644
--- /dev/null
@@@ -1,6 -1,0 +1,17 @@@
-       <file>serial.c</file>\r
 +<module name="serial" type="kernelmodedriver" installbase="system32/drivers" installname="serial.sys">\r
++      <define name="__USE_W32API" />\r
 +      <library>ntoskrnl</library>\r
 +      <library>hal</library>\r
++      <file>circularbuffer.c</file>\r
++      <file>cleanup.c</file>\r
++      <file>close.c</file>\r
++      <file>create.c</file>\r
++      <file>devctrl.c</file>\r
++      <file>info.c</file>\r
++      <file>legacy.c</file>\r
++      <file>misc.c</file>\r
++      <file>pnp.c</file>\r
++      <file>power.c</file>\r
++      <file>rw.c</file>\r
 +      <file>serial.rc</file>\r
 +</module>\r
Simple merge
index 1f83ac9,0000000..6b2d2e1
mode 100644,000000..100644
--- /dev/null
@@@ -1,20 -1,0 +1,22 @@@
 +<module name="halmp" type="kernelmodedll">\r
 +      <importlibrary definition="../../hal/hal.def" />\r
 +      <include base="hal_generic">../include</include>\r
 +      <include base="ntoskrnl">include</include>\r
 +      <define name="_DISABLE_TIDENTS" />\r
 +      <define name="CONFIG_SMP" />\r
 +      <define name="__NTHAL__" />\r
 +      <library>hal_generic</library>\r
 +      <library>hal_generic_pc</library>\r
 +      <library>ntoskrnl</library>\r
 +      <file>apic.c</file>\r
 +      <file>halinit_mp.c</file>\r
++      <file>ioapic.c</file>\r
 +      <file>ipi_mp.c</file>\r
++      <file>mpconfig.c</file>\r
 +      <file>mps.S</file>\r
 +      <file>mpsboot.asm</file>\r
 +      <file>mpsirql.c</file>\r
 +      <file>processor_mp.c</file>\r
 +      <file>resource_mp.c</file>\r
 +      <file>halmp.rc</file>\r
 +</module>\r
index 0000000,0000000..10b4d1f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,3 @@@
++<directory name="idl">
++      <xi:include href="idl/idl.xml" />
++</directory>
Simple merge
index 0000000,0000000..57f5d45
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,12 @@@
++<module name="pnp_server" type="rpcserver">
++      <include base="ReactOS">.</include>
++      <include base="ReactOS">w32api/include</include>
++      <define name="_X86_" />
++      <file>pnp.idl</file>
++</module>
++<module name="pnp_client" type="rpcclient">
++      <include base="ReactOS">.</include>
++      <include base="ReactOS">w32api/include</include>
++      <define name="_X86_" />
++      <file>pnp.idl</file>
++</module>
index 784440f,0000000..4e34e94
mode 100644,000000..100644
--- /dev/null
@@@ -1,20 -1,0 +1,21 @@@
 +<module name="adns" type="staticlibrary">\r
 +      <include base="adns">src</include>\r
 +      <include base="adns">adns_win32</include>\r
++      <define name="__USE_W32API" />\r
 +      <define name="ADNS_JGAA_WIN32" />\r
 +      <directory name="adns_win32">\r
 +              <file>adns_unix_calls.c</file>\r
 +      </directory>\r
 +      <directory name="src">\r
 +              <file>check.c</file>\r
 +              <file>event.c</file>\r
 +              <file>general.c</file>\r
 +              <file>parse.c</file>\r
 +              <file>poll.c</file>\r
 +              <file>query.c</file>\r
 +              <file>reply.c</file>\r
 +              <file>setup.c</file>\r
 +              <file>transmit.c</file>\r
 +              <file>types.c</file>\r
 +      </directory>\r
 +</module>\r
index b616d68,0000000..518bdec
mode 100644,000000..100644
--- /dev/null
@@@ -1,21 -1,0 +1,21 @@@
- <module name="sysdm" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_SYSDM}" installbase="system32" installname="sysdm.cpl">\r
++<module name="sysdm" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_SYSDM}" installbase="system32" installname="sysdm.cpl" usewrc="false">\r
 +      <importlibrary definition="sysdm.def" />\r
 +      <include base="sysdm">.</include>\r
 +      <define name="UNICODE" />\r
 +      <define name="_UNICODE" />\r
 +      <define name="__REACTOS__" />\r
 +      <define name="__USE_W32API" />\r
 +      <define name="_WIN32_IE">0x600</define>\r
 +      <define name="_WIN32_WINNT">0x501</define>\r
 +      <library>kernel32</library>\r
 +      <library>user32</library>\r
 +      <library>comctl32</library>\r
 +      <file>advanced.c</file>\r
 +      <file>computer.c</file>\r
 +      <file>environment.c</file>\r
 +      <file>general.c</file>\r
 +      <file>hardware.c</file>\r
 +      <file>sysdm.c</file>\r
 +      <file>userprofile.c</file>\r
 +      <file>sysdm.rc</file>\r
 +</module>\r
index 05c33d1,0000000..7fe706b
mode 100644,000000..100644
--- /dev/null
@@@ -1,273 -1,0 +1,279 @@@
 +<directory name="acledit">\r
 +      <xi:include href="acledit/acledit.xml" />\r
 +</directory>\r
 +<directory name="aclui">\r
 +      <xi:include href="aclui/aclui.xml" />\r
 +</directory>\r
 +<directory name="adns">\r
 +      <xi:include href="adns/adns.xml" />\r
 +</directory>\r
 +<directory name="advapi32">\r
 +      <xi:include href="advapi32/advapi32.xml" />\r
 +</directory>\r
 +<directory name="advpack">\r
 +      <xi:include href="advpack/advpack.xml" />\r
 +</directory>\r
 +<directory name="cabinet">\r
 +      <xi:include href="cabinet/cabinet.xml" />\r
 +</directory>\r
 +<directory name="cards">\r
 +      <xi:include href="cards/cards.xml" />\r
 +</directory>\r
 +<directory name="comctl32">\r
 +      <xi:include href="comctl32/comctl32.xml" />\r
 +</directory>\r
 +<directory name="comdlg32">\r
 +      <xi:include href="comdlg32/comdlg32.xml" />\r
 +</directory>\r
 +<directory name="cpl">\r
 +      <xi:include href="cpl/directory.xml" />\r
 +</directory>\r
 +<directory name="crt">\r
 +      <xi:include href="crt/crt.xml" />\r
 +</directory>\r
 +<directory name="crtdll">\r
 +      <xi:include href="crtdll/crtdll.xml" />\r
 +</directory>\r
 +<directory name="dbghelp">\r
 +      <xi:include href="dbghelp/dbghelp.xml" />\r
 +</directory>\r
 +<directory name="devenum">\r
 +      <xi:include href="devenum/devenum.xml" />\r
 +</directory>\r
 +<directory name="dinput">\r
 +      <xi:include href="dinput/dinput.xml" />\r
 +</directory>\r
 +<directory name="dinput8">\r
 +      <xi:include href="dinput8/dinput8.xml" />\r
 +</directory>\r
 +<directory name="dnsapi">\r
 +      <xi:include href="dnsapi/dnsapi.xml" />\r
 +</directory>\r
 +<directory name="dsound">\r
 +      <xi:include href="dsound/dsound.xml" />\r
 +</directory>\r
 +<directory name="dxdiagn">\r
 +      <xi:include href="dxdiagn/dxdiagn.xml" />\r
 +</directory>\r
 +<directory name="dxguid">\r
 +      <xi:include href="dxguid/dxguid.xml" />\r
 +</directory>\r
 +<directory name="epsapi">\r
 +      <xi:include href="epsapi/epsapi.xml" />\r
 +</directory>\r
 +<directory name="expat">\r
 +      <xi:include href="expat/expat.xml" />\r
 +</directory>\r
 +<directory name="fmifs">\r
 +      <xi:include href="fmifs/fmifs.xml" />\r
 +</directory>\r
 +<directory name="freetype">\r
 +      <xi:include href="freetype/freetype.xml" />\r
 +</directory>\r
 +<directory name="fslib">\r
 +      <xi:include href="fslib/directory.xml" />\r
 +</directory>\r
 +<directory name="gdi32">\r
 +      <xi:include href="gdi32/gdi32.xml" />\r
 +</directory>\r
 +<directory name="gdiplus">\r
 +      <xi:include href="gdiplus/gdiplus.xml" />\r
 +</directory>\r
 +<directory name="glu32">\r
 +      <xi:include href="glu32/glu32.xml" />\r
 +</directory>\r
 +<directory name="imagehlp">\r
 +      <xi:include href="imagehlp/imagehlp.xml" />\r
 +</directory>\r
 +<directory name="imm32">\r
 +      <xi:include href="imm32/imm32.xml" />\r
 +</directory>\r
 +<directory name="iphlpapi">\r
 +      <xi:include href="iphlpapi/iphlpapi.xml" />\r
 +</directory>\r
 +<directory name="kbdda">\r
 +      <xi:include href="kbdda/kbdda.xml" />\r
 +</directory>\r
 +<directory name="kbddv">\r
 +      <xi:include href="kbddv/kbddv.xml" />\r
 +</directory>\r
 +<directory name="kbdes">\r
 +      <xi:include href="kbdes/kbdes.xml" />\r
 +</directory>\r
 +<directory name="kbdfr">\r
 +      <xi:include href="kbdfr/kbdfr.xml" />\r
 +</directory>\r
 +<directory name="kbdgr">\r
 +      <xi:include href="kbdgr/kbdgr.xml" />\r
 +</directory>\r
 +<directory name="kbdse">\r
 +      <xi:include href="kbdse/kbdse.xml" />\r
 +</directory>\r
 +<directory name="kbduk">\r
 +      <xi:include href="kbduk/kbduk.xml" />\r
 +</directory>\r
 +<directory name="kbdus">\r
 +      <xi:include href="kbdus/kbdus.xml" />\r
 +</directory>\r
 +<directory name="kernel32">\r
 +      <xi:include href="kernel32/kernel32.xml" />\r
 +</directory>\r
 +<directory name="kjs">\r
 +      <xi:include href="kjs/kjs.xml" />\r
 +</directory>\r
 +<directory name="libwine">\r
 +      <xi:include href="libwine/libwine.xml" />\r
 +</directory>\r
 +<directory name="lzexpand">\r
 +      <xi:include href="lzexpand/lz32.xml" />\r
 +</directory>\r
 +<directory name="mesa32">\r
 +      <xi:include href="mesa32/mesa32.xml" />\r
 +</directory>\r
 +<directory name="midimap">\r
 +      <xi:include href="midimap/midimap.xml" />\r
 +</directory>\r
 +<directory name="mmdrv">\r
 +      <xi:include href="mmdrv/mmdrv.xml" />\r
 +</directory>\r
 +<directory name="mpr">\r
 +      <xi:include href="mpr/mpr.xml" />\r
 +</directory>\r
 +<directory name="msacm">\r
 +      <xi:include href="msacm/msacm32.xml" />\r
 +</directory>\r
 +<directory name="msafd">\r
 +      <xi:include href="msafd/msafd.xml" />\r
 +</directory>\r
 +<directory name="msgina">\r
 +      <xi:include href="msgina/msgina.xml" />\r
 +</directory>\r
 +<directory name="msimg32">\r
 +      <xi:include href="msimg32/msimg32.xml" />\r
 +</directory>\r
 +<directory name="msvcrt">\r
 +      <xi:include href="msvcrt/msvcrt.xml" />\r
 +</directory>\r
 +<directory name="msvcrt20">\r
 +      <xi:include href="msvcrt20/msvcrt20.xml" />\r
 +</directory>\r
 +<directory name="netapi32">\r
 +      <xi:include href="netapi32/netapi32.xml" />\r
 +</directory>\r
 +<directory name="ntdll">\r
 +      <xi:include href="ntdll/ntdll.xml" />\r
 +</directory>\r
 +<directory name="ole32">\r
 +      <xi:include href="ole32/ole32.xml" />\r
 +</directory>\r
 +<directory name="oleaut32">\r
 +      <xi:include href="oleaut32/oleaut32.xml" />\r
 +</directory>\r
 +<directory name="olepro32">\r
 +      <xi:include href="olepro32/olepro32.xml" />\r
 +</directory>\r
 +<directory name="opengl32">\r
 +      <xi:include href="opengl32/opengl32.xml" />\r
 +</directory>\r
 +<directory name="psapi">\r
 +      <xi:include href="psapi/psapi.xml" />\r
 +</directory>\r
 +<directory name="pseh">\r
 +      <xi:include href="pseh/pseh.xml" />\r
 +</directory>\r
 +<directory name="richedit">\r
 +      <xi:include href="richedit/riched32.xml" />\r
 +</directory>\r
++<directory name="riched20">\r
++      <xi:include href="riched20/riched20.xml" />\r
++</directory>\r
 +<directory name="rosrtl">\r
 +      <xi:include href="rosrtl/rosrtl.xml" />\r
 +</directory>\r
 +<directory name="rossym">\r
 +      <xi:include href="rossym/rossym.xml" />\r
 +</directory>\r
 +<directory name="rpcrt4">\r
 +      <xi:include href="rpcrt4/rpcrt4.xml" />\r
 +</directory>\r
 +<directory name="rtl">\r
 +      <xi:include href="rtl/rtl.xml" />\r
 +</directory>\r
 +<directory name="samlib">\r
 +      <xi:include href="samlib/samlib.xml" />\r
 +</directory>\r
 +<directory name="secur32">\r
 +      <xi:include href="secur32/secur32.xml" />\r
 +</directory>\r
 +<directory name="setupapi">\r
 +      <xi:include href="setupapi/setupapi.xml" />\r
 +</directory>\r
 +<directory name="shdocvw">\r
 +      <xi:include href="shdocvw/shdocvw.xml" />\r
 +</directory>\r
 +<directory name="shell32">\r
 +      <xi:include href="shell32/shell32.xml" />\r
 +</directory>\r
 +<directory name="shlwapi">\r
 +      <xi:include href="shlwapi/shlwapi.xml" />\r
 +</directory>\r
 +<directory name="snmpapi">\r
 +      <xi:include href="snmpapi/snmpapi.xml" />\r
 +</directory>\r
 +<directory name="smdll">\r
 +      <xi:include href="smdll/smdll.xml" />\r
 +</directory>\r
++<directory name="smlib">\r
++      <xi:include href="smlib/smlib.xml" />\r
++</directory>\r
 +<directory name="string">\r
 +      <xi:include href="string/string.xml" />\r
 +</directory>\r
 +<directory name="strmiids">\r
 +      <xi:include href="strmiids/strmiids.xml" />\r
 +</directory>\r
 +<directory name="syssetup">\r
 +      <xi:include href="syssetup/syssetup.xml" />\r
 +</directory>\r
 +<directory name="twain">\r
 +      <xi:include href="twain/twain_32.xml" />\r
 +</directory>\r
 +<directory name="urlmon">\r
 +      <xi:include href="urlmon/urlmon.xml" />\r
 +</directory>\r
 +<directory name="user32">\r
 +      <xi:include href="user32/user32.xml" />\r
 +</directory>\r
 +<directory name="userenv">\r
 +      <xi:include href="userenv/userenv.xml" />\r
 +</directory>\r
 +<directory name="uuid">\r
 +      <xi:include href="uuid/uuid.xml" />\r
 +</directory>\r
 +<directory name="version">\r
 +      <xi:include href="version/version.xml" />\r
 +</directory>\r
 +<directory name="wininet">\r
 +      <xi:include href="wininet/wininet.xml" />\r
 +</directory>\r
 +<directory name="winmm">\r
 +      <xi:include href="winmm/winmm.xml" />\r
 +</directory>\r
 +<directory name="winspool">\r
 +      <xi:include href="winspool/winspool.xml" />\r
 +</directory>\r
 +<directory name="ws2_32">\r
 +      <xi:include href="ws2_32/ws2_32.xml" />\r
 +</directory>\r
 +<directory name="ws2help">\r
 +      <xi:include href="ws2help/ws2help.xml" />\r
 +</directory>\r
 +<directory name="wshirda">\r
 +      <xi:include href="wshirda/wshirda.xml" />\r
 +</directory>\r
 +<directory name="wsock32">\r
 +      <xi:include href="wsock32/wsock32.xml" />\r
 +</directory>\r
 +<directory name="zlib">\r
 +      <xi:include href="zlib/zlib.xml" />\r
 +</directory>\r
index b157624,0000000..7008492
mode 100644,000000..100644
--- /dev/null
@@@ -1,38 -1,0 +1,40 @@@
-               <file>bitblt.c</file>\r
 +<module name="gdi32" type="win32dll" baseaddress="${BASEADDRESS_GDI32}" installbase="system32" installname="gdi32.dll">\r
 +      <importlibrary definition="gdi32.def" />\r
 +      <include base="gdi32">include</include>\r
 +      <define name="_DISABLE_TIDENTS" />\r
 +      <define name="UNICODE" />\r
 +      <define name="__USE_W32API" />\r
 +      <define name="WINVER">0x0600</define>\r
 +      <define name="_WIN32_WINNT">0x0501</define>\r
 +      <library>ntdll</library>\r
 +      <library>rosrtl</library>\r
 +      <library>kernel32</library>\r
 +      <library>advapi32</library>\r
 +      <directory name="include">\r
 +              <pch>precomp.h</pch>\r
 +      </directory>\r
 +      <directory name="main">\r
 +              <file>dllmain.c</file>\r
 +      </directory>\r
 +      <directory name="misc">\r
 +              <file>heap.c</file>\r
 +              <file>misc.c</file>\r
 +              <file>stubs.c</file>\r
 +              <file>stubsa.c</file>\r
 +              <file>stubsw.c</file>\r
 +              <file>win32k.S</file>\r
 +              <file>wingl.c</file>\r
 +      </directory>\r
 +      <directory name="objects">\r
++              <file>bitmap.c</file>\r
++              <file>brush.c</file>\r
 +              <file>dc.c</file>\r
 +              <file>font.c</file>\r
 +              <file>linedda.c</file>\r
 +              <file>metafile.c</file>\r
 +              <file>region.c</file>\r
 +              <file>text.c</file>\r
++              <file>utils.c</file>\r
 +      </directory>\r
 +      <file>gdi32.rc</file>\r
 +</module>\r
Simple merge
index d4d562b,0000000..315f50f
mode 100644,000000..100644
--- /dev/null
@@@ -1,126 -1,0 +1,127 @@@
 +<module name="kernel32_base" type="objectlibrary">\r
 +      <include base="kernel32_base">.</include>\r
 +      <include base="kernel32_base">include</include>\r
 +      <define name="_DISABLE_TIDENTS" />\r
 +      <define name="_SEH_NO_NATIVE_NLG" />\r
 +      <define name="WINVER">0x0500</define>\r
 +      <pch>k32.h</pch>\r
 +      <directory name="debug">\r
 +              <file>break.c</file>\r
 +              <file>debugger.c</file>\r
 +              <file>output.c</file>\r
 +      </directory>\r
 +      <directory name="except">\r
 +              <file>except.c</file>\r
 +      </directory>\r
 +      <directory name="file">\r
 +              <file>backup.c</file>\r
 +              <file>bintype.c</file>\r
 +              <file>cnotify.c</file>\r
 +              <file>copy.c</file>\r
 +              <file>create.c</file>\r
 +              <file>curdir.c</file>\r
 +              <file>delete.c</file>\r
 +              <file>deviceio.c</file>\r
 +              <file>dir.c</file>\r
 +              <file>dosdev.c</file>\r
 +              <file>file.c</file>\r
 +              <file>find.c</file>\r
 +              <file>hardlink.c</file>\r
 +              <file>iocompl.c</file>\r
 +              <file>lfile.c</file>\r
 +              <file>lock.c</file>\r
 +              <file>mailslot.c</file>\r
 +              <file>move.c</file>\r
 +              <file>npipe.c</file>\r
 +              <file>pipe.c</file>\r
 +              <file>rw.c</file>\r
 +              <file>tape.c</file>\r
 +              <file>volume.c</file>\r
 +      </directory>\r
 +      <directory name="mem">\r
 +              <file>global.c</file>\r
 +              <file>heap.c</file>\r
 +              <file>isbad.c</file>\r
 +              <file>local.c</file>\r
 +              <file>procmem.c</file>\r
 +              <file>resnotify.c</file>\r
 +              <file>section.c</file>\r
 +              <file>virtual.c</file>\r
 +      </directory>\r
 +      <directory name="misc">\r
 +              <file>atom.c</file>\r
 +              <file>chartype.c</file>\r
 +              <file>comm.c</file>\r
 +              <file>computername.c</file>\r
 +              <file>console.c</file>\r
 +              <file>dllmain.c</file>\r
 +              <file>env.c</file>\r
 +              <file>error.c</file>\r
 +              <file>errormsg.c</file>\r
 +              <file>handle.c</file>\r
 +              <file>lang.c</file>\r
 +              <file>lcformat.c</file>\r
 +              <file>ldr.c</file>\r
 +              <file>lzexpand_main.c</file>\r
 +              <file>muldiv.c</file>\r
 +              <file>nls.c</file>\r
 +              <file>perfcnt.c</file>\r
 +              <file>profile.c</file>\r
 +              <file>res.c</file>\r
 +              <file>stubs.c</file>\r
 +              <file>sysinfo.c</file>\r
 +              <file>time.c</file>\r
 +              <file>timerqueue.c</file>\r
 +              <file>toolhelp.c</file>\r
++              <file>version.c</file>\r
 +      </directory>\r
 +      <directory name="process">\r
 +              <file>cmdline.c</file>\r
 +              <file>create.c</file>\r
 +              <file>job.c</file>\r
 +              <file>proc.c</file>\r
 +              <file>session.c</file>\r
 +      </directory>\r
 +      <directory name="string">\r
 +              <file>lstring.c</file>\r
 +      </directory>\r
 +      <directory name="synch">\r
 +              <file>critical.c</file>\r
 +              <file>event.c</file>\r
 +              <file>intrlck.c</file>\r
 +              <file>mutex.c</file>\r
 +              <file>sem.c</file>\r
 +              <file>timer.c</file>\r
 +              <file>wait.c</file>\r
 +      </directory>\r
 +      <directory name="thread">\r
 +              <directory name="i386">\r
 +                      <file>fiber.S</file>\r
 +              </directory>\r
 +              <file>fiber.c</file>\r
 +              <file>fls.c</file>\r
 +              <file>thread.c</file>\r
 +              <file>tls.c</file>\r
 +      </directory>\r
 +</module>\r
 +<module name="kernel32" type="win32dll" baseaddress="${BASEADDRESS_KERNEL32}" installbase="system32" installname="kernel32.dll">\r
 +      <importlibrary definition="kernel32.def" />\r
 +      <include base="kernel32">.</include>\r
 +      <include base="kernel32">include</include>\r
 +      <define name="_DISABLE_TIDENTS" />\r
 +      <define name="_SEH_NO_NATIVE_NLG" />\r
 +      <define name="WINVER">0x0500</define>\r
 +      <library>kernel32_base</library>\r
 +      <library>pseh</library>\r
 +      <library>rosrtl</library>\r
 +      <library>ntdll</library>\r
 +      <linkerflag>-lgcc</linkerflag>\r
 +      <linkerflag>-nostartfiles</linkerflag>\r
 +      <linkerflag>-nostdlib</linkerflag>\r
 +      <file>kernel32.rc</file>\r
 +</module>\r
 +<!--\r
 +<directory name="tests">\r
 +      <xi:include href="tests/kernel32.xml" />\r
 +</directory>\r
 +-->\r
Simple merge
Simple merge
index a5df8e6,0000000..fcb08f1
mode 100644,000000..100644
--- /dev/null
@@@ -1,110 -1,0 +1,107 @@@
-       <library>rosrtl</library>\r
 +<module name="ntdll" type="nativedll" baseaddress="${BASEADDRESS_NTDLL}" installbase="system32" installname="ntdll.dll">\r
 +      <bootstrap base="reactos/system32" />\r
 +      <importlibrary definition="def/ntdll.def" />\r
 +      <define name="__NTDLL__" />\r
 +      <define name="_DISABLE_TIDENTS" />\r
-                       <file>chkstk.s</file>\r
 +      <library>rtl</library>\r
++      <library>rosrtl</library>\r
 +      <library>string</library>\r
 +      <linkerflag>-lgcc</linkerflag>\r
 +      <directory name="csr">\r
 +              <file>capture.c</file>\r
 +              <file>lpc.c</file>\r
 +              <file>probe.c</file>\r
 +              <file>thread.c</file>\r
 +      </directory>\r
 +      <directory name="dbg">\r
 +              <file>brkpoint.c</file>\r
 +              <file>debug.c</file>\r
 +              <file>print.c</file>\r
 +      </directory>\r
 +      <directory name="ldr">\r
 +              <file>entry.S</file>\r
 +              <file>res.c</file>\r
 +              <file>startup.c</file>\r
 +              <file>utils.c</file>\r
 +      </directory>\r
 +      <directory name="main">\r
 +              <file>dllmain.c</file>\r
 +      </directory>\r
 +      <directory name="rtl">\r
 +              <directory name="i386">\r
 +                      <file>alldiv.s</file>\r
 +                      <file>allmul.s</file>\r
 +                      <file>allrem.s</file>\r
 +                      <file>allshl.s</file>\r
 +                      <file>allshr.s</file>\r
 +                      <file>aulldiv.s</file>\r
 +                      <file>aullrem.s</file>\r
 +                      <file>aullshr.s</file>\r
-               <file>ppb.c</file>\r
 +                      <file>exception.c</file>\r
 +                      <file>float.c</file>\r
 +                      <file>ftol.c</file>\r
 +              </directory>\r
 +              <file>access.c</file>\r
 +              <file>apc.c</file>\r
 +              <file>atom.c</file>\r
 +              <file>callback.c</file>\r
 +              <file>crc32.c</file>\r
 +              <file>critical.c</file>\r
 +              <file>dbgbuffer.c</file>\r
 +              <file>exception.c</file>\r
 +              <file>handle.c</file>\r
 +              <file>intrlck.c</file>\r
 +              <file>libsupp.c</file>\r
 +              <file>math.c</file>\r
 +              <file>message.c</file>\r
 +              <file>misc.c</file>\r
 +              <file>path.c</file>\r
-               <file>thread.c</file>\r
 +              <file>process.c</file>\r
 +              <file>propvar.c</file>\r
 +              <file>rangelist.c</file>\r
 +              <file>resource.c</file>\r
 +              <file>teb.c</file>\r
 +              <file>timerqueue.c</file>\r
 +      </directory>\r
 +      <directory name="stdio">\r
 +              <file>sprintf.c</file>\r
 +              <file>sscanf.c</file>\r
 +              <file>swprintf.c</file>\r
 +      </directory>\r
 +      <directory name="stdlib">\r
 +              <file>abs.c</file>\r
 +              <file>atoi64.c</file>\r
 +              <file>atoi.c</file>\r
 +              <file>atol.c</file>\r
 +              <file>bsearch.c</file>\r
 +              <file>itoa.c</file>\r
 +              <file>itow.c</file>\r
 +              <file>labs.c</file>\r
 +              <file>lfind.c</file>\r
 +              <file>mbstowcs.c</file>\r
 +              <file>splitp.c</file>\r
 +              <file>strtol.c</file>\r
 +              <file>strtoul.c</file>\r
 +              <file>wcstol.c</file>\r
 +              <file>wcstombs.c</file>\r
 +              <file>wcstoul.c</file>\r
 +              <file>wtoi64.c</file>\r
 +              <file>wtoi.c</file>\r
 +              <file>wtol.c</file>\r
 +      </directory>\r
 +      <directory name="string">\r
 +              <file>ctype.c</file>\r
 +              <file>memicmp.c</file>\r
 +              <file>stricmp.c</file>\r
 +              <file>strlwr.c</file>\r
 +              <file>strnicmp.c</file>\r
 +              <file>strpbrk.c</file>\r
 +              <file>strstr.c</file>\r
 +              <file>strupr.c</file>\r
 +              <file>wstring.c</file>\r
 +      </directory>\r
 +      <directory name="def">\r
 +              <file>ntdll.rc</file>\r
 +      </directory>\r
 +      <file>napi.S</file>\r
 +</module>\r
index fe35b86,0000000..9cc776b
mode 100644,000000..100644
--- /dev/null
@@@ -1,51 -1,0 +1,52 @@@
 +<module name="ole32" type="win32dll" baseaddress="${BASEADDRESS_OLE32}" installbase="system32" installname="ole32.dll">\r
 +      <importlibrary definition="ole32.spec.def" />\r
 +      <include base="ole32">.</include>\r
 +      <include base="ReactOS">include/wine</include>\r
 +      <define name="UNICODE" />\r
 +      <define name="_UNICODE" />\r
 +      <define name="__REACTOS__" />\r
 +      <define name="__USE_W32API" />\r
 +      <define name="_WIN32_IE">0x600</define>\r
 +      <define name="_WIN32_WINNT">0x501</define>\r
 +      <define name="WINVER">0x501</define>\r
 +      <library>wine</library>\r
 +      <library>uuid</library>\r
 +      <library>ntdll</library>\r
 +      <library>kernel32</library>\r
 +      <library>advapi32</library>\r
 +      <library>gdi32</library>\r
 +      <library>user32</library>\r
 +      <library>rpcrt4</library>\r
 +      <file>antimoniker.c</file>\r
 +      <file>bindctx.c</file>\r
 +      <file>clipboard.c</file>\r
 +      <file>compobj.c</file>\r
 +      <file>compositemoniker.c</file>\r
 +      <file>datacache.c</file>\r
 +      <file>defaulthandler.c</file>\r
 +      <file>errorinfo.c</file>\r
 +      <file>filemoniker.c</file>\r
 +      <file>ftmarshal.c</file>\r
 +      <file>git.c</file>\r
 +      <file>hglobalstream.c</file>\r
 +      <file>ifs.c</file>\r
 +      <file>itemmoniker.c</file>\r
 +      <file>marshal.c</file>\r
 +      <file>memlockbytes.c</file>\r
 +      <file>moniker.c</file>\r
 +      <file>ole2.c</file>\r
 +      <file>ole2stubs.c</file>\r
 +      <file>ole2impl.c</file>\r
 +      <file>ole32_main.c</file>\r
 +      <file>oleobj.c</file>\r
 +      <file>oleproxy.c</file>\r
 +      <file>regsvr.c</file>\r
 +      <file>rpc.c</file>\r
 +      <file>stg_bigblockfile.c</file>\r
++      <file>stg_prop.c</file>\r
 +      <file>stg_stream.c</file>\r
 +      <file>storage32.c</file>\r
 +      <file>stubmanager.c</file>\r
 +      <file>ole32res.rc</file>\r
 +      <file>ole32.spec</file>\r
 +</module>\r
index b718a7c,0000000..e885c4e
mode 100644,000000..100644
--- /dev/null
@@@ -1,43 -1,0 +1,45 @@@
 +<module name="oleaut32" type="win32dll" baseaddress="${BASEADDRESS_OLEAUT32}" installbase="system32" installname="oleaut32.dll">\r
 +      <importlibrary definition="oleaut32.spec.def" />\r
 +      <include base="oleaut32">.</include>\r
 +      <include base="ReactOS">include/wine</include>\r
 +      <define name="UNICODE" />\r
 +      <define name="_UNICODE" />\r
 +      <define name="__REACTOS__" />\r
 +      <define name="__USE_W32API" />\r
 +      <define name="_WIN32_IE">0x600</define>\r
 +      <define name="_WIN32_WINNT">0x501</define>\r
 +      <define name="WINVER">0x501</define>\r
 +      <define name="_STDDEF_H" />\r
 +      <define name="_OLEAUT32_" />\r
 +      <define name="COM_NO_WINDOWS_H" />\r
 +      <library>wine</library>\r
 +      <library>uuid</library>\r
 +      <library>ntdll</library>\r
 +      <library>kernel32</library>\r
 +      <library>advapi32</library>\r
 +      <library>gdi32</library>\r
 +      <library>user32</library>\r
 +      <library>rpcrt4</library>\r
 +      <library>ole32</library>\r
 +      <library>comctl32</library>\r
++      <library>urlmon</library>\r
 +      <file>connpt.c</file>\r
 +      <file>dispatch.c</file>\r
 +      <file>hash.c</file>\r
 +      <file>oaidl_p.c</file>\r
 +      <file>oleaut.c</file>\r
 +      <file>olefont.c</file>\r
 +      <file>olepicture.c</file>\r
++      <file>recinfo.c</file>\r
 +      <file>regsvr.c</file>\r
 +      <file>safearray.c</file>\r
 +      <file>stubs.c</file>\r
 +      <file>tmarshal.c</file>\r
 +      <file>typelib.c</file>\r
 +      <file>typelib2.c</file>\r
 +      <file>usrmarshal.c</file>\r
 +      <file>varformat.c</file>\r
 +      <file>variant.c</file>\r
 +      <file>vartype.c</file>\r
 +      <file>oleaut32.spec</file>\r
 +</module>\r
index 5e62992,0000000..81a2cfe
mode 100644,000000..100644
--- /dev/null
@@@ -1,14 -1,0 +1,15 @@@
 +<module name="psapi" type="win32dll" baseaddress="${BASEADDRESS_PSAPI}" installbase="system32" installname="psapi.dll">\r
 +      <importlibrary definition="psapi.def" />\r
 +      <include base="psapi">.</include>\r
 +      <include base="psapi">include</include>\r
 +      <define name="_DISABLE_TIDENTS" />\r
++      <define name="__USE_W32API" />\r
 +      <library>epsapi</library>\r
 +      <library>pseh</library>\r
 +      <library>ntdll</library>\r
 +      <library>kernel32</library>\r
 +      <pch>precomp.h</pch>\r
 +      <file>malloc.c</file>\r
 +      <file>psapi.c</file>\r
 +      <file>psapi.rc</file>\r
 +</module>\r
index 0000000,0000000..cfc5135
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,33 @@@
++<module name="riched20" type="win32dll" baseaddress="${BASEADDRESS_RICHED20}">
++      <importlibrary definition="riched20.spec.def" />
++      <include base="riched20">.</include>
++      <include base="ReactOS">include/wine</include>
++      <define name="UNICODE" />
++      <define name="_UNICODE" />
++      <define name="__REACTOS__" />
++      <define name="__USE_W32API" />
++      <define name="_WIN32_IE">0x600</define>
++      <define name="_WIN32_WINNT">0x501</define>
++      <define name="WINVER">0x501</define>
++      <library>uuid</library>
++      <library>wine</library>
++      <library>ntdll</library>
++      <library>kernel32</library>
++      <library>user32</library>
++      <library>gdi32</library>
++      <file>caret.c</file>
++      <file>context.c</file>
++      <file>editor.c</file>
++      <file>list.c</file>
++      <file>paint.c</file>
++      <file>para.c</file>
++      <file>reader.c</file>
++      <file>richole.c</file>
++      <file>row.c</file>
++      <file>run.c</file>
++      <file>string.c</file>
++      <file>style.c</file>
++      <file>undo.c</file>
++      <file>wrap.c</file>
++      <file>riched20.spec</file>
++</module>
index 69a875a,0000000..6500a26
mode 100644,000000..100644
--- /dev/null
@@@ -1,20 -1,0 +1,19 @@@
-       <file>reader.c</file>\r
 +<module name="riched32" type="win32dll" baseaddress="${BASEADDRESS_RICHED32}">\r
 +      <importlibrary definition="riched32.spec.def" />\r
 +      <include base="riched32">.</include>\r
 +      <include base="ReactOS">include/wine</include>\r
 +      <define name="UNICODE" />\r
 +      <define name="_UNICODE" />\r
 +      <define name="__REACTOS__" />\r
 +      <define name="__USE_W32API" />\r
 +      <define name="_WIN32_IE">0x600</define>\r
 +      <define name="_WIN32_WINNT">0x501</define>\r
 +      <define name="WINVER">0x501</define>\r
 +      <library>wine</library>\r
 +      <library>ntdll</library>\r
 +      <library>kernel32</library>\r
 +      <library>user32</library>\r
-       <file>text-writer.c</file>\r
++      <library>riched20</library>\r
 +      <file>richedit.c</file>\r
 +      <file>riched32.spec</file>\r
 +</module>\r
index 147aa85,0000000..9a68976
mode 100644,000000..100644
--- /dev/null
@@@ -1,35 -1,0 +1,39 @@@
 +<module name="rtl" type="staticlibrary">\r
 +      <directory name="i386">\r
++              <file>chkstk.s</file>\r
 +              <file>except.s</file>\r
 +              <file>exception.c</file>\r
 +      </directory>\r
 +      <file>acl.c</file>\r
 +      <file>bit.c</file>\r
 +      <file>bitmap.c</file>\r
 +      <file>bootdata.c</file>\r
 +      <file>compress.c</file>\r
 +      <file>dos8dot3.c</file>\r
 +      <file>encode.c</file>\r
 +      <file>env.c</file>\r
 +      <file>error.c</file>\r
 +      <file>exception.c</file>\r
 +      <file>generictable.c</file>\r
 +      <file>heap.c</file>\r
 +      <file>image.c</file>\r
 +      <file>largeint.c</file>\r
 +      <file>luid.c</file>\r
 +      <file>mem.c</file>\r
 +      <file>network.c</file>\r
 +      <file>nls.c</file>\r
++      <file>ppb.c</file>\r
++      <file>process.c</file>\r
 +      <file>random.c</file>\r
 +      <file>registry.c</file>\r
 +      <file>sd.c</file>\r
 +      <file>security.c</file>\r
 +      <file>sid.c</file>\r
 +      <file>splaytree.c</file>\r
++      <file>thread.c</file>\r
 +      <file>time.c</file>\r
 +      <file>timezone.c</file>\r
 +      <file>unicode.c</file>\r
 +      <file>unicodeprefix.c</file>\r
 +      <file>version.c</file>\r
 +</module>\r
  #include "winreg.h"\r
  #include "setupapi.h"\r
  #include "cfgmgr32.h"\r
 -#include "pnp.h"\r
+ #include "setupapi_private.h"\r
\r
+ #include "rpc.h"\r
\r
++#include "pnp_c.h"\r
  \r
  #include "wine/debug.h"\r
  \r
index cea0b8c,0000000..739d6c5
mode 100644,000000..100644
--- /dev/null
@@@ -1,33 -1,0 +1,36 @@@
 +<module name="setupapi" type="win32dll" baseaddress="${BASEADDRESS_SETUPAPI}" installbase="system32" installname="setupapi.dll">\r
 +      <importlibrary definition="setupapi.spec.def" />\r
 +      <include base="setupapi">.</include>\r
 +      <include base="ReactOS">include/wine</include>\r
++      <include base="pnp_client">.</include>\r
 +      <define name="UNICODE" />\r
 +      <define name="_UNICODE" />\r
 +      <define name="__REACTOS__" />\r
 +      <define name="__USE_W32API" />\r
 +      <define name="_WIN32_IE">0x600</define>\r
 +      <define name="_WIN32_WINNT">0x501</define>\r
 +      <define name="WINVER">0x501</define>\r
 +      <define name="__WINESRC__" />\r
 +      <define name="_SETUPAPI_" />\r
++      <library>pnp_client</library>\r
 +      <library>wine</library>\r
 +      <library>ntdll</library>\r
 +      <library>kernel32</library>\r
 +      <library>advapi32</library>\r
 +      <library>user32</library>\r
 +      <library>rpcrt4</library>\r
 +      <library>version</library>\r
 +      <file>cfgmgr.c</file>\r
 +      <file>devinst.c</file>\r
 +      <file>dirid.c</file>\r
 +      <file>diskspace.c</file>\r
 +      <file>install.c</file>\r
 +      <file>misc.c</file>\r
 +      <file>parser.c</file>\r
 +      <file>queue.c</file>\r
 +      <file>setupcab.c</file>\r
 +      <file>stubs.c</file>\r
++      <file>rpc.c</file>\r
 +      <file>setupapi.rc</file>\r
 +      <file>setupapi.spec</file>\r
 +</module>\r
index 4441cec,0000000..4344f47
mode 100644,000000..100644
--- /dev/null
@@@ -1,11 -1,0 +1,10 @@@
-       <file>connect.c</file>\r
-       <file>execpgm.c</file>\r
-       <file>compses.c</file>\r
 +<module name="smdll" type="win32dll" baseaddress="${BASEADDRESS_SMDLL}" installbase="system32" installname="smdll.dll">\r
 +      <importlibrary definition="smdll.def" />\r
 +      <include base="smdll">.</include>\r
 +      <define name="_DISABLE_TIDENTS" />\r
++      <library>smlib</library>\r
 +      <library>ntdll</library>\r
 +      <file>dllmain.c</file>\r
++      <file>query.c</file>\r
 +      <file>smdll.rc</file>\r
 +</module>\r
index 0000000,0000000..6b06eb1
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,7 @@@
++<module name="smlib" type="staticlibrary">
++      <include base="smlib">.</include>
++      <define name="_DISABLE_TIDENTS" />
++      <file>connect.c</file>
++      <file>execpgm.c</file>
++      <file>compses.c</file>
++</module>
Simple merge
index 0000000,0000000..e69de29
new file mode 100644 (file)
--- /dev/null
--- /dev/null
Simple merge
Simple merge
index 7665b57,0000000..d9aa917
mode 100644,000000..100644
--- /dev/null
@@@ -1,370 -1,0 +1,367 @@@
-       <library>rosrtl</library>\r
 +<module name="ntoskrnl" type="kernel" installbase="system32" installname="ntoskrnl.exe">\r
 +      <bootstrap base="reactos" />\r
 +      <importlibrary definition="ntoskrnl.def" />\r
 +      <define name="_SEH_NO_NATIVE_NLG" />\r
 +      <define name="_DISABLE_TIDENTS" />\r
 +      <define name="__NTOSKRNL__" />\r
 +      <define name="__3GB__" />\r
 +      <include base="kjs">include</include>\r
 +      <include base="ntoskrnl">include</include>\r
 +      <library>csq</library>\r
 +      <library>hal</library>\r
 +      <library>kjs</library>\r
 +      <library>pseh</library>\r
-                               <file>usercall.c</file>\r
 +      <library>rtl</library>\r
++      <library>rosrtl</library>\r
 +      <library>string</library>\r
 +      <library>rossym</library>\r
 +      <directory name="include">\r
 +              <pch>ntoskrnl.h</pch>\r
 +      </directory>\r
 +      <directory name="ke">\r
 +              <if property="ARCH" value="i386">\r
 +                      <directory name="i386">\r
 +                              <file first="true">main.S</file>\r
 +                              <file>bios.c</file>\r
 +                              <file>brkpoint.c</file>\r
 +                              <file>bthread.S</file>\r
 +                              <file>exp.c</file>\r
 +                              <file>fpu.c</file>\r
 +                              <file>gdt.c</file>\r
 +                              <file>i386-mcount.S</file>\r
 +                              <file>idt.c</file>\r
 +                              <file>irq.c</file>\r
 +                              <file>irqhand.s</file>\r
 +                              <file>kernel.c</file>\r
 +                              <file>ldt.c</file>\r
 +                              <file>stkswitch.S</file>\r
 +                              <file>syscall.S</file>\r
 +                              <file>thread.c</file>\r
 +                              <file>tlbflush.S</file>\r
 +                              <file>trap.s</file>\r
 +                              <file>tskswitch.S</file>\r
 +                              <file>tss.c</file>\r
-               <file>alert.c</file>\r
++                              <file>usercall.S</file>\r
 +                              <file>usertrap.c</file>\r
 +                              <file>v86m.c</file>\r
 +                              <file>v86m_sup.S</file>\r
 +                              <file>vdm.c</file>\r
 +                      </directory>\r
 +              </if>\r
-               <file>critical.c</file>\r
 +              <file>apc.c</file>\r
 +              <file>bug.c</file>\r
 +              <file>catch.c</file>\r
 +              <file>clock.c</file>\r
-               <file>error.c</file>\r
 +              <file>device.c</file>\r
 +              <file>dpc.c</file>\r
-               <file>btree.c</file>\r
 +              <file>event.c</file>\r
 +              <file>gmutex.c</file>\r
 +              <file>ipi.c</file>\r
 +              <file>kqueue.c</file>\r
 +              <file>kthread.c</file>\r
 +              <file>main.c</file>\r
 +              <file>mutex.c</file>\r
 +              <file>process.c</file>\r
 +              <file>profile.c</file>\r
 +              <file>queue.c</file>\r
 +              <file>sem.c</file>\r
 +              <file>spinlock.c</file>\r
 +              <file>timer.c</file>\r
++              <file>usercall.c</file>\r
 +              <file>wait.c</file>\r
 +      </directory>\r
 +      <directory name="cc">\r
 +              <file>cacheman.c</file>\r
 +              <file>copy.c</file>\r
 +              <file>fs.c</file>\r
 +              <file>mdl.c</file>\r
 +              <file>pin.c</file>\r
 +              <file>view.c</file>\r
 +      </directory>\r
 +      <directory name="cm">\r
 +              <file>import.c</file>\r
 +              <file>ntfunc.c</file>\r
 +              <file>regfile.c</file>\r
 +              <file>registry.c</file>\r
 +              <file>regobj.c</file>\r
 +      </directory>\r
 +      <directory name="dbg">\r
 +              <if property="ARCH" value="i386">\r
 +                      <directory name="i386">\r
 +                              <if property="KDBG" value="1">\r
 +                                      <group>\r
 +                                              <file>i386-dis.c</file>\r
 +                                              <file>kdb_help.S</file>\r
 +                                      </group>\r
 +                              </if>\r
 +                      </directory>\r
 +              </if>\r
 +              <if property="KDBG" value="1">\r
 +                      <file>kdb.c</file>\r
 +                      <file>kdb_keyboard.c</file>\r
 +                      <file>kdb_serial.c</file>\r
 +                      <file>rdebug.c</file>\r
 +              </if>\r
 +              <if property="DBG_OR_KDBG" value="true">\r
 +                      <file>kdb_symbols.c</file>\r
 +                      <file>profile.c</file>\r
 +              </if>\r
 +              <file>dbgctrl.c</file>\r
 +              <file>errinfo.c</file>\r
 +              <file>print.c</file>\r
 +              <file>user.c</file>\r
 +      </directory>\r
 +      <directory name="ex">\r
 +              <if property="ARCH" value="i386">\r
 +                      <directory name="i386">\r
 +                              <file>interlck.c</file>\r
 +                      </directory>\r
 +              </if>\r
-               <file>hashtab.c</file>\r
 +              <file>callback.c</file>\r
++              <file>error.c</file>\r
 +              <file>event.c</file>\r
 +              <file>evtpair.c</file>\r
 +              <file>fmutex.c</file>\r
-               <file>napi.c</file>\r
++              <file>handle.c</file>\r
 +              <file>init.c</file>\r
 +              <file>interlck.c</file>\r
 +              <file>list.c</file>\r
 +              <file>lookas.c</file>\r
 +              <file>mutant.c</file>\r
-               <file>stree.c</file>\r
 +              <file>power.c</file>\r
 +              <file>profile.c</file>\r
 +              <file>resource.c</file>\r
 +              <file>rundown.c</file>\r
 +              <file>sem.c</file>\r
-               <file>tinfo.c</file>\r
-               <file>w32call.c</file>\r
 +              <file>synch.c</file>\r
 +              <file>sysinfo.c</file>\r
 +              <file>time.c</file>\r
 +              <file>timer.c</file>\r
 +              <file>util.c</file>\r
 +              <file>uuid.c</file>\r
 +              <file>win32k.c</file>\r
 +              <file>work.c</file>\r
 +              <file>zone.c</file>\r
 +              <file>zw.S</file>\r
 +      </directory>\r
 +      <directory name="fs">\r
 +              <file>dbcsname.c</file>\r
 +              <file>filelock.c</file>\r
 +              <file>mcb.c</file>\r
 +              <file>mdl.c</file>\r
 +              <file>name.c</file>\r
 +              <file>notify.c</file>\r
 +              <file>oplock.c</file>\r
 +              <file>pool.c</file>\r
 +              <file>tunnel.c</file>\r
 +              <file>unc.c</file>\r
 +              <file>util.c</file>\r
 +      </directory>\r
 +      <directory name="inbv">\r
 +              <file>inbv.c</file>\r
 +      </directory>\r
 +      <directory name="io">\r
 +              <file>adapter.c</file>\r
 +              <file>arcname.c</file>\r
 +              <file>bootlog.c</file>\r
 +              <file>buildirp.c</file>\r
 +              <file>cancel.c</file>\r
 +              <file>cleanup.c</file>\r
 +              <file>cntrller.c</file>\r
 +              <file>create.c</file>\r
 +              <file>device.c</file>\r
 +              <file>deviface.c</file>\r
 +              <file>dir.c</file>\r
 +              <file>driver.c</file>\r
 +              <file>efi.c</file>\r
 +              <file>errlog.c</file>\r
 +              <file>error.c</file>\r
 +              <file>event.c</file>\r
 +              <file>file.c</file>\r
 +              <file>flush.c</file>\r
 +              <file>fs.c</file>\r
 +              <file>iocomp.c</file>\r
 +              <file>ioctrl.c</file>\r
 +              <file>iomgr.c</file>\r
 +              <file>iowork.c</file>\r
 +              <file>irp.c</file>\r
 +              <file>irq.c</file>\r
 +              <file>lock.c</file>\r
 +              <file>mailslot.c</file>\r
 +              <file>mdl.c</file>\r
 +              <file>npipe.c</file>\r
 +              <file>page.c</file>\r
 +              <file>parttab.c</file>\r
 +              <file>plugplay.c</file>\r
 +              <file>pnpdma.c</file>\r
 +              <file>pnpmgr.c</file>\r
 +              <file>pnpnotify.c</file>\r
 +              <file>pnpreport.c</file>\r
 +              <file>pnproot.c</file>\r
 +              <file>process.c</file>\r
 +              <file>queue.c</file>\r
 +              <file>rawfs.c</file>\r
 +              <file>remlock.c</file>\r
 +              <file>resource.c</file>\r
 +              <file>rw.c</file>\r
 +              <file>share.c</file>\r
 +              <file>shutdown.c</file>\r
 +              <file>symlink.c</file>\r
 +              <file>timer.c</file>\r
 +              <file>vpb.c</file>\r
 +              <file>wdm.c</file>\r
 +              <file>wmi.c</file>\r
 +              <file>xhaldisp.c</file>\r
 +              <file>xhaldrv.c</file>\r
 +      </directory>\r
 +      <directory name="kd">\r
 +              <file>dlog.c</file>\r
 +              <file>gdbstub.c</file>\r
 +              <file>kdebug.c</file>\r
 +              <file>mda.c</file>\r
 +              <file>service.c</file>\r
 +      </directory>\r
 +      <directory name="ldr">\r
 +              <file>init.c</file>\r
 +              <file>loader.c</file>\r
 +              <file>resource.c</file>\r
 +              <file>rtl.c</file>\r
 +              <file>sysdll.c</file>\r
 +              <file>userldr.c</file>\r
 +      </directory>\r
 +      <directory name="lpc">\r
 +              <file>close.c</file>\r
 +              <file>complete.c</file>\r
 +              <file>connect.c</file>\r
 +              <file>create.c</file>\r
 +              <file>listen.c</file>\r
 +              <file>port.c</file>\r
 +              <file>query.c</file>\r
 +              <file>queue.c</file>\r
 +              <file>receive.c</file>\r
 +              <file>reply.c</file>\r
 +              <file>send.c</file>\r
 +      </directory>\r
 +      <directory name="mm">\r
 +              <if property="ARCH" value="i386">\r
 +                      <directory name="i386">\r
 +                              <file>memsafe.s</file>\r
 +                              <file>page.c</file>\r
 +                              <file>pfault.c</file>\r
 +                      </directory>\r
 +              </if>\r
 +              <file>anonmem.c</file>\r
 +              <file>aspace.c</file>\r
 +              <file>balance.c</file>\r
 +              <file>cont.c</file>\r
 +              <file>drvlck.c</file>\r
 +              <file>elf32.c</file>\r
 +              <file>elf64.c</file>\r
 +              <file>freelist.c</file>\r
 +              <file>iospace.c</file>\r
 +              <file>kmap.c</file>\r
 +              <file>marea.c</file>\r
 +              <file>mdl.c</file>\r
 +              <file>mm.c</file>\r
 +              <file>mminit.c</file>\r
 +              <file>mpw.c</file>\r
 +              <file>ncache.c</file>\r
 +              <file>npool.c</file>\r
 +              <file>pagefile.c</file>\r
 +              <file>pageop.c</file>\r
 +              <file>pager.c</file>\r
 +              <file>pagfault.c</file>\r
 +              <file>paging.c</file>\r
 +              <file>pe.c</file>\r
 +              <file>physical.c</file>\r
 +              <file>pool.c</file>\r
 +              <file>ppool.c</file>\r
 +              <file>region.c</file>\r
 +              <file>rmap.c</file>\r
 +              <file>section.c</file>\r
 +              <file>verifier.c</file>\r
 +              <file>virtual.c</file>\r
 +              <file>wset.c</file>\r
 +      </directory>\r
 +      <directory name="ob">\r
 +              <file>dirobj.c</file>\r
 +              <file>handle.c</file>\r
 +              <file>namespc.c</file>\r
 +              <file>ntobj.c</file>\r
 +              <file>object.c</file>\r
 +              <file>sdcache.c</file>\r
 +              <file>security.c</file>\r
 +              <file>symlink.c</file>\r
++              <file>wait.c</file>\r
 +      </directory>\r
 +      <directory name="po">\r
 +              <file>power.c</file>\r
 +      </directory>\r
 +      <directory name="ps">\r
 +              <if property="ARCH" value="i386">\r
 +                      <directory name="i386">\r
 +                              <file>continue.c</file>\r
 +                      </directory>\r
 +              </if>\r
 +              <file>cid.c</file>\r
 +              <file>create.c</file>\r
 +              <file>debug.c</file>\r
 +              <file>idle.c</file>\r
 +              <file>job.c</file>\r
 +              <file>kill.c</file>\r
 +              <file>locale.c</file>\r
 +              <file>process.c</file>\r
 +              <file>psmgr.c</file>\r
++              <file>query.c</file>\r
++              <file>security.c</file>\r
 +              <file>suspend.c</file>\r
 +              <file>thread.c</file>\r
 +              <file>win32.c</file>\r
 +      </directory>\r
 +      <directory name="rtl">\r
 +              <if property="ARCH" value="i386">\r
 +                      <directory name="i386">\r
 +                              <file>alldiv.s</file>\r
 +                              <file>allmul.s</file>\r
 +                              <file>allrem.s</file>\r
 +                              <file>allshl.s</file>\r
 +                              <file>allshr.s</file>\r
 +                              <file>aulldiv.s</file>\r
 +                              <file>aullrem.s</file>\r
 +                              <file>aullshr.s</file>\r
 +                              <file>exception.c</file>\r
 +                              <file>seh.s</file>\r
 +                      </directory>\r
 +              </if>\r
 +              <file>atom.c</file>\r
 +              <file>capture.c</file>\r
 +              <file>ctype.c</file>\r
 +              <file>handle.c</file>\r
 +              <file>libsupp.c</file>\r
 +              <file>message.c</file>\r
 +              <file>misc.c</file>\r
 +              <file>nls.c</file>\r
 +              <file>purecall.c</file>\r
 +              <file>rangelist.c</file>\r
 +              <file>regio.c</file>\r
 +              <file>sprintf.c</file>\r
 +              <file>stdlib.c</file>\r
 +              <file>string.c</file>\r
 +              <file>strtok.c</file>\r
 +              <file>swprintf.c</file>\r
 +              <file>wstring.c</file>\r
 +      </directory>\r
 +      <directory name="se">\r
 +              <file>access.c</file>\r
 +              <file>acl.c</file>\r
 +              <file>audit.c</file>\r
 +              <file>lsa.c</file>\r
 +              <file>luid.c</file>\r
 +              <file>priv.c</file>\r
 +              <file>sd.c</file>\r
 +              <file>semgr.c</file>\r
 +              <file>sid.c</file>\r
 +              <file>token.c</file>\r
 +      </directory>\r
 +      <file>ntoskrnl.rc</file>\r
 +</module>\r
index 6a0cbc4,0000000..aee66c5
mode 100644,000000..100644
--- /dev/null
@@@ -1,6 -1,0 +1,7 @@@
 +<module name="regtests" type="win32dll" baseaddress="${BASEADDRESS_REGTESTS}">\r
 +      <importlibrary definition="regtests.def" />\r
 +      <include base="regtests">.</include>\r
++      <define name="__USE_W32API" />\r
 +      <library>kernel32</library>\r
 +      <file>regtests.c</file>\r
 +</module>\r
index 28474b0,0000000..2775a2b
mode 100644,000000..100644
--- /dev/null
@@@ -1,8 -1,0 +1,9 @@@
 +<module name="rpcss" type="win32cui">\r
 +      <include base="rpcss">.</include>\r
++      <define name="__USE_W32API" />\r
 +      <library>kernel32</library>\r
 +      <library>advapi32</library>\r
 +      <file>rpcss.c</file>\r
 +      <file>endpoint.c</file>\r
 +      <file>rpcss.rc</file>\r
 +</module>\r
@@@ -41,6 -38,8 +38,8 @@@
  #include <rpc.h>\r
  #include <rpcdce.h>\r
  \r
 -#include "pnp.h"\r
++#include "pnp_s.h"\r
\r
  #define DBG\r
  #define NDEBUG\r
  #include <debug.h>\r
index 20c6130,0000000..84ff6f9
mode 100644,000000..100644
--- /dev/null
@@@ -1,10 -1,0 +1,14 @@@
 +<module name="umpnpmgr" type="win32cui" installbase="system32" installname="umpnpmgr.exe">\r
 +      <include base="umpnpmgr">.</include>\r
++      <include base="pnp_server">.</include>\r
 +      <define name="__USE_W32API" />\r
++      <define name="UNICODE" />\r
++      <define name="_UNICODE" />\r
++      <library>pnp_server</library>\r
 +      <library>ntdll</library>\r
 +      <library>kernel32</library>\r
 +      <library>advapi32</library>\r
 +      <library>rpcrt4</library>\r
 +      <file>umpnpmgr.c</file>\r
 +      <file>umpnpmgr.rc</file>\r
 +</module>\r
index 6d6ba16,0000000..626b1c2
mode 100644,000000..100644
--- /dev/null
@@@ -1,26 -1,0 +1,27 @@@
 +<module name="smss" type="nativecui" installbase="system32" installname="smss.exe">\r
 +      <include base="smss">.</include>\r
 +      <define name="_DISABLE_TIDENTS" />\r
 +      <library>ntdll</library>\r
 +      <library>smdll</library>\r
 +      <linkerflag>-lgcc</linkerflag>\r
 +      <file>client.c</file>\r
 +      <file>debug.c</file>\r
 +      <file>init.c</file>\r
 +      <file>initdosdev.c</file>\r
 +      <file>initenv.c</file>\r
 +      <file>initheap.c</file>\r
 +      <file>initmv.c</file>\r
 +      <file>initobdir.c</file>\r
 +      <file>initpage.c</file>\r
 +      <file>initreg.c</file>\r
 +      <file>initrun.c</file>\r
 +      <file>initss.c</file>\r
 +      <file>initwkdll.c</file>\r
 +      <file>print.c</file>\r
 +      <file>smapi.c</file>\r
 +      <file>smapicomp.c</file>\r
 +      <file>smapiexec.c</file>\r
++      <file>smapiquery.c</file>\r
 +      <file>smss.c</file>\r
 +      <file>smss.rc</file>\r
 +</module>\r
index 525be8a,0000000..3a4d3a8
mode 100644,000000..100644
--- /dev/null
@@@ -1,69 -1,0 +1,74 @@@
-       <library>uuid</library>\r
 +<module name="explorer" type="win32gui" installbase="system32" installname="explorer.exe">\r
++      <linkerflag>-luuid</linkerflag>\r
++      <linkerflag>-lstdc++</linkerflag>\r
 +      <linkerflag>-fexceptions</linkerflag>\r
 +      <include base="explorer">.</include>\r
 +      <include base="ReactOS">include/expat</include>\r
 +      <define name="__USE_W32API" />\r
 +      <define name="UNICODE" />\r
 +      <define name="WIN32" />\r
 +      <define name="_ROS_" />\r
 +      <define name="_WIN32_IE">0x0600</define>\r
 +      <define name="_WIN32_WINNT">0x0501</define>\r
 +      <define name="WINVER">0x0500</define>\r
 +      <define name="__WINDRES__" />\r
-               <file>startup.c</file>\r
 +      <library>kernel32</library>\r
 +      <library>gdi32</library>\r
++      <library>user32</library>\r
 +      <library>ws2_32</library>\r
 +      <library>msimg32</library>\r
 +      <library>comctl32</library>\r
 +      <library>ole32</library>\r
 +      <library>oleaut32</library>\r
 +      <library>shell32</library>\r
 +      <library>expat</library>\r
 +      <library>notifyhook</library>\r
 +      <pch>precomp.h</pch>\r
 +      <directory name="desktop">\r
 +              <file>desktop.cpp</file>\r
 +      </directory>\r
 +      <directory name="dialogs">\r
 +              <file>searchprogram.cpp</file>\r
 +              <file>settings.cpp</file>\r
 +      </directory>\r
 +      <directory name="shell">\r
 +              <file>entries.cpp</file>\r
 +              <file>fatfs.cpp</file>\r
 +              <file>filechild.cpp</file>\r
 +              <file>shellfs.cpp</file>\r
 +              <file>mainframe.cpp</file>\r
 +              <file>ntobjfs.cpp</file>\r
 +              <file>pane.cpp</file>\r
 +              <file>regfs.cpp</file>\r
 +              <file>shellbrowser.cpp</file>\r
 +              <file>unixfs.cpp</file>\r
 +              <file>webchild.cpp</file>\r
 +              <file>winfs.cpp</file>\r
 +      </directory>\r
++      <directory name="services">\r
++              <file>shellservices.cpp</file>\r
++              <file>startup.c</file>\r
++      </directory>\r
 +      <directory name="taskbar">\r
 +              <file>desktopbar.cpp</file>\r
 +              <file>favorites.cpp</file>\r
 +              <file>taskbar.cpp</file>\r
 +              <file>startmenu.cpp</file>\r
 +              <file>traynotify.cpp</file>\r
 +              <file>quicklaunch.cpp</file>\r
 +      </directory>\r
 +      <directory name="utility">\r
 +              <file>shellclasses.cpp</file>\r
 +              <file>utility.cpp</file>\r
 +              <file>window.cpp</file>\r
 +              <file>dragdropimpl.cpp</file>\r
 +              <file>shellbrowserimpl.cpp</file>\r
 +              <file>xmlstorage.cpp</file>\r
 +      </directory>\r
 +      <file>explorer.cpp</file>\r
 +      <file>i386-stub-win32.c</file>\r
 +      <file>explorer.rc</file>\r
 +</module>\r
 +<directory name="notifyhook">\r
 +      <xi:include href="notifyhook/notifyhook.xml" />\r
 +</directory>\r
index 6b00bca,0000000..ec904da
mode 100644,000000..100644
--- /dev/null
@@@ -1,6 -1,0 +1,8 @@@
 +<module name="format" type="win32cui" installbase="system32" installname="format.exe">\r
 +      <include base="format">.</include>\r
++      <define name="__USE_W32API" />\r
 +      <library>ntdll</library>\r
++      <library>kernel32</library>\r
 +      <library>fmifs</library>\r
 +      <file>format.c</file>\r
 +</module>\r
index f98776b,0000000..46004e1
mode 100644,000000..100644
--- /dev/null
@@@ -1,10 -1,0 +1,11 @@@
 +<module name="services" type="win32cui">\r
 +      <include base="services">.</include>\r
++      <define name="__USE_W32API" />\r
 +      <library>ntdll</library>\r
 +      <library>kernel32</library>\r
 +      <library>user32</library>\r
 +      <library>advapi32</library>\r
 +      <file>services.c</file>\r
 +      <file>database.c</file>\r
 +      <file>services.rc</file>\r
 +</module>\r
Simple merge
index 320e5e1,0000000..4e34985
mode 100644,000000..100644
--- /dev/null
@@@ -1,773 -1,0 +1,776 @@@
-       if ( module.type == ObjectLibrary )\r
 +\r
 +#include "../../pch.h"\r
 +\r
 +#include "mingw.h"\r
 +#include <assert.h>\r
 +#include <dirent.h>\r
 +#include "modulehandler.h"\r
 +\r
 +#ifdef WIN32\r
 +#define MKDIR(s) mkdir(s)\r
 +#else\r
 +#define MKDIR(s) mkdir(s, 0755)\r
 +#endif\r
 +\r
 +using std::string;\r
 +using std::vector;\r
 +using std::set;\r
 +using std::map;\r
 +\r
 +typedef set<string> set_string;\r
 +\r
 +\r
 +string\r
 +v2s ( const string_list& v, int wrap_at )\r
 +{\r
 +      if ( !v.size() )\r
 +              return "";\r
 +      string s;\r
 +      int wrap_count = 0;\r
 +      for ( size_t i = 0; i < v.size(); i++ )\r
 +      {\r
 +              if ( !v[i].size() )\r
 +                      continue;\r
 +              if ( wrap_at > 0 && wrap_count++ == wrap_at )\r
 +                      s += " \\\n\t\t";\r
 +              else if ( s.size() )\r
 +                      s += " ";\r
 +              s += v[i];\r
 +      }\r
 +      return s;\r
 +}\r
 +\r
 +\r
 +Directory::Directory ( const string& name_ )\r
 +      : name(name_)\r
 +{\r
 +}\r
 +\r
 +void\r
 +Directory::Add ( const char* subdir )\r
 +{\r
 +      size_t i;\r
 +      string s1 = string ( subdir );\r
 +      if ( ( i = s1.find ( '$' ) ) != string::npos )\r
 +      {\r
 +              throw InvalidOperationException ( __FILE__,\r
 +                                                __LINE__,\r
 +                                                "No environment variables can be used here. Path was %s",\r
 +                                                subdir );\r
 +      }\r
 +\r
 +      const char* p = strpbrk ( subdir, "/\\" );\r
 +      if ( !p )\r
 +              p = subdir + strlen(subdir);\r
 +      string s ( subdir, p-subdir );\r
 +      if ( subdirs.find(s) == subdirs.end() )\r
 +              subdirs[s] = new Directory(s);\r
 +      if ( *p && *++p )\r
 +              subdirs[s]->Add ( p );\r
 +}\r
 +\r
 +bool\r
 +Directory::mkdir_p ( const char* path )\r
 +{\r
 +      DIR *directory;\r
 +      directory = opendir ( path );\r
 +      if ( directory != NULL )\r
 +      {\r
 +              closedir ( directory );\r
 +              return false;\r
 +      }\r
 +\r
 +      if ( MKDIR ( path ) != 0 )\r
 +              throw AccessDeniedException ( string ( path ) );\r
 +      return true;\r
 +}\r
 +\r
 +bool\r
 +Directory::CreateDirectory ( string path )\r
 +{\r
 +      size_t index = 0;\r
 +      size_t nextIndex;\r
 +      if ( isalpha ( path[0] ) && path[1] == ':' && path[2] == CSEP )\r
 +      {\r
 +              nextIndex = path.find ( CSEP, 3);\r
 +      }\r
 +      else\r
 +              nextIndex = path.find ( CSEP );\r
 +\r
 +      bool directoryWasCreated = false;\r
 +      while ( nextIndex != string::npos )\r
 +      {\r
 +              nextIndex = path.find ( CSEP, index + 1 );\r
 +              directoryWasCreated = mkdir_p ( path.substr ( 0, nextIndex ).c_str () );\r
 +              index = nextIndex;\r
 +      }\r
 +      return directoryWasCreated;\r
 +}\r
 +\r
 +string\r
 +Directory::ReplaceVariable ( string name,\r
 +                               string value,\r
 +                               string path )\r
 +{\r
 +      size_t i = path.find ( name );\r
 +      if ( i != string::npos )\r
 +              return path.replace ( i, name.length (), value );\r
 +      else\r
 +              return path;\r
 +}\r
 +\r
 +string\r
 +Directory::GetEnvironmentVariable ( const string& name )\r
 +{\r
 +      char* value = getenv ( name.c_str () );\r
 +      if ( value != NULL && strlen ( value ) > 0 )\r
 +              return ssprintf ( "%s",\r
 +                                value );\r
 +      else\r
 +              return "";\r
 +}\r
 +\r
 +string\r
 +Directory::GetEnvironmentVariablePathOrDefault ( const string& name,\r
 +                                                   const string& defaultValue )\r
 +{\r
 +      const string& environmentVariableValue = GetEnvironmentVariable ( name );\r
 +      if ( environmentVariableValue.length () > 0 )\r
 +              return NormalizeFilename ( environmentVariableValue );\r
 +      else\r
 +              return defaultValue;\r
 +}\r
 +\r
 +string\r
 +Directory::GetIntermediatePath ()\r
 +{\r
 +      return "obj-i386";\r
 +}\r
 +\r
 +string\r
 +Directory::GetOutputPath ()\r
 +{\r
 +      return "output-i386";\r
 +}\r
 +\r
 +string\r
 +Directory::GetInstallPath ()\r
 +{\r
 +      return GetEnvironmentVariablePathOrDefault ( "ROS_INSTALL",\r
 +                                                   "reactos" );\r
 +}\r
 +\r
 +void\r
 +Directory::ResolveVariablesInPath ( char* buf,\r
 +                                      string path )\r
 +{\r
 +      string s = ReplaceVariable ( "$(INTERMEDIATE)", GetIntermediatePath (), path );\r
 +      s = ReplaceVariable ( "$(OUTPUT)", GetOutputPath (), s );\r
 +      s = ReplaceVariable ( "$(INSTALL)", GetInstallPath (), s );\r
 +      strcpy ( buf, s.c_str () );\r
 +}\r
 +\r
 +void\r
 +Directory::GenerateTree ( const string& parent,\r
 +                            bool verbose )\r
 +{\r
 +      string path;\r
 +\r
 +      if ( parent.size() )\r
 +      {\r
 +              char buf[256];\r
 +              \r
 +              path = parent + SSEP + name;\r
 +              ResolveVariablesInPath ( buf, path );\r
 +              if ( CreateDirectory ( buf ) && verbose )\r
 +                      printf ( "Created %s\n", buf );\r
 +      }\r
 +      else\r
 +              path = name;\r
 +\r
 +      for ( directory_map::iterator i = subdirs.begin();\r
 +              i != subdirs.end();\r
 +              ++i )\r
 +      {\r
 +              i->second->GenerateTree ( path, verbose );\r
 +      }\r
 +}\r
 +\r
 +\r
 +static class MingwFactory : public Backend::Factory\r
 +{\r
 +public:\r
 +      MingwFactory() : Factory ( "mingw" ) {}\r
 +      Backend* operator() ( Project& project, bool verbose )\r
 +      {\r
 +              return new MingwBackend ( project, verbose );\r
 +      }\r
 +} factory;\r
 +\r
 +\r
 +MingwBackend::MingwBackend ( Project& project, bool verbose )\r
 +      : Backend ( project, verbose ),\r
 +        intermediateDirectory ( new Directory ("$(INTERMEDIATE)" ) ),\r
 +        outputDirectory ( new Directory ( "$(OUTPUT)" ) ),\r
 +        installDirectory ( new Directory ( "$(INSTALL)" ) )\r
 +{\r
 +}\r
 +\r
 +MingwBackend::~MingwBackend()\r
 +{\r
 +      delete intermediateDirectory;\r
 +      delete outputDirectory;\r
 +      delete installDirectory;\r
 +}\r
 +\r
 +string\r
 +MingwBackend::AddDirectoryTarget ( const string& directory,\r
 +                                     Directory* directoryTree )\r
 +{\r
 +      directoryTree->Add ( directory.c_str() );\r
 +      return directoryTree->name;\r
 +}\r
 +\r
 +void\r
 +MingwBackend::ProcessModules ()\r
 +{\r
 +      printf ( "Processing modules..." );\r
 +\r
 +      vector<MingwModuleHandler*> v;\r
 +      size_t i;\r
 +      for ( i = 0; i < ProjectNode.modules.size (); i++ )\r
 +      {\r
 +              Module& module = *ProjectNode.modules[i];\r
 +              MingwModuleHandler* h = MingwModuleHandler::InstanciateHandler (\r
 +                      module,\r
 +                      this );\r
 +              if ( module.host == HostDefault )\r
 +              {\r
 +                      module.host = h->DefaultHost();\r
 +                      assert ( module.host != HostDefault );\r
 +              }\r
 +              v.push_back ( h );\r
 +      }\r
 +\r
 +      size_t iend = v.size ();\r
 +\r
 +      for ( i = 0; i < iend; i++ )\r
 +              v[i]->GenerateObjectMacro();\r
 +      fprintf ( fMakefile, "\n" );\r
 +      for ( i = 0; i < iend; i++ )\r
 +              v[i]->GenerateTargetMacro();\r
 +      fprintf ( fMakefile, "\n" );\r
 +\r
 +      GenerateAllTarget ( v );\r
 +      GenerateInitTarget ();\r
 +\r
 +      for ( i = 0; i < iend; i++ )\r
 +              v[i]->GenerateOtherMacros();\r
 +\r
 +      for ( i = 0; i < iend; i++ )\r
 +      {\r
 +              MingwModuleHandler& h = *v[i];\r
 +              h.GeneratePreconditionDependencies ();\r
 +              h.Process ();\r
 +              h.GenerateInvocations ();\r
 +              h.GenerateCleanTarget ();\r
 +              delete v[i];\r
 +      }\r
 +\r
 +      printf ( "done\n" );\r
 +}\r
 +      \r
 +void\r
 +MingwBackend::Process ()\r
 +{\r
 +      DetectPipeSupport ();\r
 +      DetectPCHSupport ();\r
 +      CreateMakefile ();\r
 +      GenerateHeader ();\r
 +      GenerateGlobalVariables ();\r
 +      GenerateXmlBuildFilesMacro ();\r
 +      ProcessModules ();\r
 +      GenerateInstallTarget ();\r
 +      GenerateDirectories ();\r
 +      CheckAutomaticDependencies ();\r
 +      CloseMakefile ();\r
 +}\r
 +\r
 +void\r
 +MingwBackend::CreateMakefile ()\r
 +{\r
 +      fMakefile = fopen ( ProjectNode.makefile.c_str (), "w" );\r
 +      if ( !fMakefile )\r
 +              throw AccessDeniedException ( ProjectNode.makefile );\r
 +      MingwModuleHandler::SetBackend ( this );\r
 +      MingwModuleHandler::SetMakefile ( fMakefile );\r
 +      MingwModuleHandler::SetUsePch ( use_pch );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::CloseMakefile () const\r
 +{\r
 +      if (fMakefile)\r
 +              fclose ( fMakefile );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateHeader () const\r
 +{\r
 +      fprintf ( fMakefile, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT 'ReactOS.xml' INSTEAD\n\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateProjectCFlagsMacro ( const char* assignmentOperation,\r
 +                                           IfableData& data ) const\r
 +{\r
 +      size_t i;\r
 +\r
 +      fprintf (\r
 +              fMakefile,\r
 +              "PROJECT_CFLAGS %s",\r
 +              assignmentOperation );\r
 +      for ( i = 0; i < data.includes.size(); i++ )\r
 +      {\r
 +              fprintf (\r
 +                      fMakefile,\r
 +                      " -I%s",\r
 +                      data.includes[i]->directory.c_str() );\r
 +      }\r
 +\r
 +      for ( i = 0; i < data.defines.size(); i++ )\r
 +      {\r
 +              Define& d = *data.defines[i];\r
 +              fprintf (\r
 +                      fMakefile,\r
 +                      " -D%s",\r
 +                      d.name.c_str() );\r
 +              if ( d.value.size() )\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "=%s",\r
 +                              d.value.c_str() );\r
 +      }\r
 +      fprintf ( fMakefile, "\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateGlobalCFlagsAndProperties (\r
 +      const char* assignmentOperation,\r
 +      IfableData& data ) const\r
 +{\r
 +      size_t i;\r
 +\r
 +      for ( i = 0; i < data.properties.size(); i++ )\r
 +      {\r
 +              Property& prop = *data.properties[i];\r
 +              fprintf ( fMakefile, "%s := %s\n",\r
 +                      prop.name.c_str(),\r
 +                      prop.value.c_str() );\r
 +      }\r
 +\r
 +      if ( data.includes.size() || data.defines.size() )\r
 +      {\r
 +              GenerateProjectCFlagsMacro ( assignmentOperation,\r
 +                                           data );\r
 +      }\r
 +\r
 +      for ( i = 0; i < data.ifs.size(); i++ )\r
 +      {\r
 +              If& rIf = *data.ifs[i];\r
 +              if ( rIf.data.defines.size()\r
 +                      || rIf.data.includes.size()\r
 +                      || rIf.data.ifs.size() )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "ifeq (\"$(%s)\",\"%s\")\n",\r
 +                              rIf.property.c_str(),\r
 +                              rIf.value.c_str() );\r
 +                      GenerateGlobalCFlagsAndProperties (\r
 +                              "+=",\r
 +                              rIf.data );\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "endif\n\n" );\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +string\r
 +MingwBackend::GenerateProjectLFLAGS () const\r
 +{\r
 +      string lflags;\r
 +      for ( size_t i = 0; i < ProjectNode.linkerFlags.size (); i++ )\r
 +      {\r
 +              LinkerFlag& linkerFlag = *ProjectNode.linkerFlags[i];\r
 +              if ( lflags.length () > 0 )\r
 +                      lflags += " ";\r
 +              lflags += linkerFlag.flag;\r
 +      }\r
 +      return lflags;\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateGlobalVariables () const\r
 +{\r
 +      GenerateGlobalCFlagsAndProperties (\r
 +              "=",\r
 +              ProjectNode.non_if_data );\r
 +      fprintf ( fMakefile, "PROJECT_RCFLAGS = $(PROJECT_CFLAGS)\n" );\r
++      fprintf ( fMakefile, "PROJECT_WIDLFLAGS = $(PROJECT_CFLAGS)\n" );\r
 +      fprintf ( fMakefile, "PROJECT_LFLAGS = %s\n",\r
 +                GenerateProjectLFLAGS ().c_str () );\r
 +      fprintf ( fMakefile, "\n" );\r
 +}\r
 +\r
 +bool\r
 +MingwBackend::IncludeInAllTarget ( const Module& module ) const\r
 +{\r
++      if ( MingwModuleHandler::ReferenceObjects ( module ) )\r
 +              return false;\r
 +      if ( module.type == BootSector )\r
 +              return false;\r
 +      if ( module.type == Iso )\r
 +              return false;\r
++      if ( module.type == Test )\r
++              return false;\r
 +      return true;\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateAllTarget ( const vector<MingwModuleHandler*>& handlers ) const\r
 +{\r
 +      fprintf ( fMakefile, "all:" );\r
 +      int wrap_count = 0;\r
 +      size_t iend = handlers.size ();\r
 +      for ( size_t i = 0; i < iend; i++ )\r
 +      {\r
 +              const Module& module = handlers[i]->module;\r
 +              if ( IncludeInAllTarget ( module ) )\r
 +              {\r
 +                      if ( wrap_count++ == 5 )\r
 +                              fprintf ( fMakefile, " \\\n\t\t" ), wrap_count = 0;\r
 +                      fprintf ( fMakefile,\r
 +                                " %s",\r
 +                                GetTargetMacro(module).c_str () );\r
 +              }\r
 +      }\r
 +      fprintf ( fMakefile, "\n\t\n\n" );\r
 +}\r
 +\r
 +string\r
 +MingwBackend::GetBuildToolDependencies () const\r
 +{\r
 +      string dependencies;\r
 +      for ( size_t i = 0; i < ProjectNode.modules.size (); i++ )\r
 +      {\r
 +              Module& module = *ProjectNode.modules[i];\r
 +              if ( module.type == BuildTool )\r
 +              {\r
 +                      if ( dependencies.length () > 0 )\r
 +                              dependencies += " ";\r
 +                      dependencies += module.GetDependencyPath ();\r
 +              }\r
 +      }\r
 +      return dependencies;\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateInitTarget () const\r
 +{\r
 +      fprintf ( fMakefile,\r
 +                "INIT = %s\n",\r
 +                GetBuildToolDependencies ().c_str () );\r
 +      fprintf ( fMakefile, "\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateXmlBuildFilesMacro() const\r
 +{\r
 +      fprintf ( fMakefile,\r
 +                "XMLBUILDFILES = %s \\\n",\r
 +                ProjectNode.GetProjectFilename ().c_str () );\r
 +      string xmlbuildFilenames;\r
 +      int numberOfExistingFiles = 0;\r
 +      for ( size_t i = 0; i < ProjectNode.xmlbuildfiles.size (); i++ )\r
 +      {\r
 +              XMLInclude& xmlbuildfile = *ProjectNode.xmlbuildfiles[i];\r
 +              if ( !xmlbuildfile.fileExists )\r
 +                      continue;\r
 +              numberOfExistingFiles++;\r
 +              if ( xmlbuildFilenames.length () > 0 )\r
 +                      xmlbuildFilenames += " ";\r
 +              xmlbuildFilenames += NormalizeFilename ( xmlbuildfile.topIncludeFilename );\r
 +              if ( numberOfExistingFiles % 5 == 4 || i == ProjectNode.xmlbuildfiles.size () - 1 )\r
 +              {\r
 +                      fprintf ( fMakefile,\r
 +                                "\t%s",\r
 +                                xmlbuildFilenames.c_str ());\r
 +                      if ( i == ProjectNode.xmlbuildfiles.size () - 1 )\r
 +                      {\r
 +                              fprintf ( fMakefile, "\n" );\r
 +                      }\r
 +                      else\r
 +                      {\r
 +                              fprintf ( fMakefile,\r
 +                                        " \\\n",\r
 +                                        xmlbuildFilenames.c_str () );\r
 +                      }\r
 +                      xmlbuildFilenames.resize ( 0 );\r
 +              }\r
 +              numberOfExistingFiles++;\r
 +      }\r
 +      fprintf ( fMakefile, "\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::CheckAutomaticDependencies ()\r
 +{\r
 +      printf ( "Checking automatic dependencies..." );\r
 +      AutomaticDependency automaticDependency ( ProjectNode );\r
 +      automaticDependency.Process ();\r
 +      automaticDependency.CheckAutomaticDependencies ( verbose );\r
 +      printf ( "done\n" );\r
 +}\r
 +\r
 +bool\r
 +MingwBackend::IncludeDirectoryTarget ( const string& directory ) const\r
 +{\r
 +      if ( directory == "$(INTERMEDIATE)" SSEP "tools")\r
 +              return false;\r
 +      else\r
 +              return true;\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateDirectories ()\r
 +{\r
 +      printf ( "Creating directories..." );\r
 +      intermediateDirectory->GenerateTree ( "", verbose );\r
 +      outputDirectory->GenerateTree ( "", verbose );\r
 +      installDirectory->GenerateTree ( "", verbose );\r
 +      printf ( "done\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::DetectPipeSupport ()\r
 +{\r
 +      printf ( "Detecting compiler -pipe support..." );\r
 +\r
 +      string pipe_detection = "tools" SSEP "rbuild" SSEP "backend" SSEP "mingw" SSEP "pipe_detection.c";\r
 +      string pipe_detectionObjectFilename = ReplaceExtension ( pipe_detection,\r
 +                                                               ".o" );\r
 +      string command = ssprintf (\r
 +              "gcc -pipe -c %s -o %s 2>%s",\r
 +              pipe_detection.c_str (),\r
 +              pipe_detectionObjectFilename.c_str (),\r
 +              NUL );\r
 +      int exitcode = system ( command.c_str () );\r
 +      FILE* f = fopen ( pipe_detectionObjectFilename.c_str (), "rb" );\r
 +      if ( f )\r
 +      {\r
 +              usePipe = (exitcode == 0);\r
 +              fclose ( f );\r
 +              unlink ( pipe_detectionObjectFilename.c_str () );\r
 +      }\r
 +      else\r
 +              usePipe = false;\r
 +\r
 +      if ( usePipe )\r
 +              printf ( "detected\n" );\r
 +      else\r
 +              printf ( "not detected\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::DetectPCHSupport ()\r
 +{\r
 +      printf ( "Detecting compiler pre-compiled header support..." );\r
 +\r
 +      string path = "tools" SSEP "rbuild" SSEP "backend" SSEP "mingw" SSEP "pch_detection.h";\r
 +      string cmd = ssprintf (\r
 +              "gcc -c %s 2>%s",\r
 +              path.c_str (),\r
 +              NUL );\r
 +      system ( cmd.c_str () );\r
 +      path += ".gch";\r
 +\r
 +      FILE* f = fopen ( path.c_str (), "rb" );\r
 +      if ( f )\r
 +      {\r
 +              use_pch = true;\r
 +              fclose ( f );\r
 +              unlink ( path.c_str () );\r
 +      }\r
 +      else\r
 +              use_pch = false;\r
 +\r
 +      if ( use_pch )\r
 +              printf ( "detected\n" );\r
 +      else\r
 +              printf ( "not detected\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GetNonModuleInstallTargetFiles (\r
 +      vector<string>& out ) const\r
 +{\r
 +      for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ )\r
 +      {\r
 +              const InstallFile& installfile = *ProjectNode.installfiles[i];\r
 +              string targetFilenameNoFixup = installfile.base + SSEP + installfile.newname;\r
 +              string targetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
 +                      NormalizeFilename ( targetFilenameNoFixup ),\r
 +                      installDirectory );\r
 +              out.push_back ( targetFilename );\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GetModuleInstallTargetFiles (\r
 +      vector<string>& out ) const\r
 +{\r
 +      for ( size_t i = 0; i < ProjectNode.modules.size (); i++ )\r
 +      {\r
 +              const Module& module = *ProjectNode.modules[i];\r
 +              if ( module.installName.length () > 0 )\r
 +              {\r
 +                      string targetFilenameNoFixup = module.installBase + SSEP + module.installName;\r
 +                      string targetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
 +                              NormalizeFilename ( targetFilenameNoFixup ),\r
 +                              installDirectory );\r
 +                      out.push_back ( targetFilename );\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GetInstallTargetFiles (\r
 +      vector<string>& out ) const\r
 +{\r
 +      GetNonModuleInstallTargetFiles ( out );\r
 +      GetModuleInstallTargetFiles ( out );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::OutputInstallTarget ( const string& sourceFilename,\r
 +                                      const string& targetFilename,\r
 +                                      const string& targetDirectory )\r
 +{\r
 +      string normalizedTargetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
 +              NormalizeFilename ( targetDirectory + SSEP + targetFilename ),\r
 +              installDirectory );\r
 +      string normalizedTargetDirectory = MingwModuleHandler::PassThruCacheDirectory (\r
 +              NormalizeFilename ( targetDirectory ),\r
 +              installDirectory );\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s %s\n",\r
 +                normalizedTargetFilename.c_str (),\r
 +                sourceFilename.c_str (),\r
 +                normalizedTargetDirectory.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(ECHO_CP)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t${cp} %s %s 1>$(NUL)\n",\r
 +                sourceFilename.c_str (),\r
 +                normalizedTargetFilename.c_str () );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::OutputNonModuleInstallTargets ()\r
 +{\r
 +      for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ )\r
 +      {\r
 +              const InstallFile& installfile = *ProjectNode.installfiles[i];\r
 +              OutputInstallTarget ( installfile.GetPath (),\r
 +                                installfile.newname,\r
 +                                installfile.base );\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwBackend::OutputModuleInstallTargets ()\r
 +{\r
 +      for ( size_t i = 0; i < ProjectNode.modules.size (); i++ )\r
 +      {\r
 +              const Module& module = *ProjectNode.modules[i];\r
 +              if ( module.installName.length () > 0 )\r
 +              {\r
 +                      string sourceFilename = MingwModuleHandler::PassThruCacheDirectory (\r
 +                              NormalizeFilename ( module.GetPath () ),\r
 +                              outputDirectory );\r
 +                      OutputInstallTarget ( sourceFilename,\r
 +                                        module.installName,\r
 +                                        module.installBase );\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +string\r
 +MingwBackend::GetRegistrySourceFiles ()\r
 +{\r
 +      return "bootdata" SSEP "hivecls.inf "\r
 +              "bootdata" SSEP "hivedef.inf "\r
 +              "bootdata" SSEP "hiveinst.inf "\r
 +              "bootdata" SSEP "hivesft.inf "\r
 +              "bootdata" SSEP "hivesys.inf";\r
 +}\r
 +\r
 +string\r
 +MingwBackend::GetRegistryTargetFiles ()\r
 +{\r
 +      string system32ConfigDirectory = NormalizeFilename (\r
 +              MingwModuleHandler::PassThruCacheDirectory (\r
 +              "system32" SSEP "config" SSEP,\r
 +              installDirectory ) );\r
 +      return system32ConfigDirectory + SSEP "default " +\r
 +              system32ConfigDirectory + SSEP "sam " +\r
 +              system32ConfigDirectory + SSEP "security " +\r
 +              system32ConfigDirectory + SSEP "software " +\r
 +              system32ConfigDirectory + SSEP "system";\r
 +}\r
 +\r
 +void\r
 +MingwBackend::OutputRegistryInstallTarget ()\r
 +{\r
 +      string system32ConfigDirectory = NormalizeFilename (\r
 +              MingwModuleHandler::PassThruCacheDirectory (\r
 +              "system32" SSEP "config" SSEP,\r
 +              installDirectory ) );\r
 +\r
 +      string registrySourceFiles = GetRegistrySourceFiles ();\r
 +      string registryTargetFiles = GetRegistryTargetFiles ();\r
 +      fprintf ( fMakefile,\r
 +                "install_registry: %s\n",\r
 +                registryTargetFiles.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s %s $(MKHIVE_TARGET)\n",\r
 +                registryTargetFiles.c_str (),\r
 +                registrySourceFiles.c_str (),\r
 +                system32ConfigDirectory.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(ECHO_MKHIVE)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(MKHIVE_TARGET) bootdata %s bootdata" SSEP "hiveinst.inf\n",\r
 +                system32ConfigDirectory.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\n" );\r
 +}\r
 +\r
 +void\r
 +MingwBackend::GenerateInstallTarget ()\r
 +{\r
 +      vector<string> vInstallTargetFiles;\r
 +      GetInstallTargetFiles ( vInstallTargetFiles );\r
 +      string installTargetFiles = v2s ( vInstallTargetFiles, 5 );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "install: %s install_registry\n",\r
 +                installTargetFiles.c_str () );\r
 +      OutputNonModuleInstallTargets ();\r
 +      OutputModuleInstallTargets ();\r
 +      OutputRegistryInstallTarget ();\r
 +      fprintf ( fMakefile,\r
 +                "\n" );\r
 +}\r
index 09e71f7,0000000..03e2514
mode 100644,000000..100644
--- /dev/null
@@@ -1,2423 -1,0 +1,2646 @@@
-       if ( importedModule.type == ObjectLibrary )\r
 +#include "../../pch.h"\r
 +#include <assert.h>\r
 +\r
 +#include "../../rbuild.h"\r
 +#include "mingw.h"\r
 +#include "modulehandler.h"\r
 +\r
 +using std::string;\r
 +using std::vector;\r
 +\r
 +#define CLEAN_FILE(f) clean_files.push_back ( f ); /*if ( module.name == "crt" ) printf ( "%s(%i): clean: %s\n", __FILE__, __LINE__, f.c_str() )*/\r
 +\r
 +static string ros_temp = "$(TEMPORARY)";\r
 +MingwBackend*\r
 +MingwModuleHandler::backend = NULL;\r
 +FILE*\r
 +MingwModuleHandler::fMakefile = NULL;\r
 +bool\r
 +MingwModuleHandler::use_pch = false;\r
 +\r
 +string\r
 +PrefixFilename (\r
 +      const string& filename,\r
 +      const string& prefix )\r
 +{\r
 +      if ( !prefix.length() )\r
 +              return filename;\r
 +      string out;\r
 +      const char* pfilename = filename.c_str();\r
 +      const char* p1 = strrchr ( pfilename, '/' );\r
 +      const char* p2 = strrchr ( pfilename, '\\' );\r
 +      if ( p1 || p2 )\r
 +      {\r
 +              if ( p2 > p1 )\r
 +                      p1 = p2;\r
 +              out += string(pfilename,p1-pfilename) + CSEP;\r
 +              pfilename = p1 + 1;\r
 +      }\r
 +      out += prefix + pfilename;\r
 +      return out;\r
 +}\r
 +\r
 +string\r
 +GetTargetMacro ( const Module& module, bool with_dollar )\r
 +{\r
 +      string s ( module.name );\r
 +      strupr ( &s[0] );\r
 +      s += "_TARGET";\r
 +      if ( with_dollar )\r
 +              return ssprintf ( "$(%s)", s.c_str() );\r
 +      return s;\r
 +}\r
 +\r
 +MingwModuleHandler::MingwModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : module(module_)\r
 +{\r
 +}\r
 +\r
 +MingwModuleHandler::~MingwModuleHandler()\r
 +{\r
 +}\r
 +\r
 +/*static*/ void\r
 +MingwModuleHandler::SetBackend ( MingwBackend* backend_ )\r
 +{\r
 +      backend = backend_;\r
 +}\r
 +\r
 +/*static*/ void\r
 +MingwModuleHandler::SetMakefile ( FILE* f )\r
 +{\r
 +      fMakefile = f;\r
 +}\r
 +\r
 +/*static*/ void\r
 +MingwModuleHandler::SetUsePch ( bool b )\r
 +{\r
 +      use_pch = b;\r
 +}\r
 +\r
 +/* static*/ string\r
 +MingwModuleHandler::RemoveVariables ( string path)\r
 +{\r
 +      size_t i = path.find ( '$' );\r
 +      if ( i != string::npos )\r
 +      {\r
 +              size_t j = path.find ( ')', i );\r
 +              if ( j != string::npos )\r
 +              {\r
 +                      if ( j + 2 < path.length () && path[j + 1] == CSEP )\r
 +                              return path.substr ( j + 2);\r
 +                      else\r
 +                              return path.substr ( j + 1);\r
 +              }\r
 +      }\r
 +      return path;\r
 +}\r
 +\r
 +/*static*/ string\r
 +MingwModuleHandler::PassThruCacheDirectory (\r
 +      const string &file,\r
 +      Directory* directoryTree )\r
 +{\r
 +      string directory ( GetDirectory ( RemoveVariables ( file ) ) );\r
 +      string generatedFilesDirectory = backend->AddDirectoryTarget ( directory,\r
 +                                                                     directoryTree );\r
 +      if ( directory.find ( generatedFilesDirectory ) != string::npos )\r
 +              /* This path already includes the generated files directory variable */\r
 +              return file;\r
 +      else\r
 +              return generatedFilesDirectory + SSEP + file;\r
 +}\r
 +\r
 +/*static*/ string\r
 +MingwModuleHandler::GetTargetFilename (\r
 +      const Module& module,\r
 +      string_list* pclean_files )\r
 +{\r
 +      string target = PassThruCacheDirectory (\r
 +              NormalizeFilename ( module.GetPath () ),\r
 +              backend->outputDirectory );\r
 +      if ( pclean_files )\r
 +      {\r
 +              string_list& clean_files = *pclean_files;\r
 +              CLEAN_FILE ( target );\r
 +      }\r
 +      return target;\r
 +}\r
 +\r
 +/*static*/ string\r
 +MingwModuleHandler::GetImportLibraryFilename (\r
 +      const Module& module,\r
 +      string_list* pclean_files )\r
 +{\r
 +      string target = PassThruCacheDirectory (\r
 +              NormalizeFilename ( module.GetDependencyPath () ),\r
 +              backend->outputDirectory );\r
 +      if ( pclean_files )\r
 +      {\r
 +              string_list& clean_files = *pclean_files;\r
 +              CLEAN_FILE ( target );\r
 +      }\r
 +      return target;\r
 +}\r
 +\r
 +/*static*/ MingwModuleHandler*\r
 +MingwModuleHandler::InstanciateHandler (\r
 +      const Module& module,\r
 +      MingwBackend* backend )\r
 +{\r
 +      MingwModuleHandler* handler;\r
 +      switch ( module.type )\r
 +      {\r
 +              case BuildTool:\r
 +                      handler = new MingwBuildToolModuleHandler ( module );\r
 +                      break;\r
 +              case StaticLibrary:\r
 +                      handler = new MingwStaticLibraryModuleHandler ( module );\r
 +                      break;\r
 +              case ObjectLibrary:\r
 +                      handler = new MingwObjectLibraryModuleHandler ( module );\r
 +                      break;\r
 +              case Kernel:\r
 +                      handler = new MingwKernelModuleHandler ( module );\r
 +                      break;\r
 +              case NativeCUI:\r
 +                      handler = new MingwNativeCUIModuleHandler ( module );\r
 +                      break;\r
 +              case Win32CUI:\r
 +                      handler = new MingwWin32CUIModuleHandler ( module );\r
 +                      break;\r
 +              case Win32GUI:\r
 +                      handler = new MingwWin32GUIModuleHandler ( module );\r
 +                      break;\r
 +              case KernelModeDLL:\r
 +                      handler = new MingwKernelModeDLLModuleHandler ( module );\r
 +                      break;\r
 +              case NativeDLL:\r
 +                      handler = new MingwNativeDLLModuleHandler ( module );\r
 +                      break;\r
 +              case Win32DLL:\r
 +                      handler = new MingwWin32DLLModuleHandler ( module );\r
 +                      break;\r
 +              case KernelModeDriver:\r
 +                      handler = new MingwKernelModeDriverModuleHandler ( module );\r
 +                      break;\r
 +              case BootLoader:\r
 +                      handler = new MingwBootLoaderModuleHandler ( module );\r
 +                      break;\r
 +              case BootSector:\r
 +                      handler = new MingwBootSectorModuleHandler ( module );\r
 +                      break;\r
 +              case Iso:\r
 +                      handler = new MingwIsoModuleHandler ( module );\r
 +                      break;\r
 +              case Test:\r
 +                      handler = new MingwTestModuleHandler ( module );\r
 +                      break;\r
++              case RpcServer:\r
++                      handler = new MingwRpcServerModuleHandler ( module );\r
++                      break;\r
++              case RpcClient:\r
++                      handler = new MingwRpcClientModuleHandler ( module );\r
++                      break;\r
 +              default:\r
 +                      throw UnknownModuleTypeException (\r
 +                              module.node.location,\r
 +                              module.type );\r
 +                      break;\r
 +      }\r
 +      return handler;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetWorkingDirectory () const\r
 +{\r
 +      return ".";\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetBasename ( const string& filename ) const\r
 +{\r
 +      size_t index = filename.find_last_of ( '.' );\r
 +      if ( index != string::npos )\r
 +              return filename.substr ( 0, index );\r
 +      return "";\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetActualSourceFilename (\r
 +      const string& filename ) const\r
 +{\r
 +      string extension = GetExtension ( filename );\r
 +      if ( extension == ".spec" || extension == ".SPEC" )\r
 +      {\r
 +              string basename = GetBasename ( filename );\r
 +              return PassThruCacheDirectory ( NormalizeFilename ( basename + ".stubs.c" ),\r
 +                                              backend->intermediateDirectory );\r
 +      }\r
++      else if ( extension == ".idl" || extension == ".IDL" )\r
++      {\r
++              string basename = GetBasename ( filename );\r
++              string newname;\r
++              if ( module.type == RpcServer )\r
++                      newname = basename + "_s.c";\r
++              else\r
++                      newname = basename + "_c.c";\r
++              return PassThruCacheDirectory ( NormalizeFilename ( newname ),\r
++                                              backend->intermediateDirectory );\r
++      }\r
 +      else\r
 +              return filename;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetModuleArchiveFilename () const\r
 +{\r
 +      if ( module.type == StaticLibrary )\r
 +              return GetTargetFilename ( module, NULL );\r
 +      return PassThruCacheDirectory ( ReplaceExtension (\r
 +              NormalizeFilename ( module.GetPath () ),\r
 +              ".temp.a" ),\r
 +              backend->intermediateDirectory );\r
 +}\r
 +\r
 +bool\r
 +MingwModuleHandler::IsGeneratedFile ( const File& file ) const\r
 +{\r
 +      string extension = GetExtension ( file.name );\r
 +      return ( extension == ".spec" || extension == ".SPEC" );\r
 +}\r
 +\r
++/*static*/ bool\r
++MingwModuleHandler::ReferenceObjects (\r
++      const Module& module )\r
++{\r
++      if ( module.type == ObjectLibrary )\r
++              return true;\r
++      if ( module.type == RpcServer )\r
++              return true;\r
++      if ( module.type == RpcClient )\r
++              return true;\r
++      return false;\r
++}\r
++\r
 +string\r
 +MingwModuleHandler::GetImportLibraryDependency (\r
 +      const Module& importedModule )\r
 +{\r
 +      string dep;\r
-       // TODO FIXME - do we *really* not want to call\r
-       // GetDefinitionDependencies() if dependencies.size() == 0 ???\r
++      if ( ReferenceObjects ( importedModule ) )\r
 +              dep = GetTargetMacro ( importedModule );\r
 +      else\r
 +              dep = GetImportLibraryFilename ( importedModule, NULL );\r
 +      return dep;\r
 +}\r
 +\r
++void\r
++MingwModuleHandler::GetTargets ( const Module& dependencyModule,\r
++                                   string_list& targets )\r
++{\r
++      if ( dependencyModule.invocations.size () > 0 )\r
++      {\r
++              for ( size_t i = 0; i < dependencyModule.invocations.size (); i++ )\r
++              {\r
++                      Invoke& invoke = *dependencyModule.invocations[i];\r
++                      invoke.GetTargets ( targets );\r
++              }\r
++      }\r
++      else\r
++              targets.push_back ( GetImportLibraryDependency ( dependencyModule ) );\r
++}\r
++\r
 +void\r
 +MingwModuleHandler::GetModuleDependencies (\r
 +      string_list& dependencies )\r
 +{\r
 +      size_t iend = module.dependencies.size ();\r
 +\r
-               dependencyModule.GetTargets ( dependencies );\r
 +      if ( iend == 0 )\r
 +              return;\r
 +      \r
 +      for ( size_t i = 0; i < iend; i++ )\r
 +      {\r
 +              const Dependency& dependency = *module.dependencies[i];\r
 +              const Module& dependencyModule = *dependency.dependencyModule;\r
-       fprintf ( fMakefile,\r
-                 "%s: %s $(WRC_TARGET) | %s\n",\r
-                 objectFilename.c_str (),\r
-                 sourceFilename.c_str (),\r
-                 GetDirectory ( objectFilename ).c_str () );\r
-       fprintf ( fMakefile, "\t$(ECHO_WRC)\n" );\r
-       fprintf ( fMakefile,\r
-                "\t${gcc} -xc -E -DRC_INVOKED ${%s} %s > %s\n",\r
-                windresflagsMacro.c_str (),\r
-                sourceFilename.c_str (),\r
-                rciFilename.c_str () );\r
-       fprintf ( fMakefile,\r
-                "\t$(Q)$(WRC_TARGET) ${%s} %s %s\n",\r
-                windresflagsMacro.c_str (),\r
-                rciFilename.c_str (),\r
-                resFilename.c_str () );\r
-       fprintf ( fMakefile,\r
-                "\t-@${rm} %s 2>$(NUL)\n",\r
-                rciFilename.c_str () );\r
-       fprintf ( fMakefile,\r
-                "\t${windres} %s -o $@\n",\r
-                resFilename.c_str () );\r
-       fprintf ( fMakefile,\r
-                "\t-@${rm} %s 2>$(NUL)\n",\r
-                resFilename.c_str () );\r
++              GetTargets ( dependencyModule,\r
++                           dependencies );\r
 +      }\r
 +      GetDefinitionDependencies ( dependencies );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GetSourceFilenames (\r
 +      string_list& list,\r
 +      bool includeGeneratedFiles ) const\r
 +{\r
 +      size_t i;\r
 +\r
 +      const vector<File*>& files = module.non_if_data.files;\r
 +      for ( i = 0; i < files.size (); i++ )\r
 +      {\r
 +              if ( includeGeneratedFiles || !IsGeneratedFile ( *files[i] ) )\r
 +              {\r
 +                      list.push_back (\r
 +                              GetActualSourceFilename ( files[i]->name ) );\r
 +              }\r
 +      }\r
 +      // intentionally make a copy so that we can append more work in\r
 +      // the middle of processing without having to go recursive\r
 +      vector<If*> v = module.non_if_data.ifs;\r
 +      for ( i = 0; i < v.size (); i++ )\r
 +      {\r
 +              size_t j;\r
 +              If& rIf = *v[i];\r
 +              // check for sub-ifs to add to list\r
 +              const vector<If*>& ifs = rIf.data.ifs;\r
 +              for ( j = 0; j < ifs.size (); j++ )\r
 +                      v.push_back ( ifs[j] );\r
 +              const vector<File*>& files = rIf.data.files;\r
 +              for ( j = 0; j < files.size (); j++ )\r
 +              {\r
 +                      File& file = *files[j];\r
 +                      if ( includeGeneratedFiles || !IsGeneratedFile ( file ) )\r
 +                      {\r
 +                              list.push_back (\r
 +                                      GetActualSourceFilename ( file.name ) );\r
 +                      }\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GetSourceFilenamesWithoutGeneratedFiles (\r
 +      string_list& list ) const\r
 +{\r
 +      GetSourceFilenames ( list, false );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetObjectFilename (\r
 +      const string& sourceFilename,\r
 +      string_list* pclean_files ) const\r
 +{\r
 +      Directory* directoryTree;\r
 +\r
 +      string newExtension;\r
 +      string extension = GetExtension ( sourceFilename );\r
 +      if ( extension == ".rc" || extension == ".RC" )\r
 +              newExtension = ".coff";\r
 +      else if ( extension == ".spec" || extension == ".SPEC" )\r
 +              newExtension = ".stubs.o";\r
++      else if ( extension == ".idl" || extension == ".IDL" )\r
++      {\r
++              if ( module.type == RpcServer )\r
++                      newExtension = "_s.o";\r
++              else\r
++                      newExtension = "_c.o";\r
++      }\r
 +      else\r
 +              newExtension = ".o";\r
 +      \r
 +      if ( module.type == BootSector )\r
 +              directoryTree = backend->outputDirectory;\r
 +      else\r
 +              directoryTree = backend->intermediateDirectory;\r
 +\r
 +      string obj_file = PassThruCacheDirectory (\r
 +              NormalizeFilename ( ReplaceExtension (\r
 +                      RemoveVariables ( sourceFilename ),\r
 +                                        newExtension ) ),\r
 +                      directoryTree );\r
 +      if ( pclean_files )\r
 +      {\r
 +              string_list& clean_files = *pclean_files;\r
 +              CLEAN_FILE ( obj_file );\r
 +      }\r
 +      return obj_file;\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateCleanTarget () const\r
 +{\r
 +      if ( 0 == clean_files.size() )\r
 +              return;\r
 +      fprintf ( fMakefile, ".PHONY: %s_clean\n", module.name.c_str() );\r
 +      fprintf ( fMakefile, "%s_clean:\n\t-@$(rm)", module.name.c_str() );\r
 +      for ( size_t i = 0; i < clean_files.size(); i++ )\r
 +      {\r
 +              if ( 9==((i+1)%10) )\r
 +                      fprintf ( fMakefile, " 2>$(NUL)\n\t-@$(rm)" );\r
 +              fprintf ( fMakefile, " %s", clean_files[i].c_str() );\r
 +      }\r
 +      fprintf ( fMakefile, " 2>$(NUL)\n" );\r
 +      fprintf ( fMakefile, "clean: %s_clean\n\n", module.name.c_str() );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetObjectFilenames ()\r
 +{\r
 +      const vector<File*>& files = module.non_if_data.files;\r
 +      if ( files.size () == 0 )\r
 +              return "";\r
 +      \r
 +      string objectFilenames ( "" );\r
 +      for ( size_t i = 0; i < files.size (); i++ )\r
 +      {\r
 +              if ( objectFilenames.size () > 0 )\r
 +                      objectFilenames += " ";\r
 +              objectFilenames +=\r
 +                      GetObjectFilename ( files[i]->name, NULL );\r
 +      }\r
 +      return objectFilenames;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateGccDefineParametersFromVector (\r
 +      const vector<Define*>& defines ) const\r
 +{\r
 +      string parameters;\r
 +      for ( size_t i = 0; i < defines.size (); i++ )\r
 +      {\r
 +              Define& define = *defines[i];\r
 +              if (parameters.length () > 0)\r
 +                      parameters += " ";\r
 +              parameters += "-D";\r
 +              parameters += define.name;\r
 +              if (define.value.length () > 0)\r
 +              {\r
 +                      parameters += "=";\r
 +                      parameters += define.value;\r
 +              }\r
 +      }\r
 +      return parameters;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateGccDefineParameters () const\r
 +{\r
 +      string parameters = GenerateGccDefineParametersFromVector ( module.project.non_if_data.defines );\r
 +      string s = GenerateGccDefineParametersFromVector ( module.non_if_data.defines );\r
 +      if ( s.length () > 0 )\r
 +      {\r
 +              parameters += " ";\r
 +              parameters += s;\r
 +      }\r
 +      return parameters;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::ConcatenatePaths (\r
 +      const string& path1,\r
 +      const string& path2 ) const\r
 +{\r
 +      if ( ( path1.length () == 0 ) || ( path1 == "." ) || ( path1 == "./" ) )\r
 +              return path2;\r
 +      if ( path1[path1.length ()] == CSEP )\r
 +              return path1 + path2;\r
 +      else\r
 +              return path1 + CSEP + path2;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Include*>& includes ) const\r
 +{\r
 +      string parameters;\r
 +      for ( size_t i = 0; i < includes.size (); i++ )\r
 +      {\r
 +              Include& include = *includes[i];\r
 +              if ( parameters.length () > 0 )\r
 +                      parameters += " ";\r
 +              parameters += "-I" + include.directory;\r
 +      }\r
 +      return parameters;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateGccIncludeParameters () const\r
 +{\r
 +      string parameters = GenerateGccIncludeParametersFromVector ( module.non_if_data.includes );\r
 +      string s = GenerateGccIncludeParametersFromVector ( module.project.non_if_data.includes );\r
 +      if ( s.length () > 0 )\r
 +      {\r
 +              parameters += " ";\r
 +              parameters += s;\r
 +      }\r
 +      return parameters;\r
 +}\r
 +\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateCompilerParametersFromVector ( const vector<CompilerFlag*>& compilerFlags ) const\r
 +{\r
 +      string parameters;\r
 +      for ( size_t i = 0; i < compilerFlags.size (); i++ )\r
 +      {\r
 +              CompilerFlag& compilerFlag = *compilerFlags[i];\r
 +              if ( parameters.length () > 0 )\r
 +                      parameters += " ";\r
 +              parameters += compilerFlag.flag;\r
 +      }\r
 +      return parameters;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateLinkerParametersFromVector ( const vector<LinkerFlag*>& linkerFlags ) const\r
 +{\r
 +      string parameters;\r
 +      for ( size_t i = 0; i < linkerFlags.size (); i++ )\r
 +      {\r
 +              LinkerFlag& linkerFlag = *linkerFlags[i];\r
 +              if ( parameters.length () > 0 )\r
 +                      parameters += " ";\r
 +              parameters += linkerFlag.flag;\r
 +      }\r
 +      return parameters;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateImportLibraryDependenciesFromVector (\r
 +      const vector<Library*>& libraries )\r
 +{\r
 +      string dependencies ( "" );\r
 +      int wrap_count = 0;\r
 +      for ( size_t i = 0; i < libraries.size (); i++ )\r
 +      {\r
 +              if ( wrap_count++ == 5 )\r
 +                      dependencies += " \\\n\t\t", wrap_count = 0;\r
 +              else if ( dependencies.size () > 0 )\r
 +                      dependencies += " ";\r
 +              dependencies += GetImportLibraryDependency ( *libraries[i]->imported_module );\r
 +      }\r
 +      return dependencies;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateLinkerParameters () const\r
 +{\r
 +      return GenerateLinkerParametersFromVector ( module.linkerFlags );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateMacro (\r
 +      const char* assignmentOperation,\r
 +      const string& macro,\r
 +      const IfableData& data,\r
 +      const vector<CompilerFlag*>* compilerFlags )\r
 +{\r
 +      size_t i;\r
 +\r
 +      fprintf (\r
 +              fMakefile,\r
 +              "%s %s",\r
 +              macro.c_str(),\r
 +              assignmentOperation );\r
 +      \r
 +      if ( compilerFlags != NULL )\r
 +      {\r
 +              string compilerParameters = GenerateCompilerParametersFromVector ( *compilerFlags );\r
 +              if ( compilerParameters.size () > 0 )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              " %s",\r
 +                              compilerParameters.c_str () );\r
 +              }\r
 +      }\r
 +\r
 +      for ( i = 0; i < data.includes.size(); i++ )\r
 +      {\r
 +              fprintf (\r
 +                      fMakefile,\r
 +                      " -I%s",\r
 +                      data.includes[i]->directory.c_str() );\r
 +      }\r
 +      for ( i = 0; i < data.defines.size(); i++ )\r
 +      {\r
 +              Define& d = *data.defines[i];\r
 +              fprintf (\r
 +                      fMakefile,\r
 +                      " -D%s",\r
 +                      d.name.c_str() );\r
 +              if ( d.value.size() )\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "=%s",\r
 +                              d.value.c_str() );\r
 +      }\r
 +      fprintf ( fMakefile, "\n" );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateMacros (\r
 +      const char* assignmentOperation,\r
 +      const IfableData& data,\r
 +      const vector<CompilerFlag*>* compilerFlags,\r
 +      const vector<LinkerFlag*>* linkerFlags )\r
 +{\r
 +      size_t i;\r
 +\r
 +      if ( data.includes.size () > 0 || data.defines.size () > 0 )\r
 +      {\r
 +              GenerateMacro ( assignmentOperation,\r
 +                              cflagsMacro,\r
 +                              data,\r
 +                              compilerFlags );\r
 +              GenerateMacro ( assignmentOperation,\r
 +                              windresflagsMacro,\r
 +                              data,\r
 +                              compilerFlags );\r
 +      }\r
 +      \r
 +      if ( linkerFlags != NULL )\r
 +      {\r
 +              string linkerParameters = GenerateLinkerParametersFromVector ( *linkerFlags );\r
 +              if ( linkerParameters.size () > 0 )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "%s %s %s\n",\r
 +                              linkerflagsMacro.c_str (),\r
 +                              assignmentOperation,\r
 +                              linkerParameters.c_str() );\r
 +              }\r
 +      }\r
 +\r
 +      if ( data.libraries.size () > 0 )\r
 +      {\r
 +              string deps = GenerateImportLibraryDependenciesFromVector ( data.libraries );\r
 +              if ( deps.size () > 0 )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "%s %s %s\n",\r
 +                              libsMacro.c_str(),\r
 +                              assignmentOperation,\r
 +                              deps.c_str() );\r
 +              }\r
 +      }\r
 +\r
 +      const vector<If*>& ifs = data.ifs;\r
 +      for ( i = 0; i < ifs.size(); i++ )\r
 +      {\r
 +              If& rIf = *ifs[i];\r
 +              if ( rIf.data.defines.size()\r
 +                      || rIf.data.includes.size()\r
 +                      || rIf.data.libraries.size()\r
 +                      || rIf.data.files.size()\r
 +                      || rIf.data.ifs.size() )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "ifeq (\"$(%s)\",\"%s\")\n",\r
 +                              rIf.property.c_str(),\r
 +                              rIf.value.c_str() );\r
 +                      GenerateMacros (\r
 +                              "+=",\r
 +                              rIf.data,\r
 +                              NULL,\r
 +                              NULL );\r
 +                      fprintf ( \r
 +                              fMakefile,\r
 +                              "endif\n\n" );\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateObjectMacros (\r
 +      const char* assignmentOperation,\r
 +      const IfableData& data,\r
 +      const vector<CompilerFlag*>* compilerFlags,\r
 +      const vector<LinkerFlag*>* linkerFlags )\r
 +{\r
 +      size_t i;\r
 +\r
 +      const vector<File*>& files = data.files;\r
 +      if ( files.size () > 0 )\r
 +      {\r
 +              for ( i = 0; i < files.size (); i++ )\r
 +              {\r
 +                      File& file = *files[i];\r
 +                      if ( file.first )\r
 +                      {\r
 +                              fprintf ( fMakefile,\r
 +                                      "%s := %s $(%s)\n",\r
 +                                      objectsMacro.c_str(),\r
 +                                      GetObjectFilename (\r
 +                                              file.name, NULL ).c_str (),\r
 +                                      objectsMacro.c_str() );\r
 +                      }\r
 +              }\r
 +              fprintf (\r
 +                      fMakefile,\r
 +                      "%s %s",\r
 +                      objectsMacro.c_str (),\r
 +                      assignmentOperation );\r
 +              for ( i = 0; i < files.size(); i++ )\r
 +              {\r
 +                      File& file = *files[i];\r
 +                      if ( !file.first )\r
 +                      {\r
 +                              fprintf (\r
 +                                      fMakefile,\r
 +                                      "%s%s",\r
 +                                      ( i%10 == 9 ? " \\\n\t" : " " ),\r
 +                                      GetObjectFilename (\r
 +                                              file.name, NULL ).c_str () );\r
 +                      }\r
 +              }\r
 +              fprintf ( fMakefile, "\n" );\r
 +      }\r
 +\r
 +      const vector<If*>& ifs = data.ifs;\r
 +      for ( i = 0; i < ifs.size(); i++ )\r
 +      {\r
 +              If& rIf = *ifs[i];\r
 +              if ( rIf.data.defines.size()\r
 +                      || rIf.data.includes.size()\r
 +                      || rIf.data.libraries.size()\r
 +                      || rIf.data.files.size()\r
 +                      || rIf.data.ifs.size() )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "ifeq (\"$(%s)\",\"%s\")\n",\r
 +                              rIf.property.c_str(),\r
 +                              rIf.value.c_str() );\r
 +                      GenerateObjectMacros (\r
 +                              "+=",\r
 +                              rIf.data,\r
 +                              NULL,\r
 +                              NULL );\r
 +                      fprintf ( \r
 +                              fMakefile,\r
 +                              "endif\n\n" );\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateGccCommand (\r
 +      const string& sourceFilename,\r
 +      const string& cc,\r
 +      const string& cflagsMacro )\r
 +{\r
 +      string deps = sourceFilename;\r
 +      if ( module.pch && use_pch )\r
 +              deps += " " + module.pch->header + ".gch";\r
++      \r
++      /* WIDL generated headers may be used */\r
++      deps += " " + GetLinkingDependenciesMacro ();\r
++\r
 +      string objectFilename = GetObjectFilename (\r
 +              sourceFilename, &clean_files );\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s | %s\n",\r
 +                objectFilename.c_str (),\r
 +                deps.c_str (),\r
 +                GetDirectory ( objectFilename ).c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_CC)\n" );\r
 +      fprintf ( fMakefile,\r
 +               "\t%s -c $< -o $@ %s\n",\r
 +               cc.c_str (),\r
 +               cflagsMacro.c_str () );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateGccAssemblerCommand (\r
 +      const string& sourceFilename,\r
 +      const string& cc,\r
 +      const string& cflagsMacro )\r
 +{\r
 +      string objectFilename = GetObjectFilename (\r
 +              sourceFilename, &clean_files );\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s | %s\n",\r
 +                objectFilename.c_str (),\r
 +                sourceFilename.c_str (),\r
 +                GetDirectory ( objectFilename ).c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_GAS)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t%s -x assembler-with-cpp -c $< -o $@ -D__ASM__ %s\n",\r
 +                cc.c_str (),\r
 +                cflagsMacro.c_str () );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateNasmCommand (\r
 +      const string& sourceFilename,\r
 +      const string& nasmflagsMacro )\r
 +{\r
 +      string objectFilename = GetObjectFilename (\r
 +              sourceFilename, &clean_files );\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s | %s\n",\r
 +                objectFilename.c_str (),\r
 +                sourceFilename.c_str (),\r
 +                GetDirectory ( objectFilename ).c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_NASM)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t%s -f win32 $< -o $@ %s\n",\r
 +                "$(Q)nasm",\r
 +                nasmflagsMacro.c_str () );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateWindresCommand (\r
 +      const string& sourceFilename,\r
 +      const string& windresflagsMacro )\r
 +{\r
 +      string objectFilename =\r
 +              GetObjectFilename ( sourceFilename, &clean_files );\r
 +      string rciFilename = ros_temp +\r
 +              ReplaceExtension ( sourceFilename, ".rci" );\r
 +      string resFilename = ros_temp +\r
 +              ReplaceExtension ( sourceFilename, ".res" );\r
-       const string& windresflagsMacro )\r
++      if ( module.useWRC )\r
++      {\r
++              fprintf ( fMakefile,\r
++                        "%s: %s $(WRC_TARGET) | %s\n",\r
++                        objectFilename.c_str (),\r
++                        sourceFilename.c_str (),\r
++                        GetDirectory ( objectFilename ).c_str () );\r
++              fprintf ( fMakefile, "\t$(ECHO_WRC)\n" );\r
++              fprintf ( fMakefile,\r
++                       "\t${gcc} -xc -E -DRC_INVOKED ${%s} %s > %s\n",\r
++                       windresflagsMacro.c_str (),\r
++                       sourceFilename.c_str (),\r
++                       rciFilename.c_str () );\r
++              fprintf ( fMakefile,\r
++                       "\t$(Q)$(WRC_TARGET) ${%s} %s %s\n",\r
++                       windresflagsMacro.c_str (),\r
++                       rciFilename.c_str (),\r
++                       resFilename.c_str () );\r
++              fprintf ( fMakefile,\r
++                       "\t-@${rm} %s 2>$(NUL)\n",\r
++                       rciFilename.c_str () );\r
++              fprintf ( fMakefile,\r
++                       "\t${windres} %s -o $@\n",\r
++                       resFilename.c_str () );\r
++              fprintf ( fMakefile,\r
++                       "\t-@${rm} %s 2>$(NUL)\n",\r
++                       resFilename.c_str () );\r
++      }\r
++      else\r
++      {\r
++              fprintf ( fMakefile,\r
++                        "%s: %s $(WRC_TARGET) | %s\n",\r
++                        objectFilename.c_str (),\r
++                        sourceFilename.c_str (),\r
++                        GetDirectory ( objectFilename ).c_str () );\r
++              fprintf ( fMakefile, "\t$(ECHO_WRC)\n" );\r
++              fprintf ( fMakefile,\r
++                       "\t${windres} $(%s) %s -o $@\n",\r
++                       windresflagsMacro.c_str (),\r
++                       sourceFilename.c_str () );\r
++      }\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateWinebuildCommands (\r
 +      const string& sourceFilename )\r
 +{\r
 +      string basename = GetBasename ( sourceFilename );\r
 +\r
 +      string def_file = PassThruCacheDirectory (\r
 +              basename + ".spec.def",\r
 +              backend->intermediateDirectory );\r
 +      CLEAN_FILE(def_file);\r
 +\r
 +      string stub_file = PassThruCacheDirectory (\r
 +              basename + ".stubs.c",\r
 +              backend->intermediateDirectory );\r
 +      CLEAN_FILE(stub_file)\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s $(WINEBUILD_TARGET)\n",\r
 +                def_file.c_str (),\r
 +                sourceFilename.c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_WINEBLD)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t%s --def=%s -o %s\n",\r
 +                "$(Q)$(WINEBUILD_TARGET)",\r
 +                sourceFilename.c_str (),\r
 +                def_file.c_str () );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s $(WINEBUILD_TARGET)\n",\r
 +                stub_file.c_str (),\r
 +                sourceFilename.c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_WINEBLD)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t%s --pedll=%s -o %s\n",\r
 +                "$(Q)$(WINEBUILD_TARGET)",\r
 +                sourceFilename.c_str (),\r
 +                stub_file.c_str () );\r
 +}\r
 +\r
++void\r
++MingwModuleHandler::GenerateWidlCommandsServer (\r
++      const string& sourceFilename,\r
++      const string& widlflagsMacro )\r
++{\r
++      string basename = GetBasename ( sourceFilename );\r
++\r
++      /*string generatedHeaderFilename = PassThruCacheDirectory (\r
++              basename + ".h",\r
++              backend->intermediateDirectory );\r
++      CLEAN_FILE(generatedHeaderFilename);\r
++      */\r
++      string generatedHeaderFilename = basename + "_s.h";\r
++      CLEAN_FILE(generatedHeaderFilename);\r
++\r
++      string generatedServerFilename = PassThruCacheDirectory (\r
++              basename + "_s.c",\r
++              backend->intermediateDirectory );\r
++      CLEAN_FILE(generatedServerFilename);\r
++\r
++      fprintf ( fMakefile,\r
++                "%s %s: %s $(WIDL_TARGET) | %s\n",\r
++                generatedServerFilename.c_str (),\r
++                generatedHeaderFilename.c_str (),\r
++                sourceFilename.c_str (),\r
++                GetDirectory ( generatedServerFilename ).c_str () );\r
++      fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" );\r
++      fprintf ( fMakefile,\r
++                "\t%s %s -h -H %s -s -S %s %s\n",\r
++                "$(Q)$(WIDL_TARGET)",\r
++                widlflagsMacro.c_str (),\r
++                generatedHeaderFilename.c_str (),\r
++                generatedServerFilename.c_str (),\r
++                sourceFilename.c_str () );\r
++}\r
++\r
++void\r
++MingwModuleHandler::GenerateWidlCommandsClient (\r
++      const string& sourceFilename,\r
++      const string& widlflagsMacro )\r
++{\r
++      string basename = GetBasename ( sourceFilename );\r
++\r
++      /*string generatedHeaderFilename = PassThruCacheDirectory (\r
++              basename + ".h",\r
++              backend->intermediateDirectory );\r
++      CLEAN_FILE(generatedHeaderFilename);\r
++      */\r
++      string generatedHeaderFilename = basename + "_c.h";\r
++      CLEAN_FILE(generatedHeaderFilename);\r
++\r
++      string generatedClientFilename = PassThruCacheDirectory (\r
++              basename + "_c.c",\r
++              backend->intermediateDirectory );\r
++      CLEAN_FILE(generatedClientFilename);\r
++\r
++      fprintf ( fMakefile,\r
++                "%s %s: %s $(WIDL_TARGET) | %s\n",\r
++                generatedClientFilename.c_str (),\r
++                generatedHeaderFilename.c_str (),\r
++                sourceFilename.c_str (),\r
++                GetDirectory ( generatedClientFilename ).c_str () );\r
++      fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" );\r
++      fprintf ( fMakefile,\r
++                "\t%s %s -h -H %s -c -C %s %s\n",\r
++                "$(Q)$(WIDL_TARGET)",\r
++                widlflagsMacro.c_str (),\r
++                generatedHeaderFilename.c_str (),\r
++                generatedClientFilename.c_str (),\r
++                sourceFilename.c_str () );\r
++}\r
++\r
++void\r
++MingwModuleHandler::GenerateWidlCommands (\r
++      const string& sourceFilename,\r
++      const string& widlflagsMacro )\r
++{\r
++      if ( module.type == RpcServer )\r
++              GenerateWidlCommandsServer ( sourceFilename,\r
++                                           widlflagsMacro );\r
++      else\r
++              GenerateWidlCommandsClient ( sourceFilename,\r
++                                           widlflagsMacro );\r
++}\r
++\r
 +void\r
 +MingwModuleHandler::GenerateCommands (\r
 +      const string& sourceFilename,\r
 +      const string& cc,\r
 +      const string& cppc,\r
 +      const string& cflagsMacro,\r
 +      const string& nasmflagsMacro,\r
-       const string& windresflagsMacro )\r
++      const string& windresflagsMacro,\r
++      const string& widlflagsMacro )\r
 +{\r
 +      string extension = GetExtension ( sourceFilename );\r
 +      if ( extension == ".c" || extension == ".C" )\r
 +      {\r
 +              GenerateGccCommand ( sourceFilename,\r
 +                                   cc,\r
 +                                   cflagsMacro );\r
 +              return;\r
 +      }\r
 +      else if ( extension == ".cc" || extension == ".CC" ||\r
 +                extension == ".cpp" || extension == ".CPP" ||\r
 +                extension == ".cxx" || extension == ".CXX" )\r
 +      {\r
 +              GenerateGccCommand ( sourceFilename,\r
 +                                   cppc,\r
 +                                   cflagsMacro );\r
 +              return;\r
 +      }\r
 +      else if ( extension == ".s" || extension == ".S" )\r
 +      {\r
 +              GenerateGccAssemblerCommand ( sourceFilename,\r
 +                                            cc,\r
 +                                            cflagsMacro );\r
 +              return;\r
 +      }\r
 +      else if ( extension == ".asm" || extension == ".ASM" )\r
 +      {\r
 +              GenerateNasmCommand ( sourceFilename,\r
 +                                    nasmflagsMacro );\r
 +              return;\r
 +      }\r
 +      else if ( extension == ".rc" || extension == ".RC" )\r
 +      {\r
 +              GenerateWindresCommand ( sourceFilename,\r
 +                                       windresflagsMacro );\r
 +              return;\r
 +      }\r
 +      else if ( extension == ".spec" || extension == ".SPEC" )\r
 +      {\r
 +              GenerateWinebuildCommands ( sourceFilename );\r
 +              GenerateGccCommand ( GetActualSourceFilename ( sourceFilename ),\r
 +                                   cc,\r
 +                                   cflagsMacro );\r
 +              return;\r
 +      }\r
++      else if ( extension == ".idl" || extension == ".IDL" )\r
++      {\r
++              GenerateWidlCommands ( sourceFilename,\r
++                                     widlflagsMacro );\r
++              GenerateGccCommand ( GetActualSourceFilename ( sourceFilename ),\r
++                                   cc,\r
++                                   cflagsMacro );\r
++              return;\r
++      }\r
 +\r
 +      throw InvalidOperationException ( __FILE__,\r
 +                                        __LINE__,\r
 +                                        "Unsupported filename extension '%s' in file '%s'",\r
 +                                        extension.c_str (),\r
 +                                        sourceFilename.c_str () );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateBuildMapCode ()\r
 +{\r
 +      fprintf ( fMakefile,\r
 +                "ifeq ($(ROS_BUILDMAP),full)\n" );\r
 +\r
 +      string mapFilename = PassThruCacheDirectory (\r
 +              GetBasename ( module.GetPath () ) + ".map",\r
 +              backend->outputDirectory );\r
 +      CLEAN_FILE ( mapFilename );\r
 +      \r
 +      fprintf ( fMakefile,\r
 +                "\t$(ECHO_OBJDUMP)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(Q)${objdump} -d -S $@ > %s\n",\r
 +                mapFilename.c_str () );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "else\n" );\r
 +      fprintf ( fMakefile,\r
 +                "ifeq ($(ROS_BUILDMAP),yes)\n" );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "\t$(ECHO_NM)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(Q)${nm} --numeric-sort $@ > %s\n",\r
 +                mapFilename.c_str () );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "endif\n" );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "endif\n" );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateLinkerCommand (\r
 +      const string& dependencies,\r
 +      const string& linker,\r
 +      const string& linkerParameters,\r
 +      const string& objectsMacro,\r
 +      const string& libsMacro )\r
 +{\r
 +      string target ( GetTargetMacro ( module ) );\r
 +      string target_folder ( GetDirectory ( GetTargetFilename ( module, NULL ) ) );\r
 +\r
 +      fprintf ( fMakefile,\r
 +              "%s: %s $(RSYM_TARGET) | %s\n",\r
 +              target.c_str (),\r
 +              dependencies.c_str (),\r
 +              target_folder.c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_LD)\n" );\r
 +      string targetName ( module.GetTargetName () );\r
 +      if ( module.importLibrary != NULL )\r
 +      {\r
 +              string base_tmp = ros_temp + module.name + ".base.tmp";\r
 +              CLEAN_FILE ( base_tmp );\r
 +              string junk_tmp = ros_temp + module.name + ".junk.tmp";\r
 +              CLEAN_FILE ( junk_tmp );\r
 +              string temp_exp = ros_temp + module.name + ".temp.exp";\r
 +              CLEAN_FILE ( temp_exp );\r
 +              string def_file = GetDefinitionFilename ();\r
 +\r
 +              fprintf ( fMakefile,\r
 +                        "\t%s %s -Wl,--base-file,%s -o %s %s %s %s\n",\r
 +                        linker.c_str (),\r
 +                        linkerParameters.c_str (),\r
 +                        base_tmp.c_str (),\r
 +                        junk_tmp.c_str (),\r
 +                        objectsMacro.c_str (),\r
 +                        libsMacro.c_str (),\r
 +                        GetLinkerMacro ().c_str () );\r
 +\r
 +              fprintf ( fMakefile,\r
 +                        "\t-@${rm} %s 2>$(NUL)\n",\r
 +                        junk_tmp.c_str () );\r
 +\r
 +              string killAt = module.mangledSymbols ? "" : "--kill-at";\r
 +              fprintf ( fMakefile,\r
 +                        "\t${dlltool} --dllname %s --base-file %s --def %s --output-exp %s %s\n",\r
 +                        targetName.c_str (),\r
 +                        base_tmp.c_str (),\r
 +                        def_file.c_str (),\r
 +                        temp_exp.c_str (),\r
 +                        killAt.c_str () );\r
 +\r
 +              fprintf ( fMakefile,\r
 +                        "\t-@${rm} %s 2>$(NUL)\n",\r
 +                        base_tmp.c_str () );\r
 +\r
 +              fprintf ( fMakefile,\r
 +                        "\t%s %s %s -o %s %s %s %s\n",\r
 +                        linker.c_str (),\r
 +                        linkerParameters.c_str (),\r
 +                        temp_exp.c_str (),\r
 +                        target.c_str (),\r
 +                        objectsMacro.c_str (),\r
 +                        libsMacro.c_str (),\r
 +                        GetLinkerMacro ().c_str () );\r
 +\r
 +              fprintf ( fMakefile,\r
 +                        "\t-@${rm} %s 2>$(NUL)\n",\r
 +                        temp_exp.c_str () );\r
 +      }\r
 +      else\r
 +      {\r
 +              fprintf ( fMakefile,\r
 +                        "\t%s %s -o %s %s %s %s\n",\r
 +                        linker.c_str (),\r
 +                        linkerParameters.c_str (),\r
 +                        target.c_str (),\r
 +                        objectsMacro.c_str (),\r
 +                        libsMacro.c_str (),\r
 +                        GetLinkerMacro ().c_str () );\r
 +      }\r
 +\r
 +      GenerateBuildMapCode ();\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "\t$(ECHO_RSYM)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(Q)$(RSYM_TARGET) $@ $@\n\n" );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GeneratePhonyTarget() const\r
 +{\r
 +      string targetMacro ( GetTargetMacro(module) );\r
 +      fprintf ( fMakefile, ".PHONY: %s\n\n",\r
 +                targetMacro.c_str ());\r
 +      fprintf ( fMakefile, "%s: | %s\n",\r
 +                targetMacro.c_str (),\r
 +                GetDirectory(GetTargetFilename(module,NULL)).c_str () );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateObjectFileTargets (\r
 +      const IfableData& data,\r
 +      const string& cc,\r
 +      const string& cppc,\r
 +      const string& cflagsMacro,\r
 +      const string& nasmflagsMacro,\r
-                                  windresflagsMacro );\r
++      const string& windresflagsMacro,\r
++      const string& widlflagsMacro )\r
 +{\r
 +      size_t i;\r
 +      \r
 +      const vector<File*>& files = data.files;\r
 +      for ( i = 0; i < files.size (); i++ )\r
 +      {\r
 +              string sourceFilename = files[i]->name;\r
 +              GenerateCommands ( sourceFilename,\r
 +                                 cc,\r
 +                                 cppc,\r
 +                                 cflagsMacro,\r
 +                                 nasmflagsMacro,\r
-                                           windresflagsMacro );\r
++                                 windresflagsMacro,\r
++                                 widlflagsMacro );\r
 +              fprintf ( fMakefile,\r
 +                        "\n" );\r
 +      }\r
 +\r
 +      const vector<If*>& ifs = data.ifs;\r
 +      for ( i = 0; i < ifs.size(); i++ )\r
 +      {\r
 +              GenerateObjectFileTargets ( ifs[i]->data,\r
 +                                          cc,\r
 +                                          cppc,\r
 +                                          cflagsMacro,\r
 +                                          nasmflagsMacro,\r
-       const string& windresflagsMacro )\r
++                                          windresflagsMacro,\r
++                                          widlflagsMacro );\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateObjectFileTargets (\r
 +      const string& cc,\r
 +      const string& cppc,\r
 +      const string& cflagsMacro,\r
 +      const string& nasmflagsMacro,\r
-                                   windresflagsMacro );\r
++      const string& windresflagsMacro,\r
++      const string& widlflagsMacro )\r
 +{\r
 +      if ( module.pch )\r
 +      {\r
 +              const string& pch_file = module.pch->header;\r
 +              string gch_file = pch_file + ".gch";\r
 +              CLEAN_FILE(gch_file);\r
 +              if ( use_pch )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "%s: %s\n",\r
 +                              gch_file.c_str(),\r
 +                              pch_file.c_str() );\r
 +                      fprintf ( fMakefile, "\t$(ECHO_PCH)\n" );\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "\t%s -o %s %s -g %s\n\n",\r
 +                              ( module.cplusplus ? cppc.c_str() : cc.c_str() ),\r
 +                              gch_file.c_str(),\r
 +                              cflagsMacro.c_str(),\r
 +                              pch_file.c_str() );\r
 +              }\r
 +      }\r
 +\r
 +      GenerateObjectFileTargets ( module.non_if_data,\r
 +                                  cc,\r
 +                                  cppc,\r
 +                                  cflagsMacro,\r
 +                                  nasmflagsMacro,\r
-       if ( module.type == ObjectLibrary )\r
++                                  windresflagsMacro,\r
++                                  widlflagsMacro );\r
 +      fprintf ( fMakefile, "\n" );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GenerateArchiveTarget ( const string& ar,\r
 +                                            const string& objs_macro ) const\r
 +{\r
 +      string archiveFilename ( GetModuleArchiveFilename () );\r
 +      \r
 +      fprintf ( fMakefile,\r
 +                "%s: %s | %s\n",\r
 +                archiveFilename.c_str (),\r
 +                objs_macro.c_str (),\r
 +                GetDirectory(archiveFilename).c_str() );\r
 +\r
 +      fprintf ( fMakefile, "\t$(ECHO_AR)\n" );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "\t%s -rc $@ %s\n\n",\r
 +                ar.c_str (),\r
 +                objs_macro.c_str ());\r
 +\r
 +      return archiveFilename;\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetCFlagsMacro () const\r
 +{\r
 +      return ssprintf ( "$(%s_CFLAGS)",\r
 +                        module.name.c_str () );\r
 +}\r
 +\r
 +/*static*/ string\r
 +MingwModuleHandler::GetObjectsMacro ( const Module& module )\r
 +{\r
 +      return ssprintf ( "$(%s_OBJS)",\r
 +                        module.name.c_str () );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetLinkingDependenciesMacro () const\r
 +{\r
 +      return ssprintf ( "$(%s_LINKDEPS)", module.name.c_str () );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetLibsMacro () const\r
 +{\r
 +      return ssprintf ( "$(%s_LIBS)", module.name.c_str () );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetLinkerMacro () const\r
 +{\r
 +      return ssprintf ( "$(%s_LFLAGS)",\r
 +                        module.name.c_str () );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetModuleTargets ( const Module& module )\r
 +{\r
-       if ( module.type != ObjectLibrary )\r
++      if ( ReferenceObjects ( module ) )\r
 +              return GetObjectsMacro ( module );\r
 +      else\r
 +              return GetTargetFilename ( module, NULL );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateObjectMacro ()\r
 +{\r
 +      objectsMacro = ssprintf ("%s_OBJS", module.name.c_str ());\r
 +\r
 +      GenerateObjectMacros (\r
 +              "=",\r
 +              module.non_if_data,\r
 +              &module.compilerFlags,\r
 +              &module.linkerFlags );\r
 +\r
 +      // future references to the macro will be to get its values\r
 +      objectsMacro = ssprintf ("$(%s)", objectsMacro.c_str ());\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateTargetMacro ()\r
 +{\r
 +      fprintf ( fMakefile,\r
 +              "%s := %s\n",\r
 +              GetTargetMacro ( module, false ).c_str (),\r
 +              GetModuleTargets ( module ).c_str () );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateOtherMacros ()\r
 +{\r
 +      cflagsMacro = ssprintf ("%s_CFLAGS", module.name.c_str ());\r
 +      nasmflagsMacro = ssprintf ("%s_NASMFLAGS", module.name.c_str ());\r
 +      windresflagsMacro = ssprintf ("%s_RCFLAGS", module.name.c_str ());\r
++      widlflagsMacro = ssprintf ("%s_WIDLFLAGS", module.name.c_str ());\r
 +      linkerflagsMacro = ssprintf ("%s_LFLAGS", module.name.c_str ());\r
 +      libsMacro = ssprintf("%s_LIBS", module.name.c_str ());\r
 +      linkDepsMacro = ssprintf ("%s_LINKDEPS", module.name.c_str ());\r
 +\r
 +      GenerateMacros (\r
 +              "=",\r
 +              module.non_if_data,\r
 +              &module.compilerFlags,\r
 +              &module.linkerFlags );\r
 +\r
 +      if ( module.importLibrary )\r
 +      {\r
 +              string_list s;\r
 +              const vector<File*>& files = module.non_if_data.files;\r
 +              for ( size_t i = 0; i < files.size (); i++ )\r
 +              {\r
 +                      File& file = *files[i];\r
 +                      string extension = GetExtension ( file.name );\r
 +                      if ( extension == ".spec" || extension == ".SPEC" )\r
 +                              GetSpecObjectDependencies ( s, file.name );\r
 +              }\r
 +              if ( s.size () > 0 )\r
 +              {\r
 +                      fprintf (\r
 +                              fMakefile,\r
 +                              "%s +=",\r
 +                              linkDepsMacro.c_str() );\r
 +                      for ( size_t i = 0; i < s.size(); i++ )\r
 +                              fprintf ( fMakefile,\r
 +                                        " %s",\r
 +                                        s[i].c_str () );\r
 +                      fprintf ( fMakefile, "\n" );\r
 +              }\r
 +      }\r
 +\r
 +      string globalCflags = "-g";\r
 +      if ( backend->usePipe )\r
 +              globalCflags += " -pipe";\r
 +      \r
 +      fprintf (\r
 +              fMakefile,\r
 +              "%s += $(PROJECT_CFLAGS) %s\n",\r
 +              cflagsMacro.c_str (),\r
 +              globalCflags.c_str () );\r
 +\r
 +      fprintf (\r
 +              fMakefile,\r
 +              "%s += $(PROJECT_RCFLAGS)\n",\r
 +              windresflagsMacro.c_str () );\r
 +\r
++      fprintf (\r
++              fMakefile,\r
++              "%s += $(PROJECT_WIDLFLAGS)\n",\r
++              widlflagsMacro.c_str () );\r
++\r
 +      fprintf (\r
 +              fMakefile,\r
 +              "%s_LFLAGS += $(PROJECT_LFLAGS) -g\n",\r
 +              module.name.c_str () );\r
 +\r
 +      fprintf (\r
 +              fMakefile,\r
 +              "%s += $(%s)\n",\r
 +              linkDepsMacro.c_str (),\r
 +              libsMacro.c_str () );\r
 +\r
 +      string cflags = TypeSpecificCFlags();\r
 +      if ( cflags.size() > 0 )\r
 +      {\r
 +              fprintf ( fMakefile,\r
 +                        "%s += %s\n\n",\r
 +                        cflagsMacro.c_str (),\r
 +                        cflags.c_str () );\r
 +      }\r
 +\r
 +      string nasmflags = TypeSpecificNasmFlags();\r
 +      if ( nasmflags.size () > 0 )\r
 +      {\r
 +              fprintf ( fMakefile,\r
 +                        "%s += %s\n\n",\r
 +                        nasmflagsMacro.c_str (),\r
 +                        nasmflags.c_str () );\r
 +      }\r
 +\r
 +      fprintf ( fMakefile, "\n\n" );\r
 +\r
 +      // future references to the macros will be to get their values\r
 +      cflagsMacro = ssprintf ("$(%s)", cflagsMacro.c_str ());\r
 +      nasmflagsMacro = ssprintf ("$(%s)", nasmflagsMacro.c_str ());\r
++      widlflagsMacro = ssprintf ("$(%s)", widlflagsMacro.c_str ());\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateRules ()\r
 +{\r
 +      string cc = ( module.host == HostTrue ? "${host_gcc}" : "${gcc}" );\r
 +      string cppc = ( module.host == HostTrue ? "${host_gpp}" : "${gpp}" );\r
 +      string ar = ( module.host == HostTrue ? "${host_ar}" : "${ar}" );\r
 +\r
 +      string targetMacro = GetTargetMacro ( module );\r
 +\r
 +      CLEAN_FILE ( targetMacro );\r
 +\r
 +      // generate phony target for module name\r
 +      fprintf ( fMakefile, ".PHONY: %s\n",\r
 +              module.name.c_str () );\r
 +      fprintf ( fMakefile, "%s: %s\n\n",\r
 +              module.name.c_str (),\r
 +              GetTargetMacro ( module ).c_str () );\r
 +\r
-                                                               windresflagsMacro );\r
++      if ( !ReferenceObjects ( module ) )\r
 +      {\r
 +              string ar_target ( GenerateArchiveTarget ( ar, objectsMacro ) );\r
 +              if ( targetMacro != ar_target )\r
 +              {\r
 +                      CLEAN_FILE ( ar_target );\r
 +              }\r
 +      }\r
 +\r
 +      GenerateObjectFileTargets ( cc,\r
 +                                                              cppc,\r
 +                                                              cflagsMacro,\r
 +                                                              nasmflagsMacro,\r
-       string targetMacro ( GetTargetMacro (module) ); // i.e. "$(NTOSKRNL_TARGET)"\r
++                                                              windresflagsMacro,\r
++                                                          widlflagsMacro );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GetInvocationDependencies (\r
 +      const Module& module,\r
 +      string_list& dependencies )\r
 +{\r
 +      for ( size_t i = 0; i < module.invocations.size (); i++ )\r
 +      {\r
 +              Invoke& invoke = *module.invocations[i];\r
 +              if ( invoke.invokeModule == &module )\r
 +                      /* Protect against circular dependencies */\r
 +                      continue;\r
 +              invoke.GetTargets ( dependencies );\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateInvocations () const\r
 +{\r
 +      if ( module.invocations.size () == 0 )\r
 +              return;\r
 +      \r
 +      size_t iend = module.invocations.size ();\r
 +      for ( size_t i = 0; i < iend; i++ )\r
 +      {\r
 +              const Invoke& invoke = *module.invocations[i];\r
 +\r
 +              if ( invoke.invokeModule->type != BuildTool )\r
 +              {\r
 +                      throw InvalidBuildFileException ( module.node.location,\r
 +                                                        "Only modules of type buildtool can be invoked." );\r
 +              }\r
 +\r
 +              string invokeTarget = module.GetInvocationTarget ( i );\r
 +              string_list invoke_targets;\r
 +              assert ( invoke_targets.size() );\r
 +              invoke.GetTargets ( invoke_targets );\r
 +              fprintf ( fMakefile,\r
 +                        ".PHONY: %s\n\n",\r
 +                        invokeTarget.c_str () );\r
 +              fprintf ( fMakefile,\r
 +                        "%s:",\r
 +                        invokeTarget.c_str () );\r
 +              size_t j, jend = invoke_targets.size();\r
 +              for ( j = 0; j < jend; j++ )\r
 +              {\r
 +                      fprintf ( fMakefile,\r
 +                                " %s",\r
 +                                invoke_targets[i].c_str () );\r
 +              }\r
 +              fprintf ( fMakefile, "\n\n%s", invoke_targets[0].c_str () );\r
 +              for ( j = 1; j < jend; j++ )\r
 +                      fprintf ( fMakefile,\r
 +                                " %s",\r
 +                                invoke_targets[i].c_str () );\r
 +              fprintf ( fMakefile,\r
 +                        ": %s\n",\r
 +                        NormalizeFilename ( invoke.invokeModule->GetPath () ).c_str () );\r
 +              fprintf ( fMakefile, "\t$(ECHO_INVOKE)\n" );\r
 +              fprintf ( fMakefile,\r
 +                        "\t%s %s\n\n",\r
 +                        NormalizeFilename ( invoke.invokeModule->GetPath () ).c_str (),\r
 +                        invoke.GetParameters ().c_str () );\r
 +      }\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetPreconditionDependenciesName () const\r
 +{\r
 +      return module.name + "_precondition";\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GetDefaultDependencies (\r
 +      string_list& dependencies ) const\r
 +{\r
 +      /* Avoid circular dependency */\r
 +      if ( module.type != BuildTool\r
 +              && module.name != "zlib"\r
 +              && module.name != "hostzlib" )\r
 +\r
 +              dependencies.push_back ( "$(INIT)" );\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GeneratePreconditionDependencies ()\r
 +{\r
 +      string preconditionDependenciesName = GetPreconditionDependenciesName ();\r
 +      string_list sourceFilenames;\r
 +      GetSourceFilenamesWithoutGeneratedFiles ( sourceFilenames );\r
 +      string_list dependencies;\r
 +      GetDefaultDependencies ( dependencies );\r
 +      GetModuleDependencies ( dependencies );\r
 +\r
 +      GetInvocationDependencies ( module, dependencies );\r
 +      \r
 +      if ( dependencies.size() )\r
 +      {\r
 +              fprintf ( fMakefile,\r
 +                        "%s =",\r
 +                        preconditionDependenciesName.c_str () );\r
 +              for ( size_t i = 0; i < dependencies.size(); i++ )\r
 +                      fprintf ( fMakefile,\r
 +                                " %s",\r
 +                                dependencies[i].c_str () );\r
 +              fprintf ( fMakefile, "\n\n" );\r
 +      }\r
 +\r
 +      for ( size_t i = 0; i < sourceFilenames.size(); i++ )\r
 +      {\r
 +              fprintf ( fMakefile,\r
 +                        "%s: ${%s}\n",\r
 +                        sourceFilenames[i].c_str(),\r
 +                        preconditionDependenciesName.c_str ());\r
 +      }\r
 +      fprintf ( fMakefile, "\n" );\r
 +}\r
 +\r
 +bool\r
 +MingwModuleHandler::IsWineModule () const\r
 +{\r
 +      if ( module.importLibrary == NULL)\r
 +              return false;\r
 +\r
 +      size_t index = module.importLibrary->definition.rfind ( ".spec.def" );\r
 +      return ( index != string::npos );\r
 +}\r
 +\r
 +string\r
 +MingwModuleHandler::GetDefinitionFilename () const\r
 +{\r
 +      string defFilename = module.GetBasePath () + SSEP + module.importLibrary->definition;\r
 +      if ( IsWineModule () )\r
 +              return PassThruCacheDirectory ( NormalizeFilename ( defFilename ),\r
 +                                              backend->intermediateDirectory );\r
 +      else\r
 +              return defFilename;\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GenerateImportLibraryTargetIfNeeded ()\r
 +{\r
 +      if ( module.importLibrary != NULL )\r
 +      {\r
 +              string library_target (\r
 +                      GetImportLibraryFilename ( module, &clean_files ) );\r
 +\r
 +              string_list deps;\r
 +              GetDefinitionDependencies ( deps );\r
 +\r
 +              fprintf ( fMakefile, "# IMPORT LIBRARY RULE:\n" );\r
 +\r
 +              fprintf ( fMakefile, "%s:",\r
 +                        library_target.c_str () );\r
 +\r
 +              size_t i, iend = deps.size();\r
 +              for ( i = 0; i < iend; i++ )\r
 +                      fprintf ( fMakefile, " %s",\r
 +                                deps[i].c_str () );\r
 +\r
 +              fprintf ( fMakefile, " | %s\n",\r
 +                        GetDirectory ( GetTargetFilename ( module, NULL ) ).c_str () );\r
 +\r
 +              fprintf ( fMakefile, "\t$(ECHO_DLLTOOL)\n" );\r
 +\r
 +              string killAt = module.mangledSymbols ? "" : "--kill-at";\r
 +              fprintf ( fMakefile,\r
 +                        "\t${dlltool} --dllname %s --def %s --output-lib %s %s\n\n",\r
 +                        module.GetTargetName ().c_str (),\r
 +                        GetDefinitionFilename ().c_str (),\r
 +                        library_target.c_str (),\r
 +                        killAt.c_str () );\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwModuleHandler::GetSpecObjectDependencies (\r
 +      string_list& dependencies,\r
 +      const string& filename ) const\r
 +{\r
 +      string basename = GetBasename ( filename );\r
 +      string defDependency = PassThruCacheDirectory (\r
 +              NormalizeFilename ( basename + ".spec.def" ),\r
 +              backend->intermediateDirectory );\r
 +      dependencies.push_back ( defDependency );\r
 +      string stubsDependency = PassThruCacheDirectory (\r
 +              NormalizeFilename ( basename + ".stubs.c" ),\r
 +              backend->intermediateDirectory );\r
 +      dependencies.push_back ( stubsDependency );\r
 +}\r
 +\r
++void\r
++MingwModuleHandler::GetWidlObjectDependencies (\r
++      string_list& dependencies,\r
++      const string& filename ) const\r
++{\r
++      string basename = GetBasename ( filename );\r
++      string serverDependency = PassThruCacheDirectory (\r
++              NormalizeFilename ( basename + "_s.c" ),\r
++              backend->intermediateDirectory );\r
++      dependencies.push_back ( serverDependency );\r
++}\r
++\r
 +void\r
 +MingwModuleHandler::GetDefinitionDependencies (\r
 +      string_list& dependencies ) const\r
 +{\r
 +      string dkNkmLibNoFixup = "dk/nkm/lib";\r
 +      const vector<File*>& files = module.non_if_data.files;\r
 +      for ( size_t i = 0; i < files.size (); i++ )\r
 +      {\r
 +              File& file = *files[i];\r
 +              string extension = GetExtension ( file.name );\r
 +              if ( extension == ".spec" || extension == ".SPEC" )\r
 +              {\r
 +                      GetSpecObjectDependencies ( dependencies, file.name );\r
 +              }\r
++              if ( extension == ".idl" || extension == ".IDL" )\r
++              {\r
++                      GetWidlObjectDependencies ( dependencies, file.name );\r
++              }\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwBuildToolModuleHandler::MingwBuildToolModuleHandler ( const Module& module_ )\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwBuildToolModuleHandler::Process ()\r
 +{\r
 +      GenerateBuildToolModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateRules ();\r
 +\r
 +      string linker;\r
 +      if ( module.cplusplus )\r
 +              linker = "${host_gpp}";\r
 +      else\r
 +              linker = "${host_gcc}";\r
 +      \r
 +      fprintf ( fMakefile, "%s: %s %s | %s\n",\r
 +                targetMacro.c_str (),\r
 +                objectsMacro.c_str (),\r
 +                linkDepsMacro.c_str (),\r
 +                GetDirectory(GetTargetFilename(module,NULL)).c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_LD)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t%s %s -o $@ %s %s\n\n",\r
 +                linker.c_str (),\r
 +                GetLinkerMacro ().c_str (),\r
 +                objectsMacro.c_str (),\r
 +                libsMacro.c_str () );\r
 +}\r
 +\r
 +\r
 +MingwKernelModuleHandler::MingwKernelModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwKernelModuleHandler::Process ()\r
 +{\r
 +      GenerateKernelModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwKernelModuleHandler::GenerateKernelModuleTarget ()\r
 +{\r
 +      string targetName ( module.GetTargetName () ); // i.e. "ntoskrnl.exe"\r
-       string targetMacro ( GetTargetMacro (module) );\r
++      string targetMacro ( GetTargetMacro ( module ) ); // i.e. "$(NTOSKRNL_TARGET)"\r
 +      string workingDirectory = GetWorkingDirectory ();\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +      string base_tmp = ros_temp + module.name + ".base.tmp";\r
 +      CLEAN_FILE ( base_tmp );\r
 +      string junk_tmp = ros_temp + module.name + ".junk.tmp";\r
 +      CLEAN_FILE ( junk_tmp );\r
 +      string temp_exp = ros_temp + module.name + ".temp.exp";\r
 +      CLEAN_FILE ( temp_exp );\r
 +      string gccOptions = ssprintf ("-Wl,-T,%s" SSEP "ntoskrnl.lnk -Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",\r
 +                                    module.GetBasePath ().c_str (),\r
 +                                    module.entrypoint.c_str (),\r
 +                                    module.baseaddress.c_str () );\r
 +\r
 +      GenerateRules ();\r
 +\r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      fprintf ( fMakefile, "%s: %s %s $(RSYM_TARGET) | %s\n",\r
 +                targetMacro.c_str (),\r
 +                objectsMacro.c_str (),\r
 +                linkDepsMacro.c_str (),\r
 +                GetDirectory(GetTargetFilename(module,NULL)).c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_LD)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t${gcc} %s %s -Wl,--base-file,%s -o %s %s %s\n",\r
 +                GetLinkerMacro ().c_str (),\r
 +                gccOptions.c_str (),\r
 +                base_tmp.c_str (),\r
 +                junk_tmp.c_str (),\r
 +                objectsMacro.c_str (),\r
 +                linkDepsMacro.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t-@${rm} %s 2>$(NUL)\n",\r
 +                junk_tmp.c_str () );\r
 +      string killAt = module.mangledSymbols ? "" : "--kill-at";\r
 +      fprintf ( fMakefile,\r
 +                "\t${dlltool} --dllname %s --base-file %s --def ntoskrnl/ntoskrnl.def --output-exp %s %s\n",\r
 +                targetName.c_str (),\r
 +                base_tmp.c_str (),\r
 +                temp_exp.c_str (),\r
 +                killAt.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t-@${rm} %s 2>$(NUL)\n",\r
 +                base_tmp.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t${gcc} %s %s -Wl,%s -o $@ %s %s\n",\r
 +                GetLinkerMacro ().c_str (),\r
 +                gccOptions.c_str (),\r
 +                temp_exp.c_str (),\r
 +                objectsMacro.c_str (),\r
 +                linkDepsMacro.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t-@${rm} %s 2>$(NUL)\n",\r
 +                temp_exp.c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_RSYM)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(Q)$(RSYM_TARGET) $@ $@\n\n" );\r
 +}\r
 +\r
 +\r
 +MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwStaticLibraryModuleHandler::Process ()\r
 +{\r
 +      GenerateStaticLibraryModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ()\r
 +{\r
 +      GenerateRules ();\r
 +}\r
 +\r
 +\r
 +MingwObjectLibraryModuleHandler::MingwObjectLibraryModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwObjectLibraryModuleHandler::Process ()\r
 +{\r
 +      GenerateObjectLibraryModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwObjectLibraryModuleHandler::GenerateObjectLibraryModuleTarget ()\r
 +{\r
 +      GenerateRules ();\r
 +}\r
 +\r
 +\r
 +MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwKernelModeDLLModuleHandler::Process ()\r
 +{\r
 +      GenerateKernelModeDLLModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ()\r
 +{\r
++      string targetMacro ( GetTargetMacro ( module ) );\r
 +      string workingDirectory = GetWorkingDirectory ( );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies =\r
 +                      objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      "${gcc}",\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwKernelModeDriverModuleHandler::MingwKernelModeDriverModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwKernelModeDriverModuleHandler::Process ()\r
 +{\r
 +      GenerateKernelModeDriverModuleTarget ();\r
 +}\r
 +\r
 +\r
 +void\r
 +MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string workingDirectory = GetWorkingDirectory ();\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies = objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      "${gcc}",\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwNativeDLLModuleHandler::Process ()\r
 +{\r
 +      GenerateNativeDLLModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string workingDirectory = GetWorkingDirectory ( );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +      \r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies =\r
 +                      objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      "${gcc}",\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwNativeCUIModuleHandler::Process ()\r
 +{\r
 +      GenerateNativeCUIModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string workingDirectory = GetWorkingDirectory ( );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +      \r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies =\r
 +                      objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      "${gcc}",\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwWin32DLLModuleHandler::Process ()\r
 +{\r
 +      GenerateExtractWineDLLResourcesTarget ();\r
 +      GenerateWin32DLLModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwWin32DLLModuleHandler::GenerateExtractWineDLLResourcesTarget ()\r
 +{\r
 +      fprintf ( fMakefile, ".PHONY: %s_extractresources\n\n",\r
 +                module.name.c_str () );\r
 +      fprintf ( fMakefile, "%s_extractresources: $(BIN2RES_TARGET)\n",\r
 +                module.name.c_str () );\r
 +      const vector<File*>& files = module.non_if_data.files;\r
 +      for ( size_t i = 0; i < files.size (); i++ )\r
 +      {\r
 +              File& file = *files[i];\r
 +              string extension = GetExtension ( file.name );\r
 +              if ( extension == ".rc" || extension == ".RC" )\r
 +              {\r
 +                      string resource = NormalizeFilename ( file.name );\r
 +                      fprintf ( fMakefile, "\t$(ECHO_BIN2RES)\n" );\r
 +                      fprintf ( fMakefile, "\t@:echo ${bin2res} -f -x %s\n",\r
 +                                resource.c_str () );\r
 +              }\r
 +      }\r
 +      fprintf ( fMakefile, "\n");\r
 +}\r
 +\r
 +void\r
 +MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string workingDirectory = GetWorkingDirectory ( );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies = objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linker;\r
 +              if ( module.cplusplus )\r
 +                      linker = "${gpp}";\r
 +              else\r
 +                      linker = "${gcc}";\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -mdll",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      linker,\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwWin32CUIModuleHandler::Process ()\r
 +{\r
 +      GenerateWin32CUIModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string workingDirectory = GetWorkingDirectory ( );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies =\r
 +                      objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linker;\r
 +              if ( module.cplusplus )\r
 +                      linker = "${gpp}";\r
 +              else\r
 +                      linker = "${gcc}";\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      linker,\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwWin32GUIModuleHandler::Process ()\r
 +{\r
 +      GenerateWin32GUIModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string workingDirectory = GetWorkingDirectory ( );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies =\r
 +                      objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linker;\r
 +              if ( module.cplusplus )\r
 +                      linker = "${gpp}";\r
 +              else\r
 +                      linker = "${gcc}";\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,windows -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      linker,\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
 +\r
 +\r
 +MingwBootLoaderModuleHandler::MingwBootLoaderModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwBootLoaderModuleHandler::Process ()\r
 +{\r
 +      GenerateBootLoaderModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget ()\r
 +{\r
 +      string targetName ( module.GetTargetName () );\r
 +      string targetMacro ( GetTargetMacro (module) );\r
 +      string workingDirectory = GetWorkingDirectory ();\r
 +      string junk_tmp = ros_temp + module.name + ".junk.tmp";\r
 +      CLEAN_FILE ( junk_tmp );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateRules ();\r
 +\r
 +      fprintf ( fMakefile, "%s: %s %s | %s\n",\r
 +                targetMacro.c_str (),\r
 +                objectsMacro.c_str (),\r
 +                linkDepsMacro.c_str (),\r
 +                GetDirectory(GetTargetFilename(module,NULL)).c_str () );\r
 +\r
 +      fprintf ( fMakefile, "\t$(ECHO_LD)\n" );\r
 +\r
 +      fprintf ( fMakefile,\r
 +                "\t${ld} %s -N -Ttext=0x8000 -o %s %s %s\n",\r
 +                GetLinkerMacro ().c_str (),\r
 +                junk_tmp.c_str (),\r
 +                objectsMacro.c_str (),\r
 +                linkDepsMacro.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t${objcopy} -O binary %s $@\n",\r
 +                junk_tmp.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t-@${rm} %s 2>$(NUL)\n",\r
 +                junk_tmp.c_str () );\r
 +}\r
 +\r
 +\r
 +MingwBootSectorModuleHandler::MingwBootSectorModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwBootSectorModuleHandler::Process ()\r
 +{\r
 +      GenerateBootSectorModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwBootSectorModuleHandler::GenerateBootSectorModuleTarget ()\r
 +{\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +\r
 +      GenerateRules ();\r
 +\r
 +      fprintf ( fMakefile, ".PHONY: %s\n\n",\r
 +                module.name.c_str ());\r
 +      fprintf ( fMakefile,\r
 +                "%s: %s\n",\r
 +                module.name.c_str (),\r
 +                objectsMacro.c_str () );\r
 +}\r
 +\r
 +\r
 +MingwIsoModuleHandler::MingwIsoModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwIsoModuleHandler::Process ()\r
 +{\r
 +      GenerateIsoModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwIsoModuleHandler::OutputBootstrapfileCopyCommands (\r
 +      const string& bootcdDirectory )\r
 +{\r
 +      for ( size_t i = 0; i < module.project.modules.size (); i++ )\r
 +      {\r
 +              const Module& m = *module.project.modules[i];\r
 +              if ( m.bootstrap != NULL )\r
 +              {\r
 +                      string sourceFilename = PassThruCacheDirectory (\r
 +                              NormalizeFilename ( m.GetPath () ),\r
 +                              backend->outputDirectory );\r
 +                      string targetFilenameNoFixup ( bootcdDirectory + SSEP + m.bootstrap->base + SSEP + m.bootstrap->nameoncd );\r
 +                      string targetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
 +                              NormalizeFilename ( targetFilenameNoFixup ),\r
 +                              backend->outputDirectory );\r
 +                      fprintf ( fMakefile,\r
 +                                "\t$(ECHO_CP)\n" );\r
 +                      fprintf ( fMakefile,\r
 +                                "\t${cp} %s %s 1>$(NUL)\n",\r
 +                                sourceFilename.c_str (),\r
 +                                targetFilename.c_str () );\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwIsoModuleHandler::OutputCdfileCopyCommands (\r
 +      const string& bootcdDirectory )\r
 +{\r
 +      for ( size_t i = 0; i < module.project.cdfiles.size (); i++ )\r
 +      {\r
 +              const CDFile& cdfile = *module.project.cdfiles[i];\r
 +              string targetFilenameNoFixup = bootcdDirectory + SSEP + cdfile.base + SSEP + cdfile.nameoncd;\r
 +              string targetFilename = MingwModuleHandler::PassThruCacheDirectory (\r
 +                      NormalizeFilename ( targetFilenameNoFixup ),\r
 +                      backend->outputDirectory );\r
 +              fprintf ( fMakefile,\r
 +                        "\t$(ECHO_CP)\n" );\r
 +              fprintf ( fMakefile,\r
 +                        "\t${cp} %s %s 1>$(NUL)\n",\r
 +                        cdfile.GetPath ().c_str (),\r
 +                        targetFilename.c_str () );\r
 +      }\r
 +}\r
 +\r
 +string\r
 +MingwIsoModuleHandler::GetBootstrapCdDirectories ( const string& bootcdDirectory )\r
 +{\r
 +      string directories;\r
 +      for ( size_t i = 0; i < module.project.modules.size (); i++ )\r
 +      {\r
 +              const Module& m = *module.project.modules[i];\r
 +              if ( m.bootstrap != NULL )\r
 +              {\r
 +                      string targetDirectory ( bootcdDirectory + SSEP + m.bootstrap->base );\r
 +                      if ( directories.size () > 0 )\r
 +                              directories += " ";\r
 +                      directories += PassThruCacheDirectory (\r
 +                              NormalizeFilename ( targetDirectory ),\r
 +                              backend->outputDirectory );\r
 +              }\r
 +      }\r
 +      return directories;\r
 +}\r
 +\r
 +string\r
 +MingwIsoModuleHandler::GetNonModuleCdDirectories ( const string& bootcdDirectory )\r
 +{\r
 +      string directories;\r
 +      for ( size_t i = 0; i < module.project.cdfiles.size (); i++ )\r
 +      {\r
 +              const CDFile& cdfile = *module.project.cdfiles[i];\r
 +              string targetDirectory ( bootcdDirectory + SSEP + cdfile.base );\r
 +              if ( directories.size () > 0 )\r
 +                      directories += " ";\r
 +              directories += PassThruCacheDirectory (\r
 +                      NormalizeFilename ( targetDirectory ),\r
 +                      backend->outputDirectory );\r
 +      }\r
 +      return directories;\r
 +}\r
 +\r
 +string\r
 +MingwIsoModuleHandler::GetCdDirectories ( const string& bootcdDirectory )\r
 +{\r
 +      string directories = GetBootstrapCdDirectories ( bootcdDirectory );\r
 +      directories += " " + GetNonModuleCdDirectories ( bootcdDirectory );\r
 +      return directories;\r
 +}\r
 +\r
 +void\r
 +MingwIsoModuleHandler::GetBootstrapCdFiles (\r
 +      vector<string>& out ) const\r
 +{\r
 +      for ( size_t i = 0; i < module.project.modules.size (); i++ )\r
 +      {\r
 +              const Module& m = *module.project.modules[i];\r
 +              if ( m.bootstrap != NULL )\r
 +              {\r
 +                      string filename = PassThruCacheDirectory (\r
 +                              NormalizeFilename ( m.GetPath () ),\r
 +                              backend->outputDirectory );\r
 +                      out.push_back ( filename );\r
 +              }\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwIsoModuleHandler::GetNonModuleCdFiles (\r
 +      vector<string>& out ) const\r
 +{\r
 +      for ( size_t i = 0; i < module.project.cdfiles.size (); i++ )\r
 +      {\r
 +              const CDFile& cdfile = *module.project.cdfiles[i];\r
 +              out.push_back ( cdfile.GetPath () );\r
 +      }\r
 +}\r
 +\r
 +void\r
 +MingwIsoModuleHandler::GetCdFiles (\r
 +      vector<string>& out ) const\r
 +{\r
 +      GetBootstrapCdFiles ( out );\r
 +      GetNonModuleCdFiles ( out );\r
 +}\r
 +\r
 +void\r
 +MingwIsoModuleHandler::GenerateIsoModuleTarget ()\r
 +{\r
 +      string bootcdDirectory = "cd";\r
 +      string bootcd = PassThruCacheDirectory (\r
 +              NormalizeFilename ( bootcdDirectory + SSEP ),\r
 +              backend->outputDirectory );\r
 +      string isoboot = PassThruCacheDirectory (\r
 +              NormalizeFilename ( "boot" SSEP "freeldr" SSEP "bootsect" SSEP "isoboot.o" ),\r
 +              backend->outputDirectory );\r
 +      string bootcdReactosNoFixup = bootcdDirectory + SSEP "reactos";\r
 +      string bootcdReactos = PassThruCacheDirectory (\r
 +              NormalizeFilename ( bootcdReactosNoFixup ),\r
 +              backend->outputDirectory );\r
 +      CLEAN_FILE ( bootcdReactos );\r
 +      string reactosInf = PassThruCacheDirectory (\r
 +              NormalizeFilename ( bootcdReactosNoFixup + SSEP "reactos.inf" ),\r
 +              backend->outputDirectory );\r
 +      string reactosDff = NormalizeFilename ( "bootdata" SSEP "packages" SSEP "reactos.dff" );\r
 +      string cdDirectories = GetCdDirectories ( bootcdDirectory );\r
 +      vector<string> vCdFiles;\r
 +      GetCdFiles ( vCdFiles );\r
 +      string cdFiles = v2s ( vCdFiles, 5 );\r
 +\r
 +      fprintf ( fMakefile, ".PHONY: %s\n\n",\r
 +                module.name.c_str ());\r
 +      fprintf ( fMakefile,\r
 +                "%s: all %s %s %s %s $(CABMAN_TARGET) $(CDMAKE_TARGET)\n",\r
 +                module.name.c_str (),\r
 +                isoboot.c_str (),\r
 +                bootcdReactos.c_str (),\r
 +                cdDirectories.c_str (),\r
 +                cdFiles.c_str () );\r
 +      fprintf ( fMakefile, "\t$(ECHO_CABMAN)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(Q)$(CABMAN_TARGET) -C %s -L %s -I -P $(OUTPUT)\n",\r
 +                reactosDff.c_str (),\r
 +                bootcdReactos.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(Q)$(CABMAN_TARGET) -C %s -RC %s -L %s -N -P $(OUTPUT)\n",\r
 +                reactosDff.c_str (),\r
 +                reactosInf.c_str (),\r
 +                bootcdReactos.c_str ());\r
 +      fprintf ( fMakefile,\r
 +                "\t-@${rm} %s 2>$(NUL)\n",\r
 +                reactosInf.c_str () );\r
 +      OutputBootstrapfileCopyCommands ( bootcdDirectory );\r
 +      OutputCdfileCopyCommands ( bootcdDirectory );\r
 +      fprintf ( fMakefile, "\t$(ECHO_CDMAKE)\n" );\r
 +      fprintf ( fMakefile,\r
 +                "\t$(Q)$(CDMAKE_TARGET) -v -m -b %s %s REACTOS ReactOS.iso\n",\r
 +                isoboot.c_str (),\r
 +                bootcd.c_str () );\r
 +      fprintf ( fMakefile,\r
 +                "\n" );\r
 +}\r
 +\r
 +\r
 +MingwTestModuleHandler::MingwTestModuleHandler (\r
 +      const Module& module_ )\r
 +\r
 +      : MingwModuleHandler ( module_ )\r
 +{\r
 +}\r
 +\r
 +void\r
 +MingwTestModuleHandler::Process ()\r
 +{\r
 +      GenerateTestModuleTarget ();\r
 +}\r
 +\r
 +void\r
 +MingwTestModuleHandler::GenerateTestModuleTarget ()\r
 +{\r
 +      string targetMacro ( GetTargetMacro ( module ) );\r
 +      string workingDirectory = GetWorkingDirectory ( );\r
 +      string objectsMacro = GetObjectsMacro ( module );\r
 +      string linkDepsMacro = GetLinkingDependenciesMacro ();\r
 +      string libsMacro = GetLibsMacro ();\r
 +\r
 +      GenerateImportLibraryTargetIfNeeded ();\r
 +\r
 +      if ( module.non_if_data.files.size () > 0 )\r
 +      {\r
 +              GenerateRules ();\r
 +\r
 +              string dependencies = objectsMacro + " " + linkDepsMacro;\r
 +\r
 +              string linker;\r
 +              if ( module.cplusplus )\r
 +                      linker = "${gpp}";\r
 +              else\r
 +                      linker = "${gcc}";\r
 +\r
 +              string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",\r
 +                                                   module.entrypoint.c_str (),\r
 +                                                   module.baseaddress.c_str () );\r
 +              GenerateLinkerCommand ( dependencies,\r
 +                                      linker,\r
 +                                      linkerParameters,\r
 +                                      objectsMacro,\r
 +                                      libsMacro );\r
 +      }\r
 +      else\r
 +      {\r
 +              GeneratePhonyTarget();\r
 +      }\r
 +}\r
++\r
++\r
++MingwRpcServerModuleHandler::MingwRpcServerModuleHandler (\r
++      const Module& module_ )\r
++\r
++      : MingwModuleHandler ( module_ )\r
++{\r
++}\r
++\r
++void\r
++MingwRpcServerModuleHandler::Process ()\r
++{\r
++      GenerateRules ();\r
++}\r
++\r
++MingwRpcClientModuleHandler::MingwRpcClientModuleHandler (\r
++      const Module& module_ )\r
++\r
++      : MingwModuleHandler ( module_ )\r
++{\r
++}\r
++\r
++void\r
++MingwRpcClientModuleHandler::Process ()\r
++{\r
++      GenerateRules ();\r
++}\r
index 69333ac,0000000..6cb6748
mode 100644,000000..100644
--- /dev/null
@@@ -1,335 -1,0 +1,376 @@@
-                               const std::string& windresflagsMacro );\r
 +#ifndef MINGW_MODULEHANDLER_H\r
 +#define MINGW_MODULEHANDLER_H\r
 +\r
 +#include "../backend.h"\r
 +#include "mingw.h"\r
 +\r
 +class MingwBackend;\r
 +\r
 +extern std::string\r
 +GetTargetMacro ( const Module&, bool with_dollar = true );\r
 +\r
 +extern std::string\r
 +PrefixFilename (\r
 +      const std::string& filename,\r
 +      const std::string& prefix );\r
 +\r
 +class MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwModuleHandler ( const Module& module_ );\r
 +      virtual ~MingwModuleHandler();\r
 +\r
 +      static void SetBackend ( MingwBackend* backend_ );\r
 +      static void SetMakefile ( FILE* f );\r
 +      static void SetUsePch ( bool use_pch );\r
 +\r
 +      static std::string PassThruCacheDirectory (\r
 +              const std::string &f,\r
 +              Directory* directoryTree );\r
 +\r
 +      static std::string GetTargetFilename (\r
 +              const Module& module,\r
 +              string_list* pclean_files );\r
 +\r
 +      static std::string\r
 +      GetImportLibraryFilename (\r
 +              const Module& module,\r
 +              string_list* pclean_files );\r
 +\r
 +      std::string GetModuleTargets ( const Module& module );\r
 +      void GenerateObjectMacro();\r
 +      void GenerateTargetMacro();\r
 +      void GenerateOtherMacros();\r
 +\r
 +      static MingwModuleHandler* InstanciateHandler ( const Module& module_,\r
 +                                                      MingwBackend* backend_ );\r
 +      virtual HostType DefaultHost() = 0;\r
 +      void GeneratePreconditionDependencies ();\r
 +      virtual void Process () = 0;\r
 +      virtual std::string TypeSpecificCFlags() { return ""; }\r
 +      virtual std::string TypeSpecificNasmFlags() { return ""; }\r
 +      void GenerateInvocations () const;\r
 +      void GenerateCleanTarget () const;\r
++      static bool ReferenceObjects ( const Module& module );\r
 +protected:\r
 +      std::string GetWorkingDirectory () const;\r
 +      std::string GetBasename ( const std::string& filename ) const;\r
 +      std::string GetActualSourceFilename ( const std::string& filename ) const;\r
 +      std::string GetModuleArchiveFilename () const;\r
 +      bool IsGeneratedFile ( const File& file ) const;\r
 +      std::string GetImportLibraryDependency ( const Module& importedModule );\r
++      void GetTargets ( const Module& dependencyModule,\r
++                        string_list& targets );\r
 +      void GetModuleDependencies ( string_list& dependencies );\r
 +      std::string GetAllDependencies () const;\r
 +      void GetSourceFilenames ( string_list& list, bool includeGeneratedFiles = true ) const;\r
 +      void GetSourceFilenamesWithoutGeneratedFiles ( string_list& list ) const;\r
 +      std::string GetObjectFilename ( const std::string& sourceFilename,\r
 +                                      string_list* pclean_files ) const;\r
 +\r
 +      std::string GetObjectFilenames ();\r
 +      \r
 +      std::string GetPreconditionDependenciesName () const;\r
 +      std::string GetCFlagsMacro () const;\r
 +      static std::string GetObjectsMacro ( const Module& );\r
 +      std::string GetLinkingDependenciesMacro () const;\r
 +      std::string GetLibsMacro () const;\r
 +      std::string GetLinkerMacro () const;\r
 +      void GenerateLinkerCommand ( const std::string& dependencies,\r
 +                                   const std::string& linker,\r
 +                                   const std::string& linkerParameters,\r
 +                                   const std::string& objectsMacro,\r
 +                                   const std::string& libsMacro );\r
 +      void GeneratePhonyTarget() const;\r
 +      void GenerateRules ();\r
 +      void GenerateImportLibraryTargetIfNeeded ();\r
 +      void GetDefinitionDependencies ( string_list& dependencies ) const;\r
 +      std::string GetLinkingDependencies () const;\r
 +      static MingwBackend* backend;\r
 +      static FILE* fMakefile;\r
 +      static bool use_pch;\r
 +private:\r
 +      std::string ConcatenatePaths ( const std::string& path1,\r
 +                                     const std::string& path2 ) const;\r
 +      std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const;\r
 +      std::string GenerateGccDefineParameters () const;\r
 +      std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;\r
 +      std::string GenerateCompilerParametersFromVector ( const std::vector<CompilerFlag*>& compilerFlags ) const;\r
 +      std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;\r
 +      std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries );\r
 +      std::string GenerateLinkerParameters () const;\r
 +      void GenerateMacro ( const char* assignmentOperation,\r
 +                           const std::string& macro,\r
 +                           const IfableData& data,\r
 +                           const std::vector<CompilerFlag*>* compilerFlags );\r
 +      void GenerateMacros ( const char* op,\r
 +                            const IfableData& data,\r
 +                            const std::vector<CompilerFlag*>* compilerFlags,\r
 +                            const std::vector<LinkerFlag*>* linkerFlags );\r
 +      void GenerateObjectMacros ( const char* assignmentOperation,\r
 +                                  const IfableData& data,\r
 +                                  const std::vector<CompilerFlag*>* compilerFlags,\r
 +                                  const std::vector<LinkerFlag*>* linkerFlags );\r
 +      std::string GenerateGccIncludeParameters () const;\r
 +      std::string GenerateGccParameters () const;\r
 +      std::string GenerateNasmParameters () const;\r
 +      void GenerateGccCommand ( const std::string& sourceFilename,\r
 +                                const std::string& cc,\r
 +                                const std::string& cflagsMacro );\r
 +      void GenerateGccAssemblerCommand ( const std::string& sourceFilename,\r
 +                                         const std::string& cc,\r
 +                                         const std::string& cflagsMacro );\r
 +      void GenerateNasmCommand ( const std::string& sourceFilename,\r
 +                                 const std::string& nasmflagsMacro );\r
 +      void GenerateWindresCommand ( const std::string& sourceFilename,\r
 +                                    const std::string& windresflagsMacro );\r
 +      void GenerateWinebuildCommands ( const std::string& sourceFilename );\r
++      void GenerateWidlCommandsServer (\r
++              const std::string& sourceFilename,\r
++              const std::string& widlflagsMacro );\r
++      void GenerateWidlCommandsClient (\r
++              const std::string& sourceFilename,\r
++              const std::string& widlflagsMacro );\r
++      void GenerateWidlCommands ( const std::string& sourceFilename,\r
++                                  const std::string& widlflagsMacro );\r
 +      void GenerateCommands ( const std::string& sourceFilename,\r
 +                              const std::string& cc,\r
 +                              const std::string& cppc,\r
 +                              const std::string& cflagsMacro,\r
 +                              const std::string& nasmflagsMacro,\r
-                                        const std::string& windresflagsMacro );\r
++                              const std::string& windresflagsMacro,\r
++                              const std::string& widlflagsMacro );\r
 +      void GenerateObjectFileTargets ( const IfableData& data,\r
 +                                       const std::string& cc,\r
 +                                       const std::string& cppc,\r
 +                                       const std::string& cflagsMacro,\r
 +                                       const std::string& nasmflagsMacro,\r
-                                        const std::string& windresflagsMacro );\r
++                                       const std::string& windresflagsMacro,\r
++                                       const std::string& widlflagsMacro );\r
 +      void GenerateObjectFileTargets ( const std::string& cc,\r
 +                                       const std::string& cppc,\r
 +                                       const std::string& cflagsMacro,\r
 +                                       const std::string& nasmflagsMacro,\r
-       std::string cflagsMacro, nasmflagsMacro, windresflagsMacro,\r
-               linkerflagsMacro, objectsMacro, libsMacro, linkDepsMacro;\r
++                                       const std::string& windresflagsMacro,\r
++                                       const std::string& widlflagsMacro );\r
 +      std::string GenerateArchiveTarget ( const std::string& ar,\r
 +                                          const std::string& objs_macro ) const;\r
 +      void GetSpecObjectDependencies ( string_list& dependencies,\r
 +                                       const std::string& filename ) const;\r
++      void GetWidlObjectDependencies ( string_list& dependencies,\r
++                                       const std::string& filename ) const;\r
 +      void GetDefaultDependencies ( string_list& dependencies ) const;\r
 +      void GetInvocationDependencies ( const Module& module, string_list& dependencies );\r
 +      bool IsWineModule () const;\r
 +      std::string GetDefinitionFilename () const;\r
 +      static std::string RemoveVariables ( std::string path);\r
 +      void GenerateBuildMapCode ();\r
 +public:\r
 +      const Module& module;\r
 +      string_list clean_files;\r
++      std::string cflagsMacro;\r
++      std::string nasmflagsMacro;\r
++      std::string windresflagsMacro;\r
++      std::string widlflagsMacro;\r
++      std::string linkerflagsMacro;\r
++      std::string objectsMacro;\r
++      std::string libsMacro;\r
++      std::string linkDepsMacro;\r
 +};\r
 +\r
 +\r
 +class MingwBuildToolModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwBuildToolModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostTrue; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateBuildToolModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwKernelModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwKernelModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateKernelModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwStaticLibraryModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwStaticLibraryModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateStaticLibraryModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwObjectLibraryModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwObjectLibraryModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateObjectLibraryModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwKernelModeDLLModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwKernelModeDLLModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateKernelModeDLLModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwKernelModeDriverModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwKernelModeDriverModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +      std::string TypeSpecificCFlags() { return "-D__NTDRIVER__"; }\r
 +private:\r
 +      void GenerateKernelModeDriverModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwNativeDLLModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwNativeDLLModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateNativeDLLModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwNativeCUIModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwNativeCUIModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +      std::string TypeSpecificCFlags() { return "-D__NTAPP__"; }\r
 +private:\r
 +      void GenerateNativeCUIModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwWin32DLLModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwWin32DLLModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateExtractWineDLLResourcesTarget ();\r
 +      void GenerateWin32DLLModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwWin32CUIModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwWin32CUIModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateWin32CUIModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwWin32GUIModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwWin32GUIModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateWin32GUIModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwBootLoaderModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwBootLoaderModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateBootLoaderModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwBootSectorModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwBootSectorModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +      std::string TypeSpecificNasmFlags() { return "-f bin"; }\r
 +private:\r
 +      void GenerateBootSectorModuleTarget ();\r
 +};\r
 +\r
 +\r
 +class MingwIsoModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwIsoModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateIsoModuleTarget ();\r
 +      std::string GetBootstrapCdDirectories ( const std::string& bootcdDirectory );\r
 +      std::string GetNonModuleCdDirectories ( const std::string& bootcdDirectory );\r
 +      std::string GetCdDirectories ( const std::string& bootcdDirectory );\r
 +      void GetBootstrapCdFiles ( std::vector<std::string>& out ) const;\r
 +      void GetNonModuleCdFiles ( std::vector<std::string>& out ) const;\r
 +      void GetCdFiles ( std::vector<std::string>& out ) const;\r
 +      void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory );\r
 +      void OutputCdfileCopyCommands ( const std::string& bootcdDirectory );\r
 +};\r
 +\r
++\r
 +class MingwTestModuleHandler : public MingwModuleHandler\r
 +{\r
 +public:\r
 +      MingwTestModuleHandler ( const Module& module );\r
 +      virtual HostType DefaultHost() { return HostFalse; }\r
 +      virtual void Process ();\r
 +private:\r
 +      void GenerateTestModuleTarget ();\r
 +};\r
 +\r
++\r
++class MingwRpcServerModuleHandler : public MingwModuleHandler\r
++{\r
++public:\r
++      MingwRpcServerModuleHandler ( const Module& module );\r
++      virtual HostType DefaultHost() { return HostFalse; }\r
++      virtual void Process ();\r
++};\r
++\r
++\r
++class MingwRpcClientModuleHandler : public MingwModuleHandler\r
++{\r
++public:\r
++      MingwRpcClientModuleHandler ( const Module& module );\r
++      virtual HostType DefaultHost() { return HostFalse; }\r
++      virtual void Process ();\r
++};\r
++\r
 +#endif /* MINGW_MODULEHANDLER_H */\r
index c4d9842,0000000..cf3639f
mode 100644,000000..100644
--- /dev/null
@@@ -1,75 -1,0 +1,77 @@@
 +#include "pch.h"\r
 +#include <assert.h>\r
 +\r
 +#include "rbuild.h"\r
 +\r
 +using std::string;\r
 +\r
 +Bootstrap::Bootstrap ( const Project& project_,\r
 +                         const Module* module_,\r
 +                         const XMLElement& bootstrapNode )\r
 +      : project(project_),\r
 +        module(module_),\r
 +        node(bootstrapNode)\r
 +{\r
 +      Initialize();\r
 +}\r
 +\r
 +Bootstrap::~Bootstrap ()\r
 +{\r
 +}\r
 +\r
 +bool\r
 +Bootstrap::IsSupportedModuleType ( ModuleType type )\r
 +{\r
 +      switch ( type )\r
 +      {\r
 +              case Kernel:\r
 +              case KernelModeDLL:\r
 +              case NativeDLL:\r
 +              case NativeCUI:\r
 +              case Win32DLL:\r
 +              case Win32CUI:\r
 +              case Win32GUI:\r
 +              case KernelModeDriver:\r
 +              case BootSector:\r
 +              case BootLoader:\r
 +                      return true;\r
 +              case BuildTool:\r
 +              case StaticLibrary:\r
 +              case ObjectLibrary:\r
 +              case Iso:\r
 +              case Test:\r
++              case RpcServer:\r
++              case RpcClient:\r
 +                      return false;\r
 +      }\r
 +      throw InvalidOperationException ( __FILE__,\r
 +                                        __LINE__ );\r
 +}\r
 +\r
 +void\r
 +Bootstrap::Initialize ()\r
 +{\r
 +      if ( !IsSupportedModuleType ( module->type ) )\r
 +      {\r
 +              throw InvalidBuildFileException (\r
 +                      node.location,\r
 +                      "<bootstrap> is not applicable for this module type." );\r
 +      }\r
 +\r
 +      const XMLAttribute* att = node.GetAttribute ( "base", false );\r
 +      if ( att != NULL )\r
 +              base = att->value;\r
 +      else\r
 +              base = "";\r
 +\r
 +      att = node.GetAttribute ( "nameoncd", false );\r
 +      if ( att != NULL )\r
 +              nameoncd = att->value;\r
 +      else\r
 +              nameoncd = module->GetTargetName ();\r
 +}\r
 +\r
 +void\r
 +Bootstrap::ProcessXML()\r
 +{\r
 +}\r
index 8567a76,0000000..8bfd035
mode 100644,000000..100644
--- /dev/null
@@@ -1,945 -1,0 +1,948 @@@
- void\r
- Module::GetTargets ( string_list& targets ) const\r
- {\r
-       if ( invocations.size () > 0 )\r
-       {\r
-               for ( size_t i = 0; i < invocations.size (); i++ )\r
-               {\r
-                       Invoke& invoke = *invocations[i];\r
-                       invoke.GetTargets ( targets );\r
-               }\r
-       }\r
-       else\r
-               targets.push_back ( GetPath () );\r
- }\r
\r
 +#include "pch.h"\r
 +#include <assert.h>\r
 +\r
 +#include "rbuild.h"\r
 +\r
 +using std::string;\r
 +using std::vector;\r
 +\r
 +string\r
 +FixSeparator ( const string& s )\r
 +{\r
 +      string s2(s);\r
 +      char* p = strchr ( &s2[0], CBAD_SEP );\r
 +      while ( p )\r
 +      {\r
 +              *p++ = CSEP;\r
 +              p = strchr ( p, CBAD_SEP );\r
 +      }\r
 +      return s2;\r
 +}\r
 +\r
 +string\r
 +ReplaceExtension (\r
 +      const string& filename,\r
 +      const string& newExtension )\r
 +{\r
 +      size_t index = filename.find_last_of ( '/' );\r
 +      if ( index == string::npos )\r
 +              index = 0;\r
 +      size_t index2 = filename.find_last_of ( '\\' );\r
 +      if ( index2 != string::npos && index2 > index )\r
 +              index = index2;\r
 +      string tmp = filename.substr( index /*, filename.size() - index*/ );\r
 +      size_t ext_index = tmp.find_last_of( '.' );\r
 +      if ( ext_index != string::npos )\r
 +              return filename.substr ( 0, index + ext_index ) + newExtension;\r
 +      return filename + newExtension;\r
 +}\r
 +\r
 +string\r
 +GetSubPath (\r
 +      const string& location,\r
 +      const string& path,\r
 +      const string& att_value )\r
 +{\r
 +      if ( !att_value.size() )\r
 +              throw InvalidBuildFileException (\r
 +                      location,\r
 +                      "<directory> tag has empty 'name' attribute" );\r
 +      if ( strpbrk ( att_value.c_str (), "/\\?*:<>|" ) )\r
 +              throw InvalidBuildFileException (\r
 +                      location,\r
 +                      "<directory> tag has invalid characters in 'name' attribute" );\r
 +      if ( !path.size() )\r
 +              return att_value;\r
 +      return FixSeparator(path + CSEP + att_value);\r
 +}\r
 +\r
 +string\r
 +GetExtension ( const string& filename )\r
 +{\r
 +      size_t index = filename.find_last_of ( '/' );\r
 +      if (index == string::npos) index = 0;\r
 +      string tmp = filename.substr( index, filename.size() - index );\r
 +      size_t ext_index = tmp.find_last_of( '.' );\r
 +      if (ext_index != string::npos) \r
 +              return filename.substr ( index + ext_index, filename.size() );\r
 +      return "";\r
 +}\r
 +\r
 +string\r
 +GetDirectory ( const string& filename )\r
 +{\r
 +      size_t index = filename.find_last_of ( CSEP );\r
 +      if ( index == string::npos )\r
 +              return filename;\r
 +      else\r
 +              return filename.substr ( 0, index );\r
 +}\r
 +\r
 +string\r
 +NormalizeFilename ( const string& filename )\r
 +{\r
 +      Path path;\r
 +      string normalizedPath = path.Fixup ( filename, true );\r
 +      string relativeNormalizedPath = path.RelativeFromWorkingDirectory ( normalizedPath );\r
 +      return FixSeparator ( relativeNormalizedPath );\r
 +}\r
 +\r
 +IfableData::~IfableData()\r
 +{\r
 +      size_t i;\r
 +      for ( i = 0; i < files.size(); i++ )\r
 +              delete files[i];\r
 +      for ( i = 0; i < includes.size(); i++ )\r
 +              delete includes[i];\r
 +      for ( i = 0; i < defines.size(); i++ )\r
 +              delete defines[i];\r
 +      for ( i = 0; i < libraries.size(); i++ )\r
 +              delete libraries[i];\r
 +      for ( i = 0; i < properties.size(); i++ )\r
 +              delete properties[i];\r
 +      for ( i = 0; i < ifs.size(); i++ )\r
 +              delete ifs[i];\r
 +}\r
 +\r
 +void IfableData::ProcessXML ()\r
 +{\r
 +      size_t i;\r
 +      for ( i = 0; i < files.size (); i++ )\r
 +              files[i]->ProcessXML ();\r
 +      for ( i = 0; i < includes.size (); i++ )\r
 +              includes[i]->ProcessXML ();\r
 +      for ( i = 0; i < defines.size (); i++ )\r
 +              defines[i]->ProcessXML ();\r
 +      for ( i = 0; i < libraries.size (); i++ )\r
 +              libraries[i]->ProcessXML ();\r
 +      for ( i = 0; i < properties.size(); i++ )\r
 +              properties[i]->ProcessXML ();\r
 +      for ( i = 0; i < ifs.size (); i++ )\r
 +              ifs[i]->ProcessXML ();\r
 +}\r
 +\r
 +Module::Module ( const Project& project,\r
 +                 const XMLElement& moduleNode,\r
 +                 const string& modulePath )\r
 +      : project (project),\r
 +        node (moduleNode),\r
 +        importLibrary (NULL),\r
 +        bootstrap (NULL),\r
 +        pch (NULL),\r
 +        cplusplus (false),\r
 +        host (HostDefault)\r
 +{\r
 +      if ( node.name != "module" )\r
 +              throw InvalidOperationException ( __FILE__,\r
 +                                                __LINE__,\r
 +                                                "Module created with non-<module> node" );\r
 +\r
 +      path = FixSeparator ( modulePath );\r
 +\r
 +      const XMLAttribute* att = moduleNode.GetAttribute ( "name", true );\r
 +      assert(att);\r
 +      name = att->value;\r
 +\r
 +      att = moduleNode.GetAttribute ( "type", true );\r
 +      assert(att);\r
 +      type = GetModuleType ( node.location, *att );\r
 +\r
 +      att = moduleNode.GetAttribute ( "extension", false );\r
 +      if ( att != NULL )\r
 +              extension = att->value;\r
 +      else\r
 +              extension = GetDefaultModuleExtension ();\r
 +\r
 +      att = moduleNode.GetAttribute ( "entrypoint", false );\r
 +      if ( att != NULL )\r
 +              entrypoint = att->value;\r
 +      else\r
 +              entrypoint = GetDefaultModuleEntrypoint ();\r
 +\r
 +      att = moduleNode.GetAttribute ( "baseaddress", false );\r
 +      if ( att != NULL )\r
 +              baseaddress = att->value;\r
 +      else\r
 +              baseaddress = GetDefaultModuleBaseaddress ();\r
 +\r
 +      att = moduleNode.GetAttribute ( "mangledsymbols", false );\r
 +      if ( att != NULL )\r
 +      {\r
 +              const char* p = att->value.c_str();\r
 +              if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )\r
 +                      mangledSymbols = true;\r
 +              else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )\r
 +                      mangledSymbols = false;\r
 +              else\r
 +              {\r
 +                      throw InvalidAttributeValueException (\r
 +                              moduleNode.location,\r
 +                              "mangledsymbols",\r
 +                              att->value );\r
 +              }\r
 +      }\r
 +      else\r
 +              mangledSymbols = false;\r
 +\r
 +      att = moduleNode.GetAttribute ( "host", false );\r
 +      if ( att != NULL )\r
 +      {\r
 +              const char* p = att->value.c_str();\r
 +              if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )\r
 +                      host = HostTrue;\r
 +              else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )\r
 +                      host = HostFalse;\r
 +              else\r
 +              {\r
 +                      throw InvalidAttributeValueException (\r
 +                              moduleNode.location,\r
 +                              "host",\r
 +                              att->value );\r
 +              }\r
 +      }\r
 +\r
 +      att = moduleNode.GetAttribute ( "prefix", false );\r
 +      if ( att != NULL )\r
 +              prefix = att->value;\r
 +\r
 +      att = moduleNode.GetAttribute ( "installbase", false );\r
 +      if ( att != NULL )\r
 +              installBase = att->value;\r
 +      else\r
 +              installBase = "";\r
 +\r
 +      att = moduleNode.GetAttribute ( "installname", false );\r
 +      if ( att != NULL )\r
 +              installName = att->value;\r
 +      else\r
 +              installName = "";\r
++      \r
++      att = moduleNode.GetAttribute ( "usewrc", false );\r
++      if ( att != NULL )\r
++              useWRC = att->value == "true";\r
++      else\r
++              useWRC = true;\r
 +}\r
 +\r
 +Module::~Module ()\r
 +{\r
 +      size_t i;\r
 +      for ( i = 0; i < invocations.size(); i++ )\r
 +              delete invocations[i];\r
 +      for ( i = 0; i < dependencies.size(); i++ )\r
 +              delete dependencies[i];\r
 +      for ( i = 0; i < compilerFlags.size(); i++ )\r
 +              delete compilerFlags[i];\r
 +      for ( i = 0; i < linkerFlags.size(); i++ )\r
 +              delete linkerFlags[i];\r
 +      for ( i = 0; i < stubbedComponents.size(); i++ )\r
 +              delete stubbedComponents[i];\r
 +      if ( pch )\r
 +              delete pch;\r
 +}\r
 +\r
 +void\r
 +Module::ProcessXML()\r
 +{\r
 +      size_t i;\r
 +      for ( i = 0; i < node.subElements.size(); i++ )\r
 +              ProcessXMLSubElement ( *node.subElements[i], path );\r
 +      for ( i = 0; i < invocations.size(); i++ )\r
 +              invocations[i]->ProcessXML ();\r
 +      for ( i = 0; i < dependencies.size(); i++ )\r
 +              dependencies[i]->ProcessXML ();\r
 +      for ( i = 0; i < compilerFlags.size(); i++ )\r
 +              compilerFlags[i]->ProcessXML();\r
 +      for ( i = 0; i < linkerFlags.size(); i++ )\r
 +              linkerFlags[i]->ProcessXML();\r
 +      for ( i = 0; i < stubbedComponents.size(); i++ )\r
 +              stubbedComponents[i]->ProcessXML();\r
 +      non_if_data.ProcessXML();\r
 +      if ( pch )\r
 +              pch->ProcessXML();\r
 +}\r
 +\r
 +void\r
 +Module::ProcessXMLSubElement ( const XMLElement& e,\r
 +                               const string& path,\r
 +                               If* pIf /*= NULL*/ )\r
 +{\r
 +      bool subs_invalid = false;\r
 +      string subpath ( path );\r
 +      if ( e.name == "file" && e.value.size () > 0 )\r
 +      {\r
 +              bool first = false;\r
 +              const XMLAttribute* att = e.GetAttribute ( "first", false );\r
 +              if ( att )\r
 +              {\r
 +                      if ( !stricmp ( att->value.c_str(), "true" ) )\r
 +                              first = true;\r
 +                      else if ( stricmp ( att->value.c_str(), "false" ) )\r
 +                              throw InvalidBuildFileException (\r
 +                                      e.location,\r
 +                                      "attribute 'first' of <file> element can only be 'true' or 'false'" );\r
 +              }\r
 +              if ( !cplusplus )\r
 +              {\r
 +                      // check for c++ file\r
 +                      string ext = GetExtension ( e.value );\r
 +                      if ( !stricmp ( ext.c_str(), ".cpp" ) )\r
 +                              cplusplus = true;\r
 +                      else if ( !stricmp ( ext.c_str(), ".cc" ) )\r
 +                              cplusplus = true;\r
 +                      else if ( !stricmp ( ext.c_str(), ".cxx" ) )\r
 +                              cplusplus = true;\r
 +              }\r
 +              File* pFile = new File ( FixSeparator ( path + CSEP + e.value ), first );\r
 +              if ( pIf )\r
 +                      pIf->data.files.push_back ( pFile );\r
 +              else\r
 +                      non_if_data.files.push_back ( pFile );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "library" && e.value.size () )\r
 +      {\r
 +              Library* pLibrary = new Library ( e, *this, e.value );\r
 +              if ( pIf )\r
 +                      pIf->data.libraries.push_back ( pLibrary );\r
 +              else\r
 +                      non_if_data.libraries.push_back ( pLibrary );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "directory" )\r
 +      {\r
 +              const XMLAttribute* att = e.GetAttribute ( "name", true );\r
 +              assert(att);\r
 +              subpath = GetSubPath ( e.location, path, att->value );\r
 +      }\r
 +      else if ( e.name == "include" )\r
 +      {\r
 +              Include* include = new Include ( project, this, e );\r
 +              if ( pIf )\r
 +                      pIf->data.includes.push_back ( include );\r
 +              else\r
 +                      non_if_data.includes.push_back ( include );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "define" )\r
 +      {\r
 +              Define* pDefine = new Define ( project, this, e );\r
 +              if ( pIf )\r
 +                      pIf->data.defines.push_back ( pDefine );\r
 +              else\r
 +                      non_if_data.defines.push_back ( pDefine );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "invoke" )\r
 +      {\r
 +              if ( pIf )\r
 +                      throw InvalidBuildFileException (\r
 +                              e.location,\r
 +                              "<invoke> is not a valid sub-element of <if>" );\r
 +              invocations.push_back ( new Invoke ( e, *this ) );\r
 +              subs_invalid = false;\r
 +      }\r
 +      else if ( e.name == "dependency" )\r
 +      {\r
 +              if ( pIf )\r
 +                      throw InvalidBuildFileException (\r
 +                              e.location,\r
 +                              "<dependency> is not a valid sub-element of <if>" );\r
 +              dependencies.push_back ( new Dependency ( e, *this ) );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "importlibrary" )\r
 +      {\r
 +              if ( pIf )\r
 +                      throw InvalidBuildFileException (\r
 +                              e.location,\r
 +                              "<importlibrary> is not a valid sub-element of <if>" );\r
 +              if ( importLibrary )\r
 +                      throw InvalidBuildFileException (\r
 +                              e.location,\r
 +                              "Only one <importlibrary> is valid per module" );\r
 +              importLibrary = new ImportLibrary ( e, *this );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "if" )\r
 +      {\r
 +              If* pOldIf = pIf;\r
 +              pIf = new If ( e, project, this );\r
 +              if ( pOldIf )\r
 +                      pOldIf->data.ifs.push_back ( pIf );\r
 +              else\r
 +                      non_if_data.ifs.push_back ( pIf );\r
 +              subs_invalid = false;\r
 +      }\r
 +      else if ( e.name == "compilerflag" )\r
 +      {\r
 +              compilerFlags.push_back ( new CompilerFlag ( project, this, e ) );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "linkerflag" )\r
 +      {\r
 +              linkerFlags.push_back ( new LinkerFlag ( project, this, e ) );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "component" )\r
 +      {\r
 +              stubbedComponents.push_back ( new StubbedComponent ( this, e ) );\r
 +              subs_invalid = false;\r
 +      }\r
 +      else if ( e.name == "property" )\r
 +      {\r
 +              throw InvalidBuildFileException (\r
 +                      e.location,\r
 +                      "<property> is not a valid sub-element of <module>" );\r
 +      }\r
 +      else if ( e.name == "bootstrap" )\r
 +      {\r
 +              bootstrap = new Bootstrap ( project, this, e );\r
 +              subs_invalid = true;\r
 +      }\r
 +      else if ( e.name == "pch" )\r
 +      {\r
 +              if ( pIf )\r
 +                      throw InvalidBuildFileException (\r
 +                              e.location,\r
 +                              "<pch> is not a valid sub-element of <if>" );\r
 +              if ( pch )\r
 +                      throw InvalidBuildFileException (\r
 +                              e.location,\r
 +                              "Only one <pch> is valid per module" );\r
 +              pch = new PchFile (\r
 +                      e, *this, FixSeparator ( path + CSEP + e.value ) );\r
 +              subs_invalid = true;\r
 +      }\r
 +      if ( subs_invalid && e.subElements.size() > 0 )\r
 +              throw InvalidBuildFileException (\r
 +                      e.location,\r
 +                      "<%s> cannot have sub-elements",\r
 +                      e.name.c_str() );\r
 +      for ( size_t i = 0; i < e.subElements.size (); i++ )\r
 +              ProcessXMLSubElement ( *e.subElements[i], subpath, pIf );\r
 +}\r
 +\r
 +ModuleType\r
 +Module::GetModuleType ( const string& location, const XMLAttribute& attribute )\r
 +{\r
 +      if ( attribute.value == "buildtool" )\r
 +              return BuildTool;\r
 +      if ( attribute.value == "staticlibrary" )\r
 +              return StaticLibrary;\r
 +      if ( attribute.value == "objectlibrary" )\r
 +              return ObjectLibrary;\r
 +      if ( attribute.value == "kernel" )\r
 +              return Kernel;\r
 +      if ( attribute.value == "kernelmodedll" )\r
 +              return KernelModeDLL;\r
 +      if ( attribute.value == "kernelmodedriver" )\r
 +              return KernelModeDriver;\r
 +      if ( attribute.value == "nativedll" )\r
 +              return NativeDLL;\r
 +      if ( attribute.value == "nativecui" )\r
 +              return NativeCUI;\r
 +      if ( attribute.value == "win32dll" )\r
 +              return Win32DLL;\r
 +      if ( attribute.value == "win32cui" )\r
 +              return Win32CUI;\r
 +      if ( attribute.value == "win32gui" )\r
 +              return Win32GUI;\r
 +      if ( attribute.value == "bootloader" )\r
 +              return BootLoader;\r
 +      if ( attribute.value == "bootsector" )\r
 +              return BootSector;\r
 +      if ( attribute.value == "iso" )\r
 +              return Iso;\r
 +      if ( attribute.value == "test" )\r
 +              return Test;\r
++      if ( attribute.value == "rpcserver" )\r
++              return RpcServer;\r
++      if ( attribute.value == "rpcclient" )\r
++              return RpcClient;\r
 +      throw InvalidAttributeValueException ( location,\r
 +                                             attribute.name,\r
 +                                             attribute.value );\r
 +}\r
 +\r
 +string\r
 +Module::GetDefaultModuleExtension () const\r
 +{\r
 +      switch (type)\r
 +      {\r
 +              case BuildTool:\r
 +                      return EXEPOSTFIX;\r
 +              case StaticLibrary:\r
 +                      return ".a";\r
 +              case ObjectLibrary:\r
 +                      return ".o";\r
 +              case Kernel:\r
 +              case NativeCUI:\r
 +              case Win32CUI:\r
 +              case Win32GUI:\r
 +                      return ".exe";\r
 +              case KernelModeDLL:\r
 +              case NativeDLL:\r
 +              case Win32DLL:\r
 +                      return ".dll";\r
 +              case KernelModeDriver:\r
 +              case BootLoader:\r
 +                      return ".sys";\r
 +              case BootSector:\r
 +                      return ".o";\r
 +              case Iso:\r
 +                      return ".iso";\r
 +              case Test:\r
 +                      return ".exe";\r
++              case RpcServer:\r
++                      return ".o";\r
++              case RpcClient:\r
++                      return ".o";\r
 +      }\r
 +      throw InvalidOperationException ( __FILE__,\r
 +                                        __LINE__ );\r
 +}\r
 +\r
 +string\r
 +Module::GetDefaultModuleEntrypoint () const\r
 +{\r
 +      switch (type)\r
 +      {\r
 +              case Kernel:\r
 +                      return "_NtProcessStartup";\r
 +              case KernelModeDLL:\r
 +                      return "_DriverEntry@8";\r
 +              case NativeDLL:\r
 +                      return "_DllMainCRTStartup@12";\r
 +              case NativeCUI:\r
 +                      return "_NtProcessStartup@4";\r
 +              case Win32DLL:\r
 +                      return "_DllMain@12";\r
 +              case Win32CUI:\r
 +              case Test:\r
 +                      return "_mainCRTStartup";\r
 +              case Win32GUI:\r
 +                      return "_WinMainCRTStartup";\r
 +              case KernelModeDriver:\r
 +                      return "_DriverEntry@8";\r
 +              case BuildTool:\r
 +              case StaticLibrary:\r
 +              case ObjectLibrary:\r
 +              case BootLoader:\r
 +              case BootSector:\r
 +              case Iso:\r
++              case RpcServer:\r
++              case RpcClient:\r
 +                      return "";\r
 +      }\r
 +      throw InvalidOperationException ( __FILE__,\r
 +                                        __LINE__ );\r
 +}\r
 +\r
 +string\r
 +Module::GetDefaultModuleBaseaddress () const\r
 +{\r
 +      switch (type)\r
 +      {\r
 +              case Kernel:\r
 +                      return "0xc0000000";\r
 +              case KernelModeDLL:\r
 +                      return "0x10000";\r
 +              case NativeDLL:\r
 +                      return "0x10000";\r
 +              case NativeCUI:\r
 +                      return "0x10000";\r
 +              case Win32DLL:\r
 +                      return "0x10000";\r
 +              case Win32CUI:\r
 +              case Test:\r
 +                      return "0x00400000";\r
 +              case Win32GUI:\r
 +                      return "0x00400000";\r
 +              case KernelModeDriver:\r
 +                      return "0x10000";\r
 +              case BuildTool:\r
 +              case StaticLibrary:\r
 +              case ObjectLibrary:\r
 +              case BootLoader:\r
 +              case BootSector:\r
 +              case Iso:\r
++              case RpcServer:\r
++              case RpcClient:\r
 +                      return "";\r
 +      }\r
 +      throw InvalidOperationException ( __FILE__,\r
 +                                        __LINE__ );\r
 +}\r
 +\r
 +bool\r
 +Module::HasImportLibrary () const\r
 +{\r
 +      return importLibrary != NULL;\r
 +}\r
 +\r
 +string\r
 +Module::GetTargetName () const\r
 +{\r
 +      return name + extension;\r
 +}\r
 +\r
 +string\r
 +Module::GetDependencyPath () const\r
 +{\r
 +      if ( HasImportLibrary () )\r
 +      {\r
 +              return ReplaceExtension ( GetPath(), ".a" );\r
 +      }\r
 +      else\r
 +              return GetPath();\r
 +}\r
 +\r
 +string\r
 +Module::GetBasePath () const\r
 +{\r
 +      return path;\r
 +}\r
 +\r
 +string\r
 +Module::GetPath () const\r
 +{\r
 +      if ( path.length() > 0 )\r
 +              return path + CSEP + GetTargetName ();\r
 +      else\r
 +              return GetTargetName ();\r
 +}\r
 +\r
 +string\r
 +Module::GetPathWithPrefix ( const string& prefix ) const\r
 +{\r
 +      return path + CSEP + prefix + GetTargetName ();\r
 +}\r
 +\r
 +string\r
 +Module::GetInvocationTarget ( const int index ) const\r
 +{\r
 +      return ssprintf ( "%s_invoke_%d",\r
 +                        name.c_str (),\r
 +                        index );\r
 +}\r
 +\r
 +bool\r
 +Module::HasFileWithExtension (\r
 +      const IfableData& data,\r
 +      const std::string& extension ) const\r
 +{\r
 +      size_t i;\r
 +      for ( i = 0; i < data.files.size (); i++ )\r
 +      {\r
 +              File& file = *data.files[i];\r
 +              string file_ext = GetExtension ( file.name );\r
 +              if ( !stricmp ( file_ext.c_str (), extension.c_str () ) )\r
 +                      return true;\r
 +      }\r
 +      for ( i = 0; i < data.ifs.size (); i++ )\r
 +      {\r
 +              if ( HasFileWithExtension ( data.ifs[i]->data, extension ) )\r
 +                      return true;\r
 +      }\r
 +      return false;\r
 +}\r
 +\r
 +void\r
 +Module::InvokeModule () const\r
 +{\r
 +      for ( size_t i = 0; i < invocations.size (); i++ )\r
 +      {\r
 +              Invoke& invoke = *invocations[i];\r
 +              string command = invoke.invokeModule->GetPath () + " " + invoke.GetParameters ();\r
 +              printf ( "Executing '%s'\n\n", command.c_str () );\r
 +              int exitcode = system ( command.c_str () );\r
 +              if ( exitcode != 0 )\r
 +                      throw InvocationFailedException ( command,\r
 +                                                        exitcode );\r
 +      }\r
 +}\r
 +\r
 +\r
 +File::File ( const string& _name, bool _first )\r
 +      : name(_name), first(_first)\r
 +{\r
 +}\r
 +\r
 +void\r
 +File::ProcessXML()\r
 +{\r
 +}\r
 +\r
 +\r
 +Library::Library ( const XMLElement& _node,\r
 +                   const Module& _module,\r
 +                   const string& _name )\r
 +      : node(_node),\r
 +        module(_module),\r
 +        name(_name),\r
 +        imported_module(_module.project.LocateModule(_name))\r
 +{\r
 +      if ( module.name == name )\r
 +              throw InvalidBuildFileException (\r
 +                      node.location,\r
 +                      "module '%s' cannot link against itself",\r
 +                      name.c_str() );\r
 +      if ( !imported_module )\r
 +              throw InvalidBuildFileException (\r
 +                      node.location,\r
 +                      "module '%s' trying to import non-existant module '%s'",\r
 +                      module.name.c_str(),\r
 +                      name.c_str() );\r
 +}\r
 +\r
 +void\r
 +Library::ProcessXML()\r
 +{\r
 +      if ( !module.project.LocateModule ( name ) )\r
 +              throw InvalidBuildFileException (\r
 +                      node.location,\r
 +                      "module '%s' is trying to link against non-existant module '%s'",\r
 +                      module.name.c_str(),\r
 +                      name.c_str() );\r
 +}\r
 +\r
 +\r
 +Invoke::Invoke ( const XMLElement& _node,\r
 +                 const Module& _module )\r
 +      : node (_node),\r
 +        module (_module)\r
 +{\r
 +}\r
 +\r
 +void\r
 +Invoke::ProcessXML()\r
 +{\r
 +      const XMLAttribute* att = node.GetAttribute ( "module", false );\r
 +      if (att == NULL)\r
 +              invokeModule = &module;\r
 +      else\r
 +      {\r
 +              invokeModule = module.project.LocateModule ( att->value );\r
 +              if ( invokeModule == NULL )\r
 +                      throw InvalidBuildFileException (\r
 +                              node.location,\r
 +                              "module '%s' is trying to invoke non-existant module '%s'",\r
 +                              module.name.c_str(),\r
 +                              att->value.c_str() );\r
 +      }\r
 +\r
 +      for ( size_t i = 0; i < node.subElements.size (); i++ )\r
 +              ProcessXMLSubElement ( *node.subElements[i] );\r
 +}\r
 +\r
 +void\r
 +Invoke::ProcessXMLSubElement ( const XMLElement& e )\r
 +{\r
 +      bool subs_invalid = false;\r
 +      if ( e.name == "input" )\r
 +      {\r
 +              for ( size_t i = 0; i < e.subElements.size (); i++ )\r
 +                      ProcessXMLSubElementInput ( *e.subElements[i] );\r
 +      }\r
 +      else if ( e.name == "output" )\r
 +      {\r
 +              for ( size_t i = 0; i < e.subElements.size (); i++ )\r
 +                      ProcessXMLSubElementOutput ( *e.subElements[i] );\r
 +      }\r
 +      if ( subs_invalid && e.subElements.size() > 0 )\r
 +              throw InvalidBuildFileException ( e.location,\r
 +                                                "<%s> cannot have sub-elements",\r
 +                                                e.name.c_str() );\r
 +}\r
 +\r
 +void\r
 +Invoke::ProcessXMLSubElementInput ( const XMLElement& e )\r
 +{\r
 +      bool subs_invalid = false;\r
 +      if ( e.name == "inputfile" && e.value.size () > 0 )\r
 +      {\r
 +              input.push_back ( new InvokeFile ( e, FixSeparator ( module.path + CSEP + e.value ) ) );\r
 +              subs_invalid = true;\r
 +      }\r
 +      if ( subs_invalid && e.subElements.size() > 0 )\r
 +              throw InvalidBuildFileException ( e.location,\r
 +                                                "<%s> cannot have sub-elements",\r
 +                                                e.name.c_str() );\r
 +}\r
 +\r
 +void\r
 +Invoke::ProcessXMLSubElementOutput ( const XMLElement& e )\r
 +{\r
 +      bool subs_invalid = false;\r
 +      if ( e.name == "outputfile" && e.value.size () > 0 )\r
 +      {\r
 +              output.push_back ( new InvokeFile ( e, FixSeparator ( module.path + CSEP + e.value ) ) );\r
 +              subs_invalid = true;\r
 +      }\r
 +      if ( subs_invalid && e.subElements.size() > 0 )\r
 +              throw InvalidBuildFileException (\r
 +                      e.location,\r
 +                      "<%s> cannot have sub-elements",\r
 +                      e.name.c_str() );\r
 +}\r
 +\r
 +void\r
 +Invoke::GetTargets ( string_list& targets ) const\r
 +{\r
 +      for ( size_t i = 0; i < output.size (); i++ )\r
 +      {\r
 +              InvokeFile& file = *output[i];\r
 +              targets.push_back ( NormalizeFilename ( file.name ) );\r
 +      }\r
 +}\r
 +\r
 +string\r
 +Invoke::GetParameters () const\r
 +{\r
 +      string parameters ( "" );\r
 +      size_t i;\r
 +      for ( i = 0; i < output.size (); i++ )\r
 +      {\r
 +              if ( parameters.length () > 0)\r
 +                      parameters += " ";\r
 +              InvokeFile& invokeFile = *output[i];\r
 +              if ( invokeFile.switches.length () > 0 )\r
 +              {\r
 +                      parameters += invokeFile.switches + " ";\r
 +              }\r
 +              parameters += invokeFile.name;\r
 +      }\r
 +\r
 +      for ( i = 0; i < input.size (); i++ )\r
 +      {\r
 +              if ( parameters.length () > 0 )\r
 +                      parameters += " ";\r
 +              InvokeFile& invokeFile = *input[i];\r
 +              if ( invokeFile.switches.length () > 0 )\r
 +              {\r
 +                      parameters += invokeFile.switches;\r
 +                      parameters += " ";\r
 +              }\r
 +              parameters += invokeFile.name ;\r
 +      }\r
 +\r
 +      return parameters;\r
 +}\r
 +\r
 +\r
 +InvokeFile::InvokeFile ( const XMLElement& _node,\r
 +                         const string& _name )\r
 +      : node (_node),\r
 +      name (_name)\r
 +{\r
 +      const XMLAttribute* att = _node.GetAttribute ( "switches", false );\r
 +      if (att != NULL)\r
 +              switches = att->value;\r
 +      else\r
 +              switches = "";\r
 +}\r
 +\r
 +void\r
 +InvokeFile::ProcessXML()\r
 +{\r
 +}\r
 +\r
 +\r
 +Dependency::Dependency ( const XMLElement& _node,\r
 +                         const Module& _module )\r
 +      : node (_node),\r
 +        module (_module),\r
 +        dependencyModule (NULL)\r
 +{\r
 +}\r
 +\r
 +void\r
 +Dependency::ProcessXML()\r
 +{\r
 +      dependencyModule = module.project.LocateModule ( node.value );\r
 +      if ( dependencyModule == NULL )\r
 +              throw InvalidBuildFileException ( node.location,\r
 +                                                "module '%s' depend on non-existant module '%s'",\r
 +                                                module.name.c_str(),\r
 +                                                node.value.c_str() );\r
 +}\r
 +\r
 +\r
 +ImportLibrary::ImportLibrary ( const XMLElement& _node,\r
 +                               const Module& _module )\r
 +      : node (_node),\r
 +        module (_module)\r
 +{\r
 +      const XMLAttribute* att = _node.GetAttribute ( "basename", false );\r
 +      if (att != NULL)\r
 +              basename = att->value;\r
 +      else\r
 +              basename = module.name;\r
 +\r
 +      att = _node.GetAttribute ( "definition", true );\r
 +      assert (att);\r
 +      definition = FixSeparator(att->value);\r
 +}\r
 +\r
 +\r
 +If::If ( const XMLElement& node_,\r
 +         const Project& project_,\r
 +         const Module* module_ )\r
 +      : node(node_), project(project_), module(module_)\r
 +{\r
 +      const XMLAttribute* att;\r
 +\r
 +      att = node.GetAttribute ( "property", true );\r
 +      assert(att);\r
 +      property = att->value;\r
 +\r
 +      att = node.GetAttribute ( "value", true );\r
 +      assert(att);\r
 +      value = att->value;\r
 +}\r
 +\r
 +If::~If ()\r
 +{\r
 +}\r
 +\r
 +void\r
 +If::ProcessXML()\r
 +{\r
 +}\r
 +\r
 +\r
 +Property::Property ( const XMLElement& node_,\r
 +                     const Project& project_,\r
 +                     const Module* module_ )\r
 +      : node(node_), project(project_), module(module_)\r
 +{\r
 +      const XMLAttribute* att;\r
 +\r
 +      att = node.GetAttribute ( "name", true );\r
 +      assert(att);\r
 +      name = att->value;\r
 +\r
 +      att = node.GetAttribute ( "value", true );\r
 +      assert(att);\r
 +      value = att->value;\r
 +}\r
 +\r
 +void\r
 +Property::ProcessXML()\r
 +{\r
 +}\r
 +\r
 +\r
 +PchFile::PchFile (\r
 +      const XMLElement& node_,\r
 +      const Module& module_,\r
 +      const string& header_ )\r
 +      : node(node_), module(module_), header(header_)\r
 +{\r
 +}\r
 +\r
 +void\r
 +PchFile::ProcessXML()\r
 +{\r
 +}\r
index aa3f185,0000000..b52ff47
mode 100644,000000..100644
--- /dev/null
@@@ -1,610 -1,0 +1,613 @@@
-       Test\r
 +#ifndef __RBUILD_H\r
 +#define __RBUILD_H\r
 +\r
 +#include "pch.h"\r
 +\r
 +#ifdef WIN32\r
 +#include <direct.h>\r
 +#include <io.h>\r
 +#endif/*WIN32*/\r
 +#include <sys/stat.h>\r
 +#include <time.h>\r
 +#ifdef _MSC_VER\r
 +#include <sys/utime.h>\r
 +#else/*_MSC_VER*/\r
 +#include <utime.h>\r
 +#ifdef WIN32\r
 +#include <process.h>\r
 +#endif/*WIN32*/\r
 +#endif/*_MSC_VER*/\r
 +\r
 +#include "ssprintf.h"\r
 +#include "exception.h"\r
 +#include "XML.h"\r
 +\r
 +typedef std::vector<std::string> string_list;\r
 +\r
 +#ifdef WIN32\r
 +#define EXEPREFIX ""\r
 +#define EXEPOSTFIX ".exe"\r
 +#define CSEP '\\'\r
 +#define CBAD_SEP '/'\r
 +#define SSEP "\\"\r
 +#define SBAD_SEP "/"\r
 +#else\r
 +#define EXEPREFIX "./"\r
 +#define EXEPOSTFIX ""\r
 +#define CSEP '/'\r
 +#define CBAD_SEP '\\'\r
 +#define SSEP "/"\r
 +#define SBAD_SEP "\\"\r
 +#endif\r
 +\r
 +class Project;\r
 +class IfableData;\r
 +class Module;\r
 +class Include;\r
 +class Define;\r
 +class File;\r
 +class Library;\r
 +class Invoke;\r
 +class InvokeFile;\r
 +class Dependency;\r
 +class ImportLibrary;\r
 +class If;\r
 +class CompilerFlag;\r
 +class LinkerFlag;\r
 +class Property;\r
 +class AutomaticDependency;\r
 +class Bootstrap;\r
 +class CDFile;\r
 +class InstallFile;\r
 +class PchFile;\r
 +class StubbedComponent;\r
 +class StubbedSymbol;\r
 +\r
 +class SourceFileTest;\r
 +\r
 +class IfableData\r
 +{\r
 +public:\r
 +      std::vector<File*> files;\r
 +      std::vector<Include*> includes;\r
 +      std::vector<Define*> defines;\r
 +      std::vector<Library*> libraries;\r
 +      std::vector<Property*> properties;\r
 +      std::vector<If*> ifs;\r
 +\r
 +      ~IfableData();\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +class Project\r
 +{\r
 +      std::string xmlfile;\r
 +      XMLElement *node, *head;\r
 +public:\r
 +      std::string name;\r
 +      std::string makefile;\r
 +      XMLIncludes xmlbuildfiles;\r
 +      std::vector<Module*> modules;\r
 +      std::vector<LinkerFlag*> linkerFlags;\r
 +      std::vector<CDFile*> cdfiles;\r
 +      std::vector<InstallFile*> installfiles;\r
 +      IfableData non_if_data;\r
 +\r
 +      Project ( const std::string& filename );\r
 +      ~Project ();\r
 +      void WriteConfigurationFile ();\r
 +      void ExecuteInvocations ();\r
 +      void ProcessXML ( const std::string& path );\r
 +      Module* LocateModule ( const std::string& name );\r
 +      const Module* LocateModule ( const std::string& name ) const;\r
 +      std::string GetProjectFilename () const;\r
 +private:\r
 +      const Property* LookupProperty ( const std::string& name ) const;\r
 +      void SetConfigurationOption ( char* s,\r
 +                                    std::string name,\r
 +                                    std::string* alternativeName );\r
 +      void SetConfigurationOption ( char* s,\r
 +                                    std::string name );\r
 +      void WriteIfChanged ( char* outbuf,\r
 +                            std::string filename );\r
 +      void ReadXml ();\r
 +      void ProcessXMLSubElement ( const XMLElement& e,\r
 +                                  const std::string& path,\r
 +                                  If* pIf = NULL );\r
 +\r
 +      // disable copy semantics\r
 +      Project ( const Project& );\r
 +      Project& operator = ( const Project& );\r
 +};\r
 +\r
 +\r
 +enum ModuleType\r
 +{\r
 +      BuildTool,\r
 +      StaticLibrary,\r
 +      ObjectLibrary,\r
 +      Kernel,\r
 +      KernelModeDLL,\r
 +      KernelModeDriver,\r
 +      NativeDLL,\r
 +      NativeCUI,\r
 +      Win32DLL,\r
 +      Win32CUI,\r
 +      Win32GUI,\r
 +      BootLoader,\r
 +      BootSector,\r
 +      Iso,\r
++      Test,\r
++      RpcServer,\r
++      RpcClient\r
 +};\r
 +\r
 +enum HostType\r
 +{\r
 +      HostFalse,\r
 +      HostDefault,\r
 +      HostTrue\r
 +};\r
 +\r
 +class Module\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const XMLElement& node;\r
 +      std::string name;\r
 +      std::string extension;\r
 +      std::string entrypoint;\r
 +      std::string baseaddress;\r
 +      std::string path;\r
 +      ModuleType type;\r
 +      ImportLibrary* importLibrary;\r
 +      bool mangledSymbols;\r
 +      Bootstrap* bootstrap;\r
 +      IfableData non_if_data;\r
 +      std::vector<Invoke*> invocations;\r
 +      std::vector<Dependency*> dependencies;\r
 +      std::vector<CompilerFlag*> compilerFlags;\r
 +      std::vector<LinkerFlag*> linkerFlags;\r
 +      std::vector<StubbedComponent*> stubbedComponents;\r
 +      PchFile* pch;\r
 +      bool cplusplus;\r
 +      std::string prefix;\r
 +      HostType host;\r
 +      std::string installBase;\r
 +      std::string installName;\r
++      bool useWRC;\r
 +\r
 +      Module ( const Project& project,\r
 +               const XMLElement& moduleNode,\r
 +               const std::string& modulePath );\r
 +      ~Module ();\r
 +      ModuleType GetModuleType ( const std::string& location,\r
 +                                 const XMLAttribute& attribute );\r
 +      bool HasImportLibrary () const;\r
 +      std::string GetTargetName () const;\r
 +      std::string GetDependencyPath () const;\r
 +      std::string GetBasePath () const;\r
 +      std::string GetPath () const;\r
 +      std::string GetPathWithPrefix ( const std::string& prefix ) const;\r
 +      void GetTargets ( string_list& ) const;\r
 +      std::string GetInvocationTarget ( const int index ) const;\r
 +      bool HasFileWithExtension ( const IfableData&, const std::string& extension ) const;\r
 +      void InvokeModule () const;\r
 +      void ProcessXML ();\r
 +private:\r
 +      std::string GetDefaultModuleExtension () const;\r
 +      std::string GetDefaultModuleEntrypoint () const;\r
 +      std::string GetDefaultModuleBaseaddress () const;\r
 +      void ProcessXMLSubElement ( const XMLElement& e,\r
 +                                  const std::string& path,\r
 +                                  If* pIf = NULL );\r
 +};\r
 +\r
 +\r
 +class Include\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const Module* module;\r
 +      const XMLElement& node;\r
 +      std::string directory;\r
 +      std::string basePath;\r
 +\r
 +      Include ( const Project& project,\r
 +                const XMLElement& includeNode );\r
 +      Include ( const Project& project,\r
 +                const Module* module,\r
 +                const XMLElement& includeNode );\r
 +      ~Include ();\r
 +      void ProcessXML();\r
 +private:\r
 +      void Initialize();\r
 +};\r
 +\r
 +\r
 +class Define\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const Module* module;\r
 +      const XMLElement& node;\r
 +      std::string name;\r
 +      std::string value;\r
 +\r
 +      Define ( const Project& project,\r
 +               const XMLElement& defineNode );\r
 +      Define ( const Project& project,\r
 +               const Module* module,\r
 +               const XMLElement& defineNode );\r
 +      ~Define();\r
 +      void ProcessXML();\r
 +private:\r
 +      void Initialize();\r
 +};\r
 +\r
 +\r
 +class File\r
 +{\r
 +public:\r
 +      std::string name;\r
 +      bool first;\r
 +\r
 +      File ( const std::string& _name, bool _first );\r
 +\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +\r
 +class Library\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      const Module& module;\r
 +      std::string name;\r
 +      const Module* imported_module;\r
 +\r
 +      Library ( const XMLElement& _node,\r
 +                const Module& _module,\r
 +                const std::string& _name );\r
 +\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +\r
 +class Invoke\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      const Module& module;\r
 +      const Module* invokeModule;\r
 +      std::vector<InvokeFile*> input;\r
 +      std::vector<InvokeFile*> output;\r
 +\r
 +      Invoke ( const XMLElement& _node,\r
 +               const Module& _module );\r
 +\r
 +      void ProcessXML();\r
 +      void GetTargets ( string_list& targets ) const;\r
 +      std::string GetParameters () const;\r
 +private:\r
 +      void ProcessXMLSubElement ( const XMLElement& e );\r
 +      void ProcessXMLSubElementInput ( const XMLElement& e );\r
 +      void ProcessXMLSubElementOutput ( const XMLElement& e );\r
 +};\r
 +\r
 +\r
 +class InvokeFile\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      std::string name;\r
 +      std::string switches;\r
 +\r
 +      InvokeFile ( const XMLElement& _node,\r
 +                   const std::string& _name );\r
 +\r
 +      void ProcessXML ();\r
 +};\r
 +\r
 +\r
 +class Dependency\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      const Module& module;\r
 +      const Module* dependencyModule;\r
 +\r
 +      Dependency ( const XMLElement& _node,\r
 +                   const Module& _module );\r
 +\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +\r
 +class ImportLibrary\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      const Module& module;\r
 +      std::string basename;\r
 +      std::string definition;\r
 +\r
 +      ImportLibrary ( const XMLElement& _node,\r
 +                      const Module& module );\r
 +\r
 +      void ProcessXML ();\r
 +};\r
 +\r
 +\r
 +class If\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      const Project& project;\r
 +      const Module* module;\r
 +      std::string property, value;\r
 +      IfableData data;\r
 +\r
 +      If ( const XMLElement& node_,\r
 +           const Project& project_,\r
 +           const Module* module_ );\r
 +      ~If();\r
 +\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +\r
 +class CompilerFlag\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const Module* module;\r
 +      const XMLElement& node;\r
 +      std::string flag;\r
 +\r
 +      CompilerFlag ( const Project& project,\r
 +                     const XMLElement& compilerFlagNode );\r
 +      CompilerFlag ( const Project& project,\r
 +                     const Module* module,\r
 +                     const XMLElement& compilerFlagNode );\r
 +      ~CompilerFlag ();\r
 +      void ProcessXML();\r
 +private:\r
 +      void Initialize();\r
 +};\r
 +\r
 +\r
 +class LinkerFlag\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const Module* module;\r
 +      const XMLElement& node;\r
 +      std::string flag;\r
 +\r
 +      LinkerFlag ( const Project& project,\r
 +                   const XMLElement& linkerFlagNode );\r
 +      LinkerFlag ( const Project& project,\r
 +                   const Module* module,\r
 +                   const XMLElement& linkerFlagNode );\r
 +      ~LinkerFlag ();\r
 +      void ProcessXML();\r
 +private:\r
 +      void Initialize();\r
 +};\r
 +\r
 +\r
 +class Property\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      const Project& project;\r
 +      const Module* module;\r
 +      std::string name, value;\r
 +\r
 +      Property ( const XMLElement& node_,\r
 +                 const Project& project_,\r
 +                 const Module* module_ );\r
 +\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +\r
 +class SourceFile\r
 +{\r
 +public:\r
 +      SourceFile ( AutomaticDependency* automaticDependency,\r
 +                   Module& module,\r
 +                   const std::string& filename,\r
 +                   SourceFile* parent,\r
 +                   bool isNonAutomaticDependency );\r
 +      SourceFile* ParseFile ( const std::string& normalizedFilename );\r
 +      void Parse ();\r
 +      std::string Location () const;\r
 +      std::vector<SourceFile*> files;\r
 +      AutomaticDependency* automaticDependency;\r
 +      Module& module;\r
 +      std::string filename;\r
 +      std::string filenamePart;\r
 +      std::string directoryPart;\r
 +      std::vector<SourceFile*> parents; /* List of files, this file is included from */\r
 +      bool isNonAutomaticDependency;\r
 +      std::string cachedDependencies;\r
 +      time_t lastWriteTime;\r
 +      time_t youngestLastWriteTime; /* Youngest last write time of this file and all children */\r
 +      SourceFile* youngestFile;\r
 +private:\r
 +      void GetDirectoryAndFilenameParts ();\r
 +      void Close ();\r
 +      void Open ();\r
 +      void SkipWhitespace ();\r
 +      bool ReadInclude ( std::string& filename,\r
 +                         bool& includeNext );\r
 +      bool IsIncludedFrom ( const std::string& normalizedFilename );\r
 +      SourceFile* GetParentSourceFile ();\r
 +      bool CanProcessFile ( const std::string& extension );\r
 +      bool IsParentOf ( const SourceFile* parent,\r
 +                        const SourceFile* child );\r
 +      std::string buf;\r
 +      const char *p;\r
 +      const char *end;\r
 +};\r
 +\r
 +\r
 +class AutomaticDependency\r
 +{\r
 +      friend class SourceFileTest;\r
 +public:\r
 +      const Project& project;\r
 +\r
 +      AutomaticDependency ( const Project& project );\r
 +      ~AutomaticDependency ();\r
 +      void Process ();\r
 +      std::string GetFilename ( const std::string& filename );\r
 +      bool LocateIncludedFile ( const std::string& directory,\r
 +                                const std::string& includedFilename,\r
 +                                std::string& resolvedFilename );\r
 +      bool LocateIncludedFile ( SourceFile* sourceFile,\r
 +                                Module& module,\r
 +                                const std::string& includedFilename,\r
 +                                bool includeNext,\r
 +                                std::string& resolvedFilename );\r
 +      SourceFile* RetrieveFromCacheOrParse ( Module& module,\r
 +                                             const std::string& filename,\r
 +                                             SourceFile* parentSourceFile );\r
 +      SourceFile* RetrieveFromCache ( const std::string& filename );\r
 +      void CheckAutomaticDependencies ( bool verbose );\r
 +      void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );\r
 +private:\r
 +      void ProcessModule ( Module& module );\r
 +      void ProcessFile ( Module& module,\r
 +                         const File& file );\r
 +      std::map<std::string, SourceFile*> sourcefile_map;\r
 +};\r
 +\r
 +\r
 +class Bootstrap\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const Module* module;\r
 +      const XMLElement& node;\r
 +      std::string base;\r
 +      std::string nameoncd;\r
 +\r
 +      Bootstrap ( const Project& project,\r
 +                  const Module* module,\r
 +                  const XMLElement& bootstrapNode );\r
 +      ~Bootstrap ();\r
 +      void ProcessXML();\r
 +private:\r
 +      bool IsSupportedModuleType ( ModuleType type );\r
 +      void Initialize();\r
 +};\r
 +\r
 +\r
 +class CDFile\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const XMLElement& node;\r
 +      std::string name;\r
 +      std::string base;\r
 +      std::string nameoncd;\r
 +      std::string path;\r
 +\r
 +      CDFile ( const Project& project,\r
 +               const XMLElement& bootstrapNode,\r
 +               const std::string& path );\r
 +      ~CDFile ();\r
 +      void ProcessXML();\r
 +      std::string GetPath () const;\r
 +};\r
 +\r
 +\r
 +class InstallFile\r
 +{\r
 +public:\r
 +      const Project& project;\r
 +      const XMLElement& node;\r
 +      std::string name;\r
 +      std::string base;\r
 +      std::string newname;\r
 +      std::string path;\r
 +\r
 +      InstallFile ( const Project& project,\r
 +                    const XMLElement& bootstrapNode,\r
 +                    const std::string& path );\r
 +      ~InstallFile ();\r
 +      void ProcessXML ();\r
 +      std::string GetPath () const;\r
 +};\r
 +\r
 +\r
 +class PchFile\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      const Module& module;\r
 +      std::string header;\r
 +\r
 +      PchFile (\r
 +              const XMLElement& node,\r
 +              const Module& module,\r
 +              const std::string& header );\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +\r
 +class StubbedComponent\r
 +{\r
 +public:\r
 +      const Module* module;\r
 +      const XMLElement& node;\r
 +      std::string name;\r
 +      std::vector<StubbedSymbol*> symbols;\r
 +\r
 +      StubbedComponent ( const Module* module_,\r
 +                         const XMLElement& stubbedComponentNode );\r
 +      ~StubbedComponent ();\r
 +      void ProcessXML ();\r
 +      void ProcessXMLSubElement ( const XMLElement& e );\r
 +};\r
 +\r
 +\r
 +class StubbedSymbol\r
 +{\r
 +public:\r
 +      const XMLElement& node;\r
 +      std::string symbol;\r
 +      std::string newname;\r
 +\r
 +      StubbedSymbol ( const XMLElement& stubbedSymbolNode );\r
 +      ~StubbedSymbol ();\r
 +      void ProcessXML();\r
 +};\r
 +\r
 +extern std::string\r
 +FixSeparator ( const std::string& s );\r
 +\r
 +extern std::string\r
 +ReplaceExtension (\r
 +      const std::string& filename,\r
 +      const std::string& newExtension );\r
 +\r
 +extern std::string\r
 +GetSubPath (\r
 +      const std::string& location,\r
 +      const std::string& path,\r
 +      const std::string& att_value );\r
 +\r
 +extern std::string\r
 +GetExtension ( const std::string& filename );\r
 +\r
 +extern std::string\r
 +GetDirectory ( const std::string& filename );\r
 +\r
 +extern std::string\r
 +NormalizeFilename ( const std::string& filename );\r
 +\r
 +#endif /* __RBUILD_H */\r
index 9bd140c,0000000..e707ac0
mode 100644,000000..100644
--- /dev/null
@@@ -1,477 -1,0 +1,480 @@@
-       <module name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" >\r
 +ReactOS Build System Documentation\r
 +==================================\r
 +\r
 +Building ReactOS\r
 +----------------\r
 +To generate GNU make makefiles and building ReactOS do the following:\r
 +\r
 +      1) Go to the top-level reactos directory\r
 +      2) Run the command: mingw32-make\r
 +\r
 +This will start building ReactOS.\r
 +\r
 +To build a bootable CD run the following command:\r
 +\r
 +      mingw32-make bootcd\r
 +\r
 +This will create ReactOS.iso in the top-level reactos directory.\r
 +\r
 +\r
 +Top-level XML Build File\r
 +------------------------\r
 +The top-level xml build file (ReactOS.xml) is processed by rbuild. The following is an example of how it could look like:\r
 +\r
 +<?xml version="1.0"?>\r
 +<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">\r
 +<project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">\r
 +      <xi:include href="config.xml">\r
 +              <xi:fallback>\r
 +                      <xi:include href="config.template.xml" />\r
 +              </xi:fallback>\r
 +      </xi:include>\r
 +\r
 +      <define name="_M_IX86" />\r
 +      <if property="DBG" value="1">\r
 +              <define name="DBG" value="1" />\r
 +              <property name="DBG_OR_KDBG" value="true" />\r
 +      </if>\r
 +\r
 +      <include base="ReactOS">include</include>\r
 +\r
 +      <directory name="boot">\r
 +              <xi:include href="boot/boot.xml" />\r
 +      </directory>\r
 +\r
 +      <module name="bootcd" type="iso">\r
 +      </module>\r
 +</project>\r
 +\r
 +\r
 +xi:include\r
 +----------\r
 +It is possible to split an xml build file over several files. The include element in the xi namespace is used to accomplish this.\r
 +\r
 +Syntax:\r
 +      <xi:include href="config.xml">\r
 +              <xi:fallback>\r
 +                      <xi:include href="config.template.xml" />\r
 +              </xi:fallback>\r
 +      </xi:include>\r
 +\r
 +Attributes:\r
 +      href - Name of xml build file to include. The filename is relative to the location of the current xml build file.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      xi:fallback\r
 +\r
 +\r
 +xi:fallback\r
 +-----------\r
 +This element is used to provide the name of an alternate file that is to be included if the first include file did not exists.\r
 +\r
 +Attributes:\r
 +      None.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      xi:include.\r
 +\r
 +\r
 +Project element\r
 +---------------\r
 +There can be one project per top-level XML build file. A project can only be defined in a top-level xml build file.\r
 +\r
 +Syntax:\r
 +      <project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">\r
 +              ...\r
 +      </project>\r
 +\r
 +Attributes:\r
 +      name - Name of the project.\r
 +      makefile - Filename of the GNU makefile that is to be created.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      define, directory, if, include, module, property\r
 +\r
 +\r
 +Module element\r
 +--------------\r
 +There can be zero or more modules per xml build file.\r
 +\r
 +Syntax:\r
++      <module name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" usewrc="false">\r
 +              ...\r
 +      </module>\r
 +\r
 +Attributes:\r
 +      name - Name of the module. Also the base name of the generated file if such file is generated for the particular module type.\r
 +      type - Type of module. See below for an explanation of module types.\r
 +      extension - Extension of the generated file if such file is generated for the particular module type.\r
 +      entrypoint - Entrypoint symbol of the generated file if such file is generated for the particular module type.\r
 +      baseaddress - Base address of the generated file if such file is generated for the particular module type.\r
 +      mangledsymbols - Controls wether or not to pass --kill-at to dlltool. If this attribute has the value false then --kill-at is passed to dlltool. If the value is true, then --kill-at is not passed to dlltool. If the generated file exports C++ classes then this need to be true.\r
 +      installbase - Base directory of the generated file in the installation directory. This attribute is optional.\r
 +      installname - Name of generated file in the installation directory. This attribute is optional, but if not specified, the generated file is not copied to the installation directory.\r
++      usewrc - Use WRC to compile resources if true. If false, windres is used. This attribute is optional. If not specified, WRC will be used.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      bootstrap, component, define, dependency, directory, file, if, importlibrary, include, invoke, library, property.\r
 +\r
 +\r
 +Module types\r
 +------------\r
 +The module type determines the actions that is to be carried out to process the module. The defined module types are seen below:\r
 +      buildtool - Builds a tool that can be run (invoked) when building ReactOS. Default extension is .exe when building on Windows and nothing when building on Linux. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
 +      staticlibrary - Builds a static library containing object files that can be linked together with other modules. Default extension is .a. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
 +      objectlibrary - Builds object files that can be linked together with other modules. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
 +      kernel - Builds ntoskrnl.exe. Default extension is .exe. Default entrypoint is _NtProcessStartup. \r
 +      kernelmodedll - Builds a kernel-mode DLL. Default extension is .dll. Default entrypoint is _DriverEntry@8.\r
 +      kernelmodedriver - Builds a kernel-mode driver. Default extension is .sys. Default entrypoint is _DriverEntry@8.\r
 +      nativedll - Builds a native DLL. Default extension is .dll. Default entrypoint is _DllMainCRTStartup@12.\r
 +      win32dll - Builds a Win32 DLL. Default extension is .dll. Default entrypoint is _DllMain@12.\r
 +      win32cui - Builds a Win32 console executable. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type.\r
 +      win32gui - Builds a Win32 GUI executable. Default extension is .exe. Default entrypoint is _WinMainCRTStartup. The baseaddress module attribute is not applicable for this module type.\r
 +      bootloader - Builds a bootloader. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
 +      bootsector - Builds one or more bootsector binaries. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
 +      iso - Builds a bootable CD. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
 +      test - Builds a testsuite. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type.\r
++      rpcserver - Generates and builds server code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
++      rpcclient - Generates and builds client code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
 +\r
 +\r
 +Bootstrap element\r
 +-----------------\r
 +A bootstrap element specifies that the generated file should be put on the bootable CD as a bootstrap file.\r
 +\r
 +Syntax:\r
 +      <bootstrap base="reactos" nameoncd="halmp.dll" />\r
 +\r
 +Attributes:\r
 +      base - Put file in this directory on the bootable CD. This attribute is optional.\r
 +      nameoncd - Name of file on the bootable CD. This attribute is optional.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +CDFile element\r
 +--------------\r
 +A cdfile element specifies the name of a file that is to be put on the bootable CD.\r
 +\r
 +Syntax:\r
 +      <cdfile base="reactos" nameoncd="ReadMe.txt">ReadMe.txt</cdfile>\r
 +\r
 +Attributes:\r
 +      base - Put file in this directory on the bootable CD. This attribute is optional.\r
 +      nameoncd - Name of file on the bootable CD. This attribute is optional.\r
 +\r
 +Value:\r
 +      Name of file.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Component element\r
 +-----------------\r
 +A component element specifies that imports from a library are to be stubbed so tests can be run without actually calling the functions in the library. This element can only be used for modules of type test.\r
 +\r
 +Syntax:\r
 +      <component name="ntdll.dll">\r
 +              ...\r
 +      </component>\r
 +\r
 +Attributes:\r
 +      name - Name of library.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      Symbol.\r
 +\r
 +\r
 +Symbol element\r
 +--------------\r
 +A symbol element specifies an imported function from a library that is to be stubbed so tests can be run without actually calling the function in the library.\r
 +\r
 +Syntax:\r
 +      <symbol newname="RtlAllocateHeap">HeapAlloc@12</symbol>\r
 +\r
 +Attributes:\r
 +      newname - New name of symbol. This attribute is optional.\r
 +\r
 +Value:\r
 +      Name of symbol.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Define element\r
 +--------------\r
 +A define element specifies the name and (optionally) value of a define for the C/C++ compiler and resource compiler.\r
 +\r
 +Syntax:\r
 +      <define name="WINVER">0x501</define>\r
 +\r
 +Attributes:\r
 +      name - Name of define.\r
 +\r
 +Value:\r
 +      Value of define. The value is optional.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Dependency element\r
 +------------------\r
 +A dependency element specifies the name of a module (usually of type buildtool) that is to be processed before the current module.\r
 +\r
 +Syntax:\r
 +      <dependency>OtherModule</dependency>\r
 +\r
 +Attributes:\r
 +      None.\r
 +\r
 +Value:\r
 +      Name of module.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Directory element\r
 +-----------------\r
 +A directory element specifies the name of a subdirectory.\r
 +\r
 +Syntax:\r
 +      <directory name="MyDirectory">\r
 +              ...\r
 +      </directory>\r
 +\r
 +Attributes:\r
 +      name - Name of directory.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      cdfile, directory, file, if, property.\r
 +\r
 +\r
 +File element\r
 +------------\r
 +A file element specifies the name of a file that is to be processed.\r
 +\r
 +Syntax:\r
 +      <file>MyFile.c</file>\r
 +\r
 +Attributes:\r
 +      None.\r
 +\r
 +Value:\r
 +      Name of file.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +If element\r
 +----------\r
 +An if element allows for conditional processing of other elements.\r
 +\r
 +Syntax:\r
 +      <if property="DBG" value="1">\r
 +              ...\r
 +      </if>\r
 +\r
 +Attributes:\r
 +      property - Name of the property that is to be evaluated.\r
 +      value - Value to compare to the value of the property. If the property has the specified value, then the subelements are processed.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      define, directory, file, if, include, property.\r
 +\r
 +\r
 +Importlibrary element\r
 +---------------------\r
 +An importlibrary element specifies that an import library should be generated which other modules can use to link with the current module.\r
 +\r
 +Syntax:\r
 +      <importlibrary definition="MyModule.def" />\r
 +\r
 +Attributes:\r
 +      definition - Filename of definition file (.def) used to generate the import library. The filename is relative to the current module.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Include element\r
 +---------------\r
 +An include element specifies an include directory for the C/C++ compiler and resource compiler.\r
 +\r
 +Syntax:\r
 +      <include base="MyLibraryModule">include</include>\r
 +\r
 +Attributes:\r
 +      base - Module or project which the value of this element is relative to. This attribute is optional. If left out, the include directory is relative to the position of the top-level xml build file.\r
 +\r
 +Value:\r
 +      Relative include directory.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Installfile element\r
 +-------------------\r
 +An installfile element specifies the name of a file that is to be installed when using 'make install'.\r
 +\r
 +Syntax:\r
 +      <installfile base="reactos" newname="ReadMe.txt">ReadMe.txt</installfile>\r
 +\r
 +Attributes:\r
 +      base - Put file in this directory within the install directory. This attribute is optional.\r
 +      newname - Name of file within the install directory. This attribute is optional.\r
 +\r
 +Value:\r
 +      Name of file.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Invoke element\r
 +--------------\r
 +An invoke element specifies the name of a module which is to be executed before the current module is processed.\r
 +\r
 +Syntax:\r
 +      <invoke module="wmc">\r
 +              <input>\r
 +                      <inputfile>ntoskrnl.mc</inputfile>\r
 +              </input>\r
 +              <output>\r
 +                      <outputfile switches="-H">../include/reactos/bugcodes.h</outputfile>\r
 +                      <outputfile switches="-o">bugcodes.rc</outputfile>\r
 +              </output>\r
 +      </invoke>\r
 +\r
 +Attributes:\r
 +      None.\r
 +\r
 +Value:\r
 +      Name of the module to execute.\r
 +\r
 +Elements:\r
 +      input, output.\r
 +\r
 +\r
 +Input element\r
 +-------------\r
 +An input element specifies a group of filenames that is to be passed as parameters to a build tool. Input filename parameters are located after output filename parameters on the command line. \r
 +\r
 +Attributes:\r
 +      None.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      inputfile.\r
 +\r
 +\r
 +Inputfile element\r
 +-----------------\r
 +An inputfile element specifies a filename that is to be passed as a parameter to a build tool.\r
 +\r
 +Attributes:\r
 +      switches - Switches that is passed as parameters just before the filename. This attribute is optional.\r
 +\r
 +Value:\r
 +      Name of file that is to be passed as a parameter to the build tool.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Output element\r
 +--------------\r
 +An output element specifies a group of filenames that is to be passed as parameters to a build tool. Output filename parameters are located before input filename parameters on the command line. \r
 +\r
 +Attributes:\r
 +      None.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      outputfile.\r
 +\r
 +\r
 +Outputfile element\r
 +------------------\r
 +An outputfile element specifies a filename that is to be passed as a parameter to a build tool.\r
 +\r
 +Attributes:\r
 +      switches - Switches that is passed as parameters just before the filename. This attribute is optional.\r
 +\r
 +Value:\r
 +      Name of file that is to be passed as a parameter to the build tool.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Library\r
 +-------\r
 +An importlibrary element specifies the name of another module which is to be linked with the current module.\r
 +\r
 +Syntax:\r
 +      <library>MyLibraryModule</library>\r
 +\r
 +Attributes:\r
 +      None.\r
 +\r
 +Value:\r
 +      Name of the module to link with.\r
 +\r
 +Elements:\r
 +      None.\r
 +\r
 +\r
 +Property\r
 +--------\r
 +A property element specifies the name and value of a property that can be used for conditional processing of the xml build file.\r
 +\r
 +Syntax:\r
 +      <property name="mypropertyname" value="mypropertyvalue" />\r
 +\r
 +Attributes:\r
 +      name - Name of property.\r
 +      value - Value of property.\r
 +\r
 +Value:\r
 +      None.\r
 +\r
 +Elements:\r
 +      None.\r
index 725a261,0000000..27b6557
mode 100644,000000..100644
--- /dev/null
@@@ -1,67 -1,0 +1,73 @@@
-       $(RSYM_BASE_)rsym.c
 +TOOLS_BASE = tools
 +TOOLS_BASE_ = $(TOOLS_BASE)$(SEP)
 +TOOLS_INT = $(INTERMEDIATE_)$(TOOLS_BASE)
 +TOOLS_INT_ = $(TOOLS_INT)$(SEP)
 +TOOLS_OUT = $(OUTPUT_)$(TOOLS_BASE)
 +TOOLS_OUT_ = $(TOOLS_OUT)$(SEP)
 +
 +$(TOOLS_INT): | $(INTERMEDIATE)
 +      $(ECHO_MKDIR)
 +      ${mkdir} $@
 +
 +ifneq ($(INTERMEDIATE),$(OUTPUT))
 +$(TOOLS_OUT): | $(OUTPUT)
 +      $(ECHO_MKDIR)
 +      ${mkdir} $@
 +endif
 +
 +RSYM_BASE = $(TOOLS_BASE)
 +RSYM_BASE_ = $(RSYM_BASE)$(SEP)
 +
 +RSYM_INT = $(INTERMEDIATE_)$(RSYM_BASE)
 +RSYM_INT_ = $(RSYM_INT)$(SEP)
 +RSYM_OUT = $(OUTPUT_)$(RSYM_BASE)
 +RSYM_OUT_ = $(RSYM_OUT)$(SEP)
 +
 +RSYM_TARGET = \
 +      $(EXEPREFIX)$(RSYM_OUT_)rsym$(EXEPOSTFIX)
 +
 +RSYM_SOURCES = \
++      $(RSYM_BASE_)rsym.c \
++      $(RSYM_BASE_)rsym_common.c
 +
 +RSYM_OBJECTS = \
 +      $(addprefix $(INTERMEDIATE_), $(RSYM_SOURCES:.c=.o))
 +
 +RSYM_HOST_CFLAGS = -g -Werror -Wall
 +
 +RSYM_HOST_LFLAGS = -g
 +
 +.PHONY: rsym
 +rsym: $(RSYM_TARGET)
 +
 +$(RSYM_TARGET): $(RSYM_OBJECTS) | $(RSYM_OUT)
 +      $(ECHO_LD)
 +      ${host_gcc} $(RSYM_OBJECTS) $(RSYM_HOST_LFLAGS) -o $@
 +
 +$(RSYM_INT_)rsym.o: $(RSYM_BASE_)rsym.c | $(RSYM_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@
 +
++$(RSYM_INT_)rsym_common.o: $(RSYM_BASE_)rsym_common.c | $(RSYM_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@
++
 +.PHONY: rsym_clean
 +rsym_clean:
 +      -@$(rm) $(RSYM_TARGET) $(RSYM_OBJECTS) 2>$(NUL)
 +clean: rsym_clean
 +
 +
 +include tools/bin2res/bin2res.mak
 +include tools/buildno/buildno.mak
 +include tools/cabman/cabman.mak
 +include tools/cdmake/cdmake.mak
 +include tools/mkhive/mkhive.mak
 +include tools/nci/nci.mak
 +include tools/rbuild/rbuild.mak
 +include tools/unicode/unicode.mak
++include tools/widl/widl.mak
 +include tools/winebuild/winebuild.mak
 +include tools/wmc/wmc.mak
 +include tools/wpp/wpp.mak
 +include tools/wrc/wrc.mak
index 0000000,0000000..d552051
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,123 @@@
++WIDL_BASE = $(TOOLS_BASE)$(SEP)widl
++WIDL_BASE_ = $(WIDL_BASE)$(SEP)
++WIDL_INT = $(INTERMEDIATE_)$(WIDL_BASE)
++WIDL_INT_ = $(WIDL_INT)$(SEP)
++WIDL_OUT = $(OUTPUT_)$(WIDL_BASE)
++WIDL_OUT_ = $(WIDL_OUT)$(SEP)
++
++$(WIDL_INT): | $(TOOLS_INT)
++      $(ECHO_MKDIR)
++      ${mkdir} $@
++
++ifneq ($(INTERMEDIATE),$(OUTPUT))
++$(WIDL_OUT): | $(TOOLS_OUT)
++      $(ECHO_MKDIR)
++      ${mkdir} $@
++endif
++
++WIDL_PORT_BASE = $(WIDL_BASE)$(SEP)port
++WIDL_PORT_BASE_ = $(WIDL_PORT_BASE)$(SEP)
++WIDL_PORT_INT = $(INTERMEDIATE_)$(WIDL_PORT_BASE)
++WIDL_PORT_INT_ = $(WIDL_PORT_INT)$(SEP)
++WIDL_PORT_OUT = $(OUTPUT_)$(WIDL_PORT_BASE)
++WIDL_PORT_OUT_ = $(WIDL_PORT_OUT)$(SEP)
++
++$(WIDL_PORT_INT): | $(WIDL_INT)
++      $(ECHO_MKDIR)
++      ${mkdir} $@
++
++ifneq ($(INTERMEDIATE),$(OUTPUT))
++$(WIDL_PORT_OUT): | $(WIDL_OUT)
++      $(ECHO_MKDIR)
++      ${mkdir} $@
++endif
++
++WIDL_TARGET = \
++      $(EXEPREFIX)$(WIDL_OUT_)widl$(EXEPOSTFIX)
++
++WIDL_SOURCES = $(addprefix $(WIDL_BASE_), \
++      client.c \
++      hash.c \
++      header.c \
++      lex.yy.c \
++      proxy.c \
++      server.c \
++      typelib.c \
++      utils.c \
++      widl.c \
++      write_msft.c \
++      y.tab.c \
++      port$(SEP)mkstemps.c \
++      )
++
++WIDL_OBJECTS = \
++  $(addprefix $(INTERMEDIATE_), $(WIDL_SOURCES:.c=.o))
++
++WIDL_HOST_CFLAGS = -g -Werror -Wall \
++      -DINT16=SHORT -D__USE_W32API -DYYDEBUG=1 \
++      -I$(WIDL_BASE) -I$(WPP_BASE) \
++      -Iinclude/wine -Iinclude -Iw32api/include
++
++WIDL_HOST_LFLAGS = -g
++
++WIDL_LIBS = $(WPP_TARGET)
++
++.PHONY: widl
++widl: $(WIDL_TARGET)
++
++$(WIDL_TARGET): $(WIDL_OBJECTS) $(WIDL_LIBS) | $(WIDL_OUT)
++      $(ECHO_LD)
++      ${host_gcc} $(WIDL_OBJECTS) $(WIDL_LIBS) $(WIDL_HOST_LFLAGS) -o $@
++
++$(WIDL_INT_)client.o: $(WIDL_BASE_)client.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)hash.o: $(WIDL_BASE_)hash.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)header.o: $(WIDL_BASE_)header.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)lex.yy.o: $(WIDL_BASE_)lex.yy.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)proxy.o: $(WIDL_BASE_)proxy.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)server.o: $(WIDL_BASE_)server.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)typelib.o: $(WIDL_BASE_)typelib.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)utils.o: $(WIDL_BASE_)utils.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)widl.o: $(WIDL_BASE_)widl.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)write_msft.o: $(WIDL_BASE_)write_msft.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_INT_)y.tab.o: $(WIDL_BASE_)y.tab.c | $(WIDL_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++$(WIDL_PORT_INT_)mkstemps.o: $(WIDL_PORT_BASE_)mkstemps.c | $(WIDL_PORT_INT)
++      $(ECHO_CC)
++      ${host_gcc} $(WIDL_HOST_CFLAGS) -c $< -o $@
++
++.PHONY: widl_clean
++widl_clean:
++      -@$(rm) $(WIDL_TARGET) $(WIDL_OBJECTS) 2>$(NUL)
++clean: widl_clean
Simple merge
index 6205693,0000000..670d9c0
mode 100644,000000..100644
--- /dev/null
@@@ -1,119 -1,0 +1,119 @@@
-                   -I$(UNICODE_BASE) -I$(WPP_BASE) -I$(WRC_BASE) \
 +WRC_BASE = $(TOOLS_BASE_)wrc
 +WRC_BASE_ = $(WRC_BASE)$(SEP)
 +WRC_INT = $(INTERMEDIATE_)$(WRC_BASE)
 +WRC_INT_ = $(WRC_INT)$(SEP)
 +WRC_OUT = $(OUTPUT_)$(WRC_BASE)
 +WRC_OUT_ = $(WRC_OUT)$(SEP)
 +
 +$(WRC_INT): | $(TOOLS_INT)
 +      $(ECHO_MKDIR)
 +      ${mkdir} $@
 +
 +ifneq ($(INTERMEDIATE),$(OUTPUT))
 +$(WRC_OUT): | $(TOOLS_OUT)
 +      $(ECHO_MKDIR)
 +      ${mkdir} $@
 +endif
 +
 +WRC_PORT_BASE = $(WRC_BASE)$(SEP)port
 +WRC_PORT_BASE_ = $(WRC_PORT_BASE)$(SEP)
 +WRC_PORT_INT = $(INTERMEDIATE_)$(WRC_PORT_BASE)
 +WRC_PORT_INT_ = $(WRC_PORT_INT)$(SEP)
 +WRC_PORT_OUT = $(OUTPUT_)$(WRC_PORT_BASE)
 +WRC_PORT_OUT_ = $(WRC_PORT_OUT)$(SEP)
 +
 +$(WRC_PORT_INT): | $(WRC_INT)
 +      $(ECHO_MKDIR)
 +      ${mkdir} $@
 +
 +ifneq ($(INTERMEDIATE),$(OUTPUT))
 +$(WRC_PORT_OUT): | $(WRC_OUT)
 +      $(ECHO_MKDIR)
 +      ${mkdir} $@
 +endif
 +
 +WRC_TARGET = \
 +      $(EXEPREFIX)$(WRC_BASE_)wrc$(EXEPOSTFIX)
 +
 +WRC_SOURCES = $(addprefix $(WRC_BASE_), \
 +      dumpres.c \
 +      genres.c \
 +      newstruc.c \
 +      readres.c \
 +      translation.c \
 +      utils.c \
 +      wrc.c \
 +      writeres.c \
 +      y.tab.c \
 +      lex.yy.c \
 +      port$(SEP)mkstemps.c \
 +      )
 +
 +WRC_OBJECTS = \
 +  $(addprefix $(INTERMEDIATE_), $(WRC_SOURCES:.c=.o))
 +
 +WRC_HOST_CFLAGS = -I$(WRC_BASE) -g -Werror -Wall \
 +                  -D__USE_W32API -DWINE_UNICODE_API= \
 +                  -Dwchar_t="unsigned short" -D_WCHAR_T_DEFINED \
++                  -I$(UNICODE_BASE) -I$(WPP_BASE) \
 +                  -Iinclude/wine -Iinclude -Iw32api/include
 +
 +WRC_HOST_LFLAGS = -g
 +
 +WRC_LIBS = $(UNICODE_TARGET) $(WPP_TARGET)
 +
 +.PHONY: wrc
 +wrc: $(WRC_TARGET)
 +
 +$(WRC_TARGET): $(WRC_OBJECTS) $(WRC_LIBS) | $(WRC_OUT)
 +      $(ECHO_LD)
 +      ${host_gcc} $(WRC_OBJECTS) $(WRC_LIBS) $(WRC_HOST_LFLAGS) -o $@
 +
 +$(WRC_INT_)dumpres.o: $(WRC_BASE_)dumpres.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)genres.o: $(WRC_BASE_)genres.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)newstruc.o: $(WRC_BASE_)newstruc.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)readres.o: $(WRC_BASE_)readres.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)translation.o: $(WRC_BASE_)translation.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)utils.o: $(WRC_BASE_)utils.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)wrc.o: $(WRC_BASE_)wrc.c $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)writeres.o: $(WRC_BASE_)writeres.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)y.tab.o: $(WRC_BASE_)y.tab.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_INT_)lex.yy.o: $(WRC_BASE_)lex.yy.c | $(WRC_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +$(WRC_PORT_INT_)mkstemps.o: $(WRC_PORT_BASE_)mkstemps.c | $(WRC_PORT_INT)
 +      $(ECHO_CC)
 +      ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 +
 +.PHONY: wrc_clean
 +wrc_clean:
 +      -@$(rm) $(WRC_TARGET) $(WRC_OBJECTS) 2>$(NUL)
 +clean: wrc_clean
@@@ -634,16 -634,16 +634,16 @@@ union yyallo
  /* YYFINAL -- State number of the termination state. */
  #define YYFINAL  3
  /* YYLAST -- Last index in YYTABLE.  */
- #define YYLAST   692
 -#define YYLAST   661
++#define YYLAST   696
  
  /* YYNTOKENS -- Number of terminals. */
  #define YYNTOKENS  96
  /* YYNNTS -- Number of nonterminals. */
- #define YYNNTS  83
+ #define YYNNTS  82
  /* YYNRULES -- Number of rules. */
- #define YYNRULES  258
+ #define YYNRULES  256
  /* YYNRULES -- Number of states. */
- #define YYNSTATES  572
 -#define YYNSTATES  568
++#define YYNSTATES  570
  
  /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
  #define YYUNDEFTOK  2
@@@ -754,79 -754,79 +754,79 @@@ static const short yyrhs[] 
       124,    -1,   123,    30,   124,    -1,   123,    24,   124,    -1,
       123,    31,   124,    -1,   123,    25,   124,    -1,   123,    26,
       124,    -1,   123,    40,   124,    -1,   123,    39,   124,    -1,
-      123,    38,   124,    -1,   123,    23,   103,   155,   176,    93,
-      176,    93,   176,   126,    -1,     6,   155,   176,    93,   176,
-       93,   176,    93,   176,    93,   176,   129,    -1,   176,    93,
-      176,    93,   176,    93,   176,    93,   176,   129,    -1,    -1,
-       93,   176,    93,   176,    -1,    93,   176,    93,   176,    93,
-      131,    -1,    93,   176,    93,   176,    93,   131,    93,   131,
-       -1,   103,   155,   176,    93,   132,    93,   131,    93,   176,
-       93,   176,    93,   176,    93,   176,    93,   131,    -1,   103,
-      155,   176,    93,   132,    93,   131,    93,   176,    93,   176,
-       93,   176,    93,   176,    -1,    21,   176,    93,     6,    -1,
-       -1,    93,   131,    -1,    -1,    93,   131,    -1,    93,   131,
-       93,   131,    -1,   131,    83,   131,    -1,    94,   131,    95,
-       -1,   177,    -1,    91,   177,    -1,   176,    -1,     6,    -1,
-       14,   165,   176,    93,   176,    93,   176,    93,   176,   140,
-      134,    80,   135,    81,    -1,    -1,   134,    62,   131,    -1,
-      134,    61,   131,    -1,   134,    59,     6,    -1,   134,   128,
-       -1,   134,   141,    -1,   134,    58,   103,    -1,   134,    15,
-      102,    -1,   134,   169,    -1,   134,   170,    -1,   134,   171,
-       -1,    -1,   135,    36,   136,    -1,   135,    37,   138,    -1,
-      135,    34,   138,    -1,   135,    33,   138,    -1,   135,    35,
-      138,    -1,   135,    27,   137,    -1,   135,    28,   137,    -1,
-      135,    32,   137,    -1,   135,    29,   137,    -1,   135,    30,
-      137,    -1,   135,    24,   137,    -1,   135,    31,   137,    -1,
-      135,    25,   137,    -1,   135,    26,   137,    -1,   135,    40,
-      137,    -1,   135,    39,   137,    -1,   135,    38,   137,    -1,
-      135,    23,   103,   155,   176,    93,   176,    93,   176,   126,
-       -1,   103,   155,   176,    93,   132,    93,   131,    93,   176,
-       93,   176,    93,   176,    93,   176,    93,   131,   140,   139,
-       -1,   103,   155,   176,    93,   132,    93,   131,    93,   176,
-       93,   176,    93,   176,    93,   176,   139,    -1,     6,   155,
-      176,    93,   176,    93,   176,    93,   176,    93,   176,   130,
-      140,   139,    -1,   176,    93,   176,    93,   176,    93,   176,
-       93,   176,   130,   140,   139,    -1,    -1,   172,    -1,    -1,
-       93,   176,    -1,    21,   176,    93,     6,    93,   176,    93,
-      176,   142,    -1,    -1,    93,   176,    -1,    15,   165,   168,
-      144,    -1,    80,   145,    81,    -1,    -1,   145,    74,     6,
-      155,   176,   146,    -1,   145,    74,    76,    -1,   145,    75,
-        6,   146,   144,    -1,    -1,    93,    48,   146,    -1,    93,
-       47,   146,    -1,    93,    77,   146,    -1,    93,    49,   146,
-       -1,    93,    72,   146,    -1,    93,    73,   146,    -1,    16,
-      165,   168,   148,    -1,    80,   149,    81,    -1,    -1,   149,
-       74,     6,   150,    -1,   149,    74,    76,    -1,   149,    75,
-        6,   151,   148,    -1,    -1,    93,   176,    -1,    93,   175,
-       93,   175,   146,    -1,    93,   175,    93,   175,    93,   176,
-       -1,    -1,    93,   176,    -1,    93,   175,    93,   176,    -1,
-       93,   175,    93,   175,    93,   176,    -1,    93,   175,    93,
-      175,    93,   175,    93,   176,    -1,   153,    80,   154,    81,
-       -1,    20,   165,   168,    -1,    -1,   154,   176,   155,     6,
-       -1,    -1,    93,    -1,    19,   165,   157,    80,   158,    81,
-       -1,    -1,   157,    65,   176,    93,   176,    93,   176,    93,
-      176,    -1,   157,    66,   176,    93,   176,    93,   176,    93,
-      176,    -1,   157,    70,   176,    -1,   157,    67,   176,    -1,
-      157,    68,   176,    -1,   157,    69,   176,    -1,   157,    71,
-      176,    -1,    -1,   158,   159,    -1,    41,     6,    80,   160,
-       81,    -1,    -1,   160,   161,    -1,   159,    -1,    42,     6,
-       93,     6,    -1,    42,     6,    93,   162,    -1,   176,    -1,
-      162,    93,   176,    -1,    78,   165,   176,    93,   176,   168,
-       80,   164,    81,    -1,    -1,   164,    79,   176,    -1,   164,
-       76,    -1,    -1,   165,   166,    -1,   165,   167,    -1,    55,
-       -1,    57,    -1,    53,    -1,    51,    -1,    54,    -1,    56,
-       -1,    52,    -1,    -1,   168,   169,    -1,   168,   170,    -1,
-      168,   171,    -1,    64,   176,    93,   176,    -1,    60,   176,
-       -1,    63,   176,    -1,   168,    80,   173,    81,    -1,     9,
-       -1,     4,    -1,    87,     4,    -1,     5,    -1,    87,     5,
-       -1,     6,    -1,   173,   155,     9,    -1,   173,   155,     4,
-       -1,   173,   155,    87,     4,    -1,   173,   155,     5,    -1,
-      173,   155,    87,     5,    -1,   173,   155,     6,    -1,   105,
-       -1,   172,    -1,    -1,   176,    -1,   177,    -1,   177,    86,
-      177,    -1,   177,    87,   177,    -1,   177,    83,   177,    -1,
-      177,    85,   177,    -1,   177,    88,   177,    -1,   177,    89,
-      177,    -1,   177,    84,   177,    -1,    90,   177,    -1,    87,
-      177,    -1,    86,   177,    -1,    94,   177,    95,    -1,   178,
-       -1,    91,   178,    -1,     4,    -1,     5,    -1
+      123,    38,   124,    -1,   123,    23,   103,   154,   175,    93,
+      175,    93,   175,   126,    -1,     6,   154,   175,    93,   175,
+       93,   175,    93,   175,    93,   175,   129,    -1,   175,    93,
+      175,    93,   175,    93,   175,    93,   175,   129,    -1,    -1,
+       93,   175,    93,   175,    -1,    93,   175,    93,   175,    93,
+      130,    -1,    93,   175,    93,   175,    93,   130,    93,   130,
+       -1,   103,   154,   175,    93,   131,    93,   130,    93,   175,
+       93,   175,    93,   175,    93,   175,    93,   130,    -1,   103,
+      154,   175,    93,   131,    93,   130,    93,   175,    93,   175,
+       93,   175,    93,   175,    -1,    21,   175,    93,     6,    -1,
+       -1,    93,   130,    -1,    93,   130,    93,   130,    -1,   130,
 -      83,   130,    -1,    94,   130,    95,    -1,   177,    -1,    91,
 -     177,    -1,   175,    -1,     6,    -1,    14,   164,   175,    93,
++      83,   130,    -1,    94,   130,    95,    -1,   176,    -1,    91,
++     176,    -1,   175,    -1,     6,    -1,    14,   164,   175,    93,
+      175,    93,   175,    93,   175,   139,   133,    80,   134,    81,
+       -1,    -1,   133,    62,   130,    -1,   133,    61,   130,    -1,
+      133,    59,     6,    -1,   133,   128,    -1,   133,   140,    -1,
+      133,    58,   103,    -1,   133,    15,   102,    -1,   133,   168,
+       -1,   133,   169,    -1,   133,   170,    -1,    -1,   134,    36,
+      135,    -1,   134,    37,   137,    -1,   134,    34,   137,    -1,
+      134,    33,   137,    -1,   134,    35,   137,    -1,   134,    27,
+      136,    -1,   134,    28,   136,    -1,   134,    32,   136,    -1,
+      134,    29,   136,    -1,   134,    30,   136,    -1,   134,    24,
+      136,    -1,   134,    31,   136,    -1,   134,    25,   136,    -1,
+      134,    26,   136,    -1,   134,    40,   136,    -1,   134,    39,
+      136,    -1,   134,    38,   136,    -1,   134,    23,   103,   154,
+      175,    93,   175,    93,   175,   126,    -1,   103,   154,   175,
+       93,   131,    93,   130,    93,   175,    93,   175,    93,   175,
+       93,   175,    93,   130,   139,   138,    -1,   103,   154,   175,
+       93,   131,    93,   130,    93,   175,    93,   175,    93,   175,
+       93,   175,   138,    -1,     6,   154,   175,    93,   175,    93,
+      175,    93,   175,    93,   175,   129,   139,   138,    -1,   175,
+       93,   175,    93,   175,    93,   175,    93,   175,   129,   139,
+      138,    -1,    -1,   171,    -1,    -1,    93,   175,    -1,    21,
+      175,    93,     6,    93,   175,    93,   175,   141,    -1,    -1,
+       93,   175,    -1,    15,   164,   167,   143,    -1,    80,   144,
+       81,    -1,    -1,   144,    74,     6,   154,   175,   145,    -1,
+      144,    74,    76,    -1,   144,    75,     6,   145,   143,    -1,
+       -1,    93,    48,   145,    -1,    93,    47,   145,    -1,    93,
+       77,   145,    -1,    93,    49,   145,    -1,    93,    72,   145,
+       -1,    93,    73,   145,    -1,    16,   164,   167,   147,    -1,
+       80,   148,    81,    -1,    -1,   148,    74,     6,   149,    -1,
+      148,    74,    76,    -1,   148,    75,     6,   150,   147,    -1,
+       -1,    93,   175,    -1,    93,   174,    93,   174,   145,    -1,
+       93,   174,    93,   174,    93,   175,    -1,    -1,    93,   175,
+       -1,    93,   174,    93,   175,    -1,    93,   174,    93,   174,
+       93,   175,    -1,    93,   174,    93,   174,    93,   174,    93,
+      175,    -1,   152,    80,   153,    81,    -1,    20,   164,   167,
+       -1,    -1,   153,   175,   154,     6,    -1,    -1,    93,    -1,
+       19,   164,   156,    80,   157,    81,    -1,    -1,   156,    65,
+      175,    93,   175,    93,   175,    93,   175,    -1,   156,    66,
+      175,    93,   175,    93,   175,    93,   175,    -1,   156,    70,
+      175,    -1,   156,    67,   175,    -1,   156,    68,   175,    -1,
+      156,    69,   175,    -1,   156,    71,   175,    -1,    -1,   157,
+      158,    -1,    41,     6,    80,   159,    81,    -1,    -1,   159,
+      160,    -1,   158,    -1,    42,     6,    93,     6,    -1,    42,
+        6,    93,   161,    -1,   175,    -1,   161,    93,   175,    -1,
+       78,   164,   175,    93,   175,   167,    80,   163,    81,    -1,
+       -1,   163,    79,   175,    -1,   163,    76,    -1,    -1,   164,
+      165,    -1,   164,   166,    -1,    55,    -1,    57,    -1,    53,
+       -1,    51,    -1,    54,    -1,    56,    -1,    52,    -1,    -1,
+      167,   168,    -1,   167,   169,    -1,   167,   170,    -1,    64,
+      175,    93,   175,    -1,    60,   175,    -1,    63,   175,    -1,
+      167,    80,   172,    81,    -1,     9,    -1,     4,    -1,    87,
+        4,    -1,     5,    -1,    87,     5,    -1,     6,    -1,   172,
+      154,     9,    -1,   172,   154,     4,    -1,   172,   154,    87,
+        4,    -1,   172,   154,     5,    -1,   172,   154,    87,     5,
+       -1,   172,   154,     6,    -1,   105,    -1,   171,    -1,    -1,
+      175,    -1,   176,    -1,   176,    86,   176,    -1,   176,    87,
+      176,    -1,   176,    83,   176,    -1,   176,    85,   176,    -1,
+      176,    88,   176,    -1,   176,    89,   176,    -1,   176,    84,
+      176,    -1,    90,   176,    -1,    87,   176,    -1,    86,   176,
+       -1,    94,   176,    95,    -1,   177,    -1,    91,   177,    -1,
+        4,    -1,     5,    -1
  };
  
  /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
@@@ -986,64 -986,63 +986,63 @@@ static const unsigned char yyr2[] 
     means the default is an error.  */
  static const unsigned short yydefact[] =
  {
-        3,     0,     2,     1,     5,   257,   258,    11,   209,     9,
-        0,     0,     0,     0,     0,     4,     8,     0,    11,   243,
-      255,     0,   219,     0,   253,   252,   251,   256,     0,   182,
+        3,     0,     2,     1,     5,   255,   256,    11,   207,     9,
+        0,     0,     0,     0,     0,     4,     8,     0,    11,   241,
+      253,     0,   217,     0,   251,   250,   249,   254,     0,   180,
         0,     0,     0,     0,     0,     0,     0,     0,    44,    45,
-      209,   209,   209,   209,   209,   209,   209,   209,   209,   209,
-      209,   209,   209,   209,   209,     7,    17,    18,    24,    22,
-       23,    27,    28,    21,    30,   209,    16,    19,    20,    25,
-       26,    31,    29,   215,   218,   214,   216,   212,   217,   213,
-      210,   211,   181,     0,   254,     0,     6,   246,   250,   247,
-      244,   245,   248,   249,   219,   219,   219,     0,     0,   219,
-      219,   219,   219,   187,   219,   219,   219,     0,   219,   219,
-        0,     0,     0,   220,   221,   222,     0,   180,   184,     0,
-       34,    33,    32,   239,     0,   240,    35,    36,     0,     0,
+      207,   207,   207,   207,   207,   207,   207,   207,   207,   207,
+      207,   207,   207,   207,   207,     7,    17,    18,    24,    22,
+       23,    27,    28,    21,    30,   207,    16,    19,    20,    25,
+       26,    31,    29,   213,   216,   212,   214,   210,   215,   211,
+      208,   209,   179,     0,   252,     0,     6,   244,   248,   245,
+      242,   243,   246,   247,   217,   217,   217,     0,     0,   217,
+      217,   217,   217,   185,   217,   217,   217,     0,   217,   217,
+        0,     0,     0,   218,   219,   220,     0,   178,   182,     0,
+       34,    33,    32,   237,     0,   238,    35,    36,     0,     0,
         0,     0,    40,    41,     0,    38,    39,    37,     0,    42,
-       43,   224,   225,     0,    10,   185,     0,    47,     0,     0,
-        0,   154,   152,   167,   165,     0,     0,     0,     0,     0,
-        0,     0,   195,     0,     0,   183,     0,   228,   230,   232,
-      227,     0,   184,     0,     0,     0,     0,     0,     0,   191,
-      192,   193,   190,   194,     0,   219,   223,     0,    46,     0,
-      229,   231,   226,     0,     0,     0,     0,     0,   153,     0,
-        0,   166,     0,     0,     0,   186,   196,     0,     0,     0,
-      234,   236,   238,   233,     0,     0,     0,   184,   156,   158,
-      171,   169,   175,     0,     0,     0,   206,    50,    50,   235,
-      237,     0,     0,     0,     0,     0,   241,   168,   241,     0,
-        0,     0,   198,     0,     0,    48,    49,    61,   147,   158,
-      158,   158,   158,   158,   158,   158,   157,     0,   172,     0,
-      176,   170,     0,     0,     0,   208,     0,   205,    56,    55,
-       57,    58,    59,    54,    51,    52,     0,     0,   111,   155,
-      160,   159,   162,   163,   164,   161,   241,   241,     0,     0,
-        0,   197,   200,   199,   207,     0,     0,     0,     0,     0,
-        0,     0,    71,    65,    68,    69,    70,   148,     0,   158,
-      242,     0,   177,   188,   189,     0,    53,    13,    67,    12,
-        0,    15,    14,    66,    64,     0,     0,    63,   106,    62,
-        0,     0,     0,     0,     0,     0,     0,   122,   115,   116,
-      119,   120,   121,     0,   173,   241,     0,     0,   107,   255,
+       43,   222,   223,     0,    10,   183,     0,    47,     0,     0,
+        0,   152,   150,   165,   163,     0,     0,     0,     0,     0,
+        0,     0,   193,     0,     0,   181,     0,   226,   228,   230,
+      225,     0,   182,     0,     0,     0,     0,     0,     0,   189,
+      190,   191,   188,   192,     0,   217,   221,     0,    46,     0,
+      227,   229,   224,     0,     0,     0,     0,     0,   151,     0,
+        0,   164,     0,     0,     0,   184,   194,     0,     0,     0,
+      232,   234,   236,   231,     0,     0,     0,   182,   154,   156,
+      169,   167,   173,     0,     0,     0,   204,    50,    50,   233,
+      235,     0,     0,     0,     0,     0,   239,   166,   239,     0,
+        0,     0,   196,     0,     0,    48,    49,    61,   145,   156,
+      156,   156,   156,   156,   156,   156,   155,     0,   170,     0,
+      174,   168,     0,     0,     0,   206,     0,   203,    56,    55,
+       57,    58,    59,    54,    51,    52,     0,     0,   109,   153,
+      158,   157,   160,   161,   162,   159,   239,   239,     0,     0,
+        0,   195,   198,   197,   205,     0,     0,     0,     0,     0,
+        0,     0,    71,    65,    68,    69,    70,   146,     0,   156,
+      240,     0,   175,   186,   187,     0,    53,    13,    67,    12,
+        0,    15,    14,    66,    64,     0,     0,    63,   104,    62,
+        0,     0,     0,     0,     0,     0,     0,   120,   113,   114,
 -     117,   118,   119,     0,   171,   239,     0,     0,   105,     0,
++     117,   118,   119,     0,   171,   239,     0,     0,   105,   253,
         0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 -       0,     0,     0,     0,     0,     0,     0,     0,     0,    60,
 -     116,     0,   115,   112,   111,   110,     0,   172,     0,   176,
 -     199,   200,   201,    98,   103,   102,   182,   182,    82,    84,
 -      85,    77,    78,    80,    81,    83,    79,    75,     0,    74,
 -      76,   182,    72,    73,    88,    87,    86,     0,     0,     0,
         0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-        0,    60,   118,     0,   117,   114,   113,   112,     0,   174,
-        0,   178,   201,   202,   203,    98,   105,   104,   184,   184,
 -       0,     0,     0,     0,     0,     0,   108,     0,     0,     0,
 -       0,     0,     0,    98,   182,   182,   131,   133,   134,   126,
 -     127,   129,   130,   132,   128,   124,     0,   123,   125,   182,
 -     121,   122,   137,   136,   135,   177,   202,     0,     0,     0,
++       0,    60,   116,     0,   115,   112,   111,   110,     0,   172,
++       0,   176,   199,   200,   201,    98,   103,   102,   182,   182,
 +      82,    84,    85,    77,    78,    80,    81,    83,    79,    75,
-        0,    74,    76,   184,    72,    73,    88,    87,    86,     0,
++       0,    74,    76,   182,    72,    73,    88,    87,    86,     0,
         0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-        0,     0,     0,     0,     0,     0,     0,     0,   110,     0,
-        0,     0,     0,     0,     0,    98,   184,   184,   133,   135,
-      136,   128,   129,   131,   132,   134,   130,   126,     0,   125,
-      127,   184,   123,   124,   139,   138,   137,   179,   204,     0,
 -       0,     0,     0,     0,     0,     0,     0,     0,   107,     0,
 -     106,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 -     148,     0,     0,     0,     0,    92,     0,     0,     0,     0,
 -     147,     0,     0,     0,     0,     0,    89,     0,     0,     0,
 -     149,    92,     0,     0,     0,     0,     0,    99,     0,   138,
 -       0,     0,     0,     0,     0,     0,    91,     0,     0,    99,
 -       0,    93,    99,   100,     0,     0,   145,     0,     0,    90,
 -       0,     0,    99,   143,     0,    94,   101,     0,   145,   142,
 -     144,     0,     0,     0,   143,     0,    95,    97,   141,     0,
 -       0,   143,    96,     0,   140,   145,   143,   139
++       0,     0,     0,     0,     0,     0,     0,     0,   108,     0,
++       0,     0,     0,     0,     0,    98,   182,   182,   131,   133,
++     134,   126,   127,   129,   130,   132,   128,   124,     0,   123,
++     125,   182,   121,   122,   137,   136,   135,   177,   202,     0,
 +       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 +       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-      109,     0,   108,     0,     0,     0,     0,     0,     0,     0,
-        0,     0,   150,     0,     0,     0,     0,    92,     0,     0,
-        0,     0,   149,     0,     0,     0,     0,     0,    89,     0,
-        0,     0,   151,    92,     0,     0,     0,     0,     0,    99,
-        0,   140,     0,     0,     0,     0,     0,     0,    91,     0,
-        0,   101,     0,    93,    99,   100,     0,     0,     0,   147,
-        0,     0,    90,     0,   101,   102,   145,     0,    94,     0,
-      147,     0,   144,   146,     0,     0,     0,   145,   103,     0,
-       95,    97,   143,     0,     0,   145,    96,     0,   142,   147,
-      145,   141
++     107,     0,   106,     0,     0,     0,     0,     0,     0,     0,
++       0,     0,   148,     0,     0,     0,     0,    92,     0,     0,
++       0,     0,   147,     0,     0,     0,     0,     0,    89,     0,
++       0,     0,   149,    92,     0,     0,     0,     0,     0,    99,
++       0,   138,     0,     0,     0,     0,     0,     0,    91,     0,
++       0,    99,     0,    93,    99,   100,     0,     0,   145,     0,
++       0,    90,     0,     0,    99,   143,     0,    94,   101,     0,
++     145,   142,   144,     0,     0,     0,   143,     0,    95,    97,
++     141,     0,     0,   143,    96,     0,   140,   145,   143,   139
  };
  
  /* YYDEFGOTO[NTERM-NUM]. */
@@@ -1051,245 -1050,238 +1050,244 @@@ static const short yydefgoto[] 
  {
        -1,     1,     2,    15,    23,    21,   322,   323,    55,   123,
        56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
 -      66,   166,   245,   274,   275,    67,   276,   330,   388,   397,
 -     506,   402,   303,   526,   327,   479,    68,   308,   376,   450,
 -     436,   445,   549,   278,   339,   500,    69,   152,   175,   235,
 +      66,   166,   245,   274,   275,    67,   276,   330,   390,   399,
-      508,   404,   303,   528,   539,   327,   481,    68,   308,   378,
-      452,   438,   447,   552,   278,   339,   502,    69,   152,   175,
-      235,    70,   154,   176,   237,   239,    16,    17,    85,   146,
-       71,   134,   184,   206,   264,   293,   383,    72,   243,    22,
-       80,    81,   124,   113,   114,   115,   125,   172,   126,   257,
-      319,    19,    20
++     508,   404,   303,   528,   327,   481,    68,   308,   378,   452,
++     438,   447,   551,   278,   339,   502,    69,   152,   175,   235,
+       70,   154,   176,   237,   239,    16,    17,    85,   146,    71,
 -     134,   184,   206,   264,   293,   381,    72,   243,    22,    80,
++     134,   184,   206,   264,   293,   383,    72,   243,    22,    80,
+       81,   124,   113,   114,   115,   125,   172,   126,   257,   319,
+       19,    20
  };
  
  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     STATE-NUM.  */
- #define YYPACT_NINF -435
 -#define YYPACT_NINF -524
++#define YYPACT_NINF -523
  static const short yypact[] =
  {
-     -435,     7,    81,  -435,  -435,  -435,  -435,  -435,  -435,  -435,
-       93,    93,    93,    39,    93,  -435,  -435,   -58,  -435,   596,
-     -435,   393,   635,    93,  -435,  -435,  -435,  -435,   558,  -435,
-      393,    93,    93,    93,    93,    93,    93,    93,  -435,  -435,
-     -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,
-     -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,
-     -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,
-     -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,
-     -435,  -435,   230,   -80,  -435,   108,  -435,   371,   391,   356,
-      -37,   -37,  -435,  -435,   635,   382,   382,    87,    87,   635,
-      635,   382,   382,   635,   382,   382,   382,    87,   382,   382,
-       93,    93,    93,  -435,  -435,  -435,    93,  -435,   -64,    70,
-     -435,  -435,  -435,  -435,   177,  -435,  -435,  -435,   -56,   -29,
-      251,   296,  -435,  -435,   477,  -435,  -435,  -435,   -27,  -435,
-     -435,  -435,  -435,   -25,  -435,  -435,    29,  -435,     0,    93,
-       93,  -435,  -435,  -435,  -435,    93,    93,    93,    93,    93,
-       93,    93,  -435,    93,    93,  -435,    13,  -435,  -435,  -435,
-     -435,   113,   -66,   -22,    44,   184,   188,    53,    56,  -435,
-     -435,  -435,  -435,  -435,   -33,  -435,  -435,    58,  -435,    72,
-     -435,  -435,  -435,    19,    93,    93,    14,    68,  -435,    40,
-      109,  -435,    93,    93,   126,  -435,  -435,   321,    93,    93,
-     -435,  -435,  -435,  -435,   266,    76,    83,   -64,  -435,    92,
-       95,  -435,   103,   110,   118,   144,  -435,   142,   142,  -435,
-     -435,    93,    93,    93,   173,   176,    93,  -435,    93,   180,
-       93,    93,  -435,   147,   404,  -435,  -435,  -435,   181,    92,
-       92,    92,    92,    92,    92,    92,  -435,   185,   190,   204,
-      190,  -435,   213,   214,   -31,  -435,    93,  -435,  -435,  -435,
-     -435,  -435,  -435,  -435,   219,  -435,   240,    93,  -435,  -435,
-     -435,  -435,  -435,  -435,  -435,  -435,    93,    93,    93,    93,
-      310,  -435,  -435,  -435,  -435,   404,   122,    93,    34,   311,
-      186,   186,  -435,  -435,  -435,  -435,  -435,  -435,   431,   225,
-     -435,   226,   190,  -435,  -435,   228,  -435,  -435,  -435,  -435,
-      233,  -435,  -435,  -435,  -435,    93,   186,   244,   596,   244,
-      567,   122,    93,    34,   327,   186,   186,  -435,  -435,  -435,
-     -435,  -435,  -435,   305,  -435,    93,   238,   330,   371,  -435,
-      -13,   558,   186,    34,   331,   331,   331,   331,   331,   331,
-      331,   331,   331,    93,    93,    93,    34,    93,   331,   331,
-      331,  -435,  -435,   247,  -435,  -435,   244,   244,   585,  -435,
-      252,   190,  -435,   253,  -435,  -435,  -435,  -435,   -64,   -64,
-     -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,
-      256,  -435,  -435,   -64,  -435,  -435,  -435,  -435,  -435,   344,
-       34,   345,   345,   345,   345,   345,   345,   345,   345,   345,
-       93,    93,    93,    34,    93,   345,   345,   345,  -435,    93,
-       93,    93,    93,    93,    93,   262,   -64,   -64,  -435,  -435,
-     -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,   271,  -435,
-     -435,   -64,  -435,  -435,  -435,  -435,  -435,  -435,  -435,   280,
-      282,   286,   287,    93,    93,    93,    93,    93,    93,    93,
-       93,   248,   290,   293,   294,   300,   301,   309,   320,   324,
-     -435,   358,  -435,    93,    93,    93,    93,   248,    93,    93,
-       93,   186,   360,   377,   379,   380,   381,   403,   405,   407,
-      -67,    93,  -435,    93,    93,    93,   186,    93,  -435,    93,
-       93,    93,  -435,   403,   411,   413,    77,   417,   419,   421,
-      422,  -435,    93,    93,    93,    93,    93,   186,  -435,    93,
-      423,   424,   425,   426,   421,   244,   432,    93,   186,   181,
-       93,   186,  -435,    93,   424,   121,   361,   433,   132,   436,
-      181,   186,  -435,  -435,    93,   186,    93,   361,   244,   437,
-      244,   438,  -435,    93,   186,     9,   244,   186,  -435,   134,
-      361,  -435
 -    -524,    22,     3,  -524,  -524,  -524,  -524,  -524,  -524,  -524,
 -     222,   222,   222,   288,   222,  -524,  -524,   -56,  -524,   387,
 -    -524,   361,   459,   222,  -524,  -524,  -524,  -524,   407,  -524,
 -     361,   222,   222,   222,   222,   222,   222,   222,  -524,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,
 -    -524,  -524,   341,   -67,  -524,    82,  -524,   442,   455,   335,
 -     229,   229,  -524,  -524,   459,   343,   343,    80,    80,   459,
 -     459,   343,   343,   459,   343,   343,   343,    80,   343,   343,
 -     222,   222,   222,  -524,  -524,  -524,   222,  -524,   -44,   -45,
 -    -524,  -524,  -524,  -524,    18,  -524,  -524,  -524,   -24,   -16,
 -     187,   192,  -524,  -524,   258,  -524,  -524,  -524,    11,  -524,
 -    -524,  -524,  -524,    28,  -524,  -524,    85,  -524,    41,   222,
 -     222,  -524,  -524,  -524,  -524,   222,   222,   222,   222,   222,
 -     222,   222,  -524,   222,   222,  -524,    26,  -524,  -524,  -524,
 -    -524,   388,   -52,    56,    59,   283,   328,    91,    93,  -524,
 -    -524,  -524,  -524,  -524,   -27,  -524,  -524,   109,  -524,   111,
 -    -524,  -524,  -524,    57,   222,   222,    -5,   139,  -524,    -1,
 -     169,  -524,   222,   222,   207,  -524,  -524,   198,   222,   222,
 -    -524,  -524,  -524,  -524,   436,   132,   135,   -44,  -524,   147,
 -     160,  -524,   164,   166,   170,    -7,  -524,   188,   188,  -524,
 -    -524,   222,   222,   222,   242,     8,   222,  -524,   222,    35,
 -     222,   222,  -524,   -11,   199,  -524,  -524,  -524,   212,   147,
 -     147,   147,   147,   147,   147,   147,  -524,   246,   247,   254,
 -     247,  -524,   259,   261,   -30,  -524,   222,  -524,  -524,  -524,
 -    -524,  -524,  -524,  -524,   269,  -524,   273,   222,  -524,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,   222,   222,   222,   222,
 -     270,  -524,  -524,  -524,  -524,   199,   183,   222,    32,   316,
 -      12,    12,  -524,  -524,  -524,  -524,  -524,  -524,   327,   313,
 -    -524,   315,   247,  -524,  -524,   320,  -524,  -524,  -524,  -524,
 -     322,  -524,  -524,  -524,  -524,   288,    12,   298,  -524,   298,
 -     561,   183,   222,    32,   413,    12,    12,  -524,  -524,  -524,
 -    -524,  -524,  -524,    52,  -524,   222,   210,   432,  -524,   -19,
 -      12,    32,   462,   462,   462,   462,   462,   462,   462,   462,
 -     462,   222,   222,   222,    32,   222,   462,   462,   462,  -524,
 -    -524,   349,  -524,  -524,   298,   298,   579,  -524,   384,   247,
 -    -524,   385,  -524,  -524,  -524,  -524,   -44,   -44,  -524,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,   394,  -524,
 -    -524,   -44,  -524,  -524,  -524,  -524,  -524,   482,    32,   483,
 -     483,   483,   483,   483,   483,   483,   483,   483,   222,   222,
 -     222,    32,   222,   483,   483,   483,  -524,   222,   222,   222,
 -     222,   222,   222,   405,   -44,   -44,  -524,  -524,  -524,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,   411,  -524,  -524,   -44,
 -    -524,  -524,  -524,  -524,  -524,  -524,  -524,   415,   424,   430,
 -     439,   222,   222,   222,   222,   222,   222,   222,   222,   216,
 -     441,   443,   444,   445,   453,   460,   461,   463,  -524,   466,
 -    -524,   222,   222,   222,   222,   216,   222,   222,   222,    12,
 -     476,   477,   478,   480,   484,   485,   486,   488,     9,   222,
 -    -524,   222,   222,   222,    12,   222,  -524,   222,   222,   222,
 -    -524,   485,   489,   527,    58,   536,   537,   538,   539,  -524,
 -     222,   222,   222,   222,   222,    12,  -524,   222,   540,   538,
 -     544,   546,   538,    67,   547,   222,   212,   222,    12,  -524,
 -      12,   222,   538,   219,   548,   106,   298,   552,   212,  -524,
 -    -524,   222,    12,   222,   219,   556,   298,   559,  -524,   222,
 -      12,   131,   298,    12,  -524,   126,   219,  -524
++    -523,     5,    13,  -523,  -523,  -523,  -523,  -523,  -523,  -523,
++     284,   284,   284,    93,   284,  -523,  -523,   -69,  -523,   600,
++    -523,   392,   639,   284,  -523,  -523,  -523,  -523,   554,  -523,
++     392,   284,   284,   284,   284,   284,   284,   284,  -523,  -523,
++    -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,
++    -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,
++    -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,
++    -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,
++    -523,  -523,   122,   -66,  -523,   108,  -523,   391,   357,   138,
++      27,    27,  -523,  -523,   639,   524,   524,    33,    33,   639,
++     639,   524,   524,   639,   524,   524,   524,    33,   524,   524,
++     284,   284,   284,  -523,  -523,  -523,   284,  -523,   -58,   210,
++    -523,  -523,  -523,  -523,   242,  -523,  -523,  -523,    35,    42,
++     254,   273,  -523,  -523,   448,  -523,  -523,  -523,    50,  -523,
++    -523,  -523,  -523,    59,  -523,  -523,   159,  -523,    19,   284,
++     284,  -523,  -523,  -523,  -523,   284,   284,   284,   284,   284,
++     284,   284,  -523,   284,   284,  -523,   171,  -523,  -523,  -523,
++    -523,   267,   -67,    75,    78,   -10,   172,    88,   104,  -523,
++    -523,  -523,  -523,  -523,     1,  -523,  -523,   116,  -523,   121,
++    -523,  -523,  -523,    63,   284,   284,     0,   184,  -523,     2,
++     211,  -523,   284,   284,   231,  -523,  -523,   287,   284,   284,
++    -523,  -523,  -523,  -523,   311,   157,   162,   -58,  -523,   166,
++     167,  -523,   170,   176,   185,   203,  -523,   198,   198,  -523,
++    -523,   284,   284,   284,   131,   214,   284,  -523,   284,   221,
++     284,   284,  -523,   201,   405,  -523,  -523,  -523,   226,   166,
++     166,   166,   166,   166,   166,   166,  -523,   230,   233,   234,
++     233,  -523,   245,   246,    51,  -523,   284,  -523,  -523,  -523,
++    -523,  -523,  -523,  -523,   247,  -523,   376,   284,  -523,  -523,
++    -523,  -523,  -523,  -523,  -523,  -523,   284,   284,   284,   284,
++     325,  -523,  -523,  -523,  -523,   405,   206,   284,    39,   329,
++     294,   294,  -523,  -523,  -523,  -523,  -523,  -523,   432,   249,
++    -523,   256,   233,  -523,  -523,   259,  -523,  -523,  -523,  -523,
++     261,  -523,  -523,  -523,  -523,   284,   294,   265,   600,   265,
++     563,   206,   284,    39,   351,   294,   294,  -523,  -523,  -523,
++    -523,  -523,  -523,    97,  -523,   284,   217,   352,   391,  -523,
++      -4,   554,   294,    39,   353,   353,   353,   353,   353,   353,
++     353,   353,   353,   284,   284,   284,    39,   284,   353,   353,
++     353,  -523,  -523,   271,  -523,  -523,   265,   265,   581,  -523,
++     275,   233,  -523,   276,  -523,  -523,  -523,  -523,   -58,   -58,
++    -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,
++     286,  -523,  -523,   -58,  -523,  -523,  -523,  -523,  -523,   354,
++      39,   360,   360,   360,   360,   360,   360,   360,   360,   360,
++     284,   284,   284,    39,   284,   360,   360,   360,  -523,   284,
++     284,   284,   284,   284,   284,   289,   -58,   -58,  -523,  -523,
++    -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,   290,  -523,
++    -523,   -58,  -523,  -523,  -523,  -523,  -523,  -523,  -523,   293,
++     296,   297,   299,   284,   284,   284,   284,   284,   284,   284,
++     284,   238,   301,   302,   305,   307,   308,   319,   323,   324,
++    -523,   328,  -523,   284,   284,   284,   284,   238,   284,   284,
++     284,   294,   330,   331,   332,   333,   340,   359,   361,   364,
++     -64,   284,  -523,   284,   284,   284,   294,   284,  -523,   284,
++     284,   284,  -523,   359,   365,   366,   -23,   367,   378,   379,
++     380,  -523,   284,   284,   284,   284,   284,   294,  -523,   284,
++     396,   379,   404,   407,   379,   -20,   411,   284,   226,   284,
++     294,  -523,   294,   284,   379,   313,   413,    28,   265,   417,
++     226,  -523,  -523,   284,   294,   284,   313,   436,   265,   440,
++    -523,   284,   294,   152,   265,   294,  -523,    80,   313,  -523
  };
  
  /* YYPGOTO[NTERM-NUM].  */
  static const short yypgoto[] =
  {
-     -435,  -435,  -435,  -435,  -435,   479,  -282,  -288,   368,  -435,
-     -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,  -435,
-     -435,  -435,   195,  -435,   237,  -435,  -435,  -435,   210,  -116,
-       20,  -435,   229,     2,   -10,  -259,    52,  -435,  -435,  -435,
-     -435,   242,  -133,  -434,  -387,  -435,  -435,  -435,   315,  -435,
-      117,  -435,   312,  -435,  -435,  -435,  -435,  -435,  -435,  -170,
-     -435,  -435,  -435,   276,  -435,  -435,  -435,  -435,  -435,   586,
-     -435,  -435,   -19,  -246,  -245,  -197,  -360,  -435,   569,  -226,
-       -2,    22,   -12
 -    -524,  -524,  -524,  -524,  -524,   534,  -276,  -110,   525,  -524,
 -    -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,  -524,
 -    -524,  -524,   425,  -524,   359,  -524,  -524,  -524,   208,     4,
 -     144,  -524,   348,  -402,  -292,   172,  -524,  -524,  -524,  -524,
 -     211,   128,  -356,  -523,  -524,  -524,  -524,   423,  -524,   -72,
 -    -524,   420,  -524,  -524,  -524,  -524,  -524,  -524,  -169,  -524,
 -    -524,  -524,   397,  -524,  -524,  -524,  -524,  -524,   404,  -524,
 -    -524,   -20,  -249,  -248,  -236,  -358,  -524,   542,  -234,    -2,
 -     400,    20
++    -523,  -523,  -523,  -523,  -523,   369,  -283,  -292,   468,  -523,
++    -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,  -523,
++    -523,  -523,   306,  -523,   241,  -523,  -523,  -523,   295,  -116,
++      12,  -523,   232,  -522,  -286,    52,  -523,  -523,  -523,  -523,
++     255,  -112,  -328,  -416,  -523,  -523,  -523,   303,  -523,  -113,
++    -523,   304,  -523,  -523,  -523,  -523,  -523,  -523,  -170,  -523,
++    -523,  -523,   278,  -523,  -523,  -523,  -523,  -523,   582,  -523,
++    -523,   -19,  -272,  -269,  -214,  -396,  -523,   462,  -228,    -2,
++      20,   -12
  };
  
  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
     positive, shift that token.  If negative, reduce the rule which
     number is the opposite.  If zero, do what YYDEFACT says.
     If YYTABLE_NINF, syntax error.  */
- #define YYTABLE_NINF -243
+ #define YYTABLE_NINF -241
  static const short yytable[] =
  {
-       18,    27,   193,    82,   167,   168,   169,     3,   204,   170,
-      204,   290,   259,   116,   318,   192,   352,     5,     6,   187,
-      217,    83,    29,   210,   211,   212,   511,   145,   213,   145,
-      304,   305,    24,    25,    26,   165,    28,   149,     5,     6,
-      321,   317,   329,     5,     6,   374,   220,   233,   205,   372,
-      291,    36,    37,    87,    88,    89,    90,    91,    92,    93,
-      309,   311,   340,   341,   150,   388,   163,   350,   164,  -219,
-      352,   194,  -219,  -219,   219,   119,   376,   377,   403,   306,
-      130,   131,   386,   118,     4,     5,     6,   171,     7,  -219,
-      218,     5,     6,   387,   188,   128,   129,     5,     6,    10,
-       11,     8,   567,    12,    13,   138,   214,    14,   141,   142,
-      143,   342,     5,     6,   144,   222,   221,   190,   191,   380,
-       10,    11,   436,   562,    12,    13,     5,     6,    14,   317,
-      110,   568,   225,   111,   112,   451,   571,   195,    73,    74,
-       75,    76,    77,    78,    79,     9,   202,   173,   174,   203,
-      147,   208,   546,   177,   178,   179,   180,   181,   182,   183,
-      352,   185,   186,   557,   189,   209,   207,    10,    11,   231,
-      524,    12,    13,    10,    11,    14,   232,    12,    13,    10,
-       11,    14,   570,    12,    13,   234,   553,    14,   236,   117,
-        5,     6,   215,   216,    10,    11,   238,   553,    12,    13,
-      223,   224,    14,   240,   352,   553,   227,   228,    10,    11,
-      553,   241,    12,    13,   551,   352,    14,   352,   431,   432,
-      250,   251,   252,   265,   242,   555,   266,   277,   267,   247,
-      248,   249,   500,   434,   258,   244,   260,   110,   262,   263,
-      111,   112,     5,     6,   382,   253,   254,   516,   401,   402,
-      255,   405,     5,     6,   480,   296,   151,   148,   196,   197,
-      153,   297,   199,   200,   294,   198,   464,   465,   535,   201,
-      229,   230,    10,    11,   277,   307,    12,   325,   286,   545,
-      326,   467,   548,  -242,   310,   312,   313,   314,   449,   450,
-      110,   453,   558,   111,   112,   320,   560,   287,   298,   299,
-      110,   300,   301,   111,   112,   566,   288,   289,   569,     5,
-        6,   110,   295,   349,   111,   112,   315,   324,   343,   345,
-      302,   346,   328,   328,    10,    11,   347,   352,    12,    13,
-      373,   151,    14,   375,    10,    11,   385,   389,    12,    13,
-      409,   379,    14,   381,   384,   429,   430,   348,   351,   433,
-      435,   437,   250,   251,   252,   463,   110,   328,   328,   111,
-      112,   400,   400,   400,   466,   400,   279,   280,   281,   282,
-      283,   284,   285,   468,   328,   469,   153,   253,   254,   470,
-      471,   110,   255,   483,   111,   112,   484,   485,   120,   121,
-      122,    10,    11,   486,   487,    12,    13,    38,    86,    14,
-       39,   226,   488,    40,    41,    42,    43,    44,    45,    46,
-       47,    48,    49,   489,    50,    51,    52,   490,   448,   448,
-      448,  -219,   448,   246,  -219,  -219,   344,   457,   458,   459,
-      460,   461,   462,    73,    74,    75,    76,    77,    78,    79,
-      268,  -219,    34,    35,    36,    37,   331,   269,   270,   271,
-      272,   491,   332,   501,   273,    32,    33,    34,    35,    36,
-       37,   472,   473,   474,   475,   476,   477,   478,   479,   482,
-      503,    53,   504,   505,   506,    54,    33,    34,    35,    36,
-       37,   492,   493,   494,   495,   482,   497,   498,   499,   333,
-      334,   110,   335,   336,   111,   112,   507,    30,   509,   512,
-      510,   513,   514,   515,   522,   517,   523,   518,   519,   520,
-      525,   337,   526,   328,   527,   529,   537,   538,   540,   541,
-      530,   531,   532,   533,   534,   543,   554,   536,   328,   556,
-      563,   564,   316,   521,   550,   544,   542,   338,   547,   496,
-      292,   549,   155,   156,   157,   158,   159,   160,   161,   328,
-      256,   261,   559,     0,   561,     0,     0,   162,     0,     0,
-      328,   565,     0,   328,     0,   391,   392,   393,   394,   395,
-      396,   397,   398,   328,     0,     0,     0,   328,   406,   407,
-      408,     0,     0,     0,     0,     0,   328,     0,     0,   328,
-      353,   354,   355,   356,   357,   358,   359,   360,   361,   362,
-      363,   364,   365,   366,   367,   368,   369,   370,   410,   411,
-      412,   413,   414,   415,   416,   417,   418,   419,   420,   421,
-      422,   423,   424,   425,   426,   427,    94,    95,    96,    97,
-       98,    99,   100,   101,   102,   103,   104,   105,   106,   107,
-      108,    31,    32,    33,    34,    35,    36,    37,   371,     0,
-        0,   109,     0,    84,   439,   440,   441,   442,   443,   444,
-      445,   446,     0,     0,     0,   127,   428,   454,   455,   456,
-      132,   133,     0,   135,   136,   137,     0,   139,   140,    31,
-       32,    33,    34,    35,    36,    37,    73,    74,    75,    76,
-       77,    78,    79
 -      18,   217,    82,   193,   259,   220,     4,     5,     6,   329,
 -       7,   204,   290,   543,   204,   110,     5,     6,   111,   112,
 -     318,    83,     3,     8,    29,   554,   116,   304,   305,   192,
 -       5,     6,   187,    27,   349,   147,     5,     6,   321,   317,
 -     306,   145,   566,   374,   375,   167,   168,   169,   233,   145,
 -     170,   291,   309,   311,   205,   370,     5,     6,   385,   340,
 -     341,   210,   211,   212,   350,   265,   213,     9,   266,   149,
 -     267,   218,   342,   242,   119,   221,   384,   150,   110,   130,
 -     131,   111,   112,   118,     5,     6,     5,     6,   151,    10,
 -      11,   165,   350,    12,    13,   128,   129,    14,   148,   250,
 -     251,   252,   509,   325,   163,   138,   326,   188,   141,   142,
 -     143,   378,    10,    11,   144,   153,    12,    13,    10,    11,
 -      14,   164,    12,    13,   253,   254,    14,   536,   171,   255,
 -     539,    73,    74,    75,    76,    77,    78,    79,    10,    11,
 -     548,   350,    12,    13,   214,   219,    14,   173,   174,   194,
 -     350,   522,   195,   177,   178,   179,   180,   181,   182,   183,
 -     540,   185,   186,   117,   189,   207,    10,    11,    10,    11,
 -      12,    13,    12,    13,    14,   222,    14,   279,   280,   281,
 -     282,   283,   284,   285,   202,   550,   203,     5,     6,   350,
 -     317,  -217,   215,   216,  -217,  -217,   550,   498,   558,   552,
 -     223,   224,   208,   550,   209,   564,   227,   228,   550,   350,
 -     567,  -217,   514,   225,     5,     6,   380,   429,   430,   277,
 -       5,     6,   478,   372,   563,   231,     5,     6,   232,   247,
 -     248,   249,   432,   533,   258,   268,   260,   344,   262,   263,
 -     234,   386,   269,   270,   271,   272,   545,   110,   546,   273,
 -     111,   112,   110,   236,   401,   111,   112,   238,   110,   240,
 -     556,   111,   112,   241,   294,   462,   463,   151,   562,    10,
 -      11,   565,   153,    12,    13,   307,   315,    14,   226,  -217,
 -     465,   244,  -217,  -217,   310,   312,   313,   314,   296,   250,
 -     251,   252,     5,     6,   297,   320,    10,    11,   434,  -217,
 -      12,    13,    10,    11,    14,   277,    12,    13,    10,    11,
 -      14,   449,    12,    13,   253,   254,    14,    36,    37,   255,
 -     328,   328,   324,   155,   156,   157,   158,   159,   160,   161,
 -     371,   298,   299,   110,   300,   301,   111,   112,   162,   286,
 -    -240,   377,   331,   379,   382,   348,   328,   287,   332,   120,
 -     121,   122,   288,   302,   289,   328,   328,   196,   197,   398,
 -     398,   398,   295,   398,   198,    38,   399,   400,    39,   403,
 -     328,    40,    41,    42,    43,    44,    45,    46,    47,    48,
 -      49,   350,    50,    51,    52,   333,   334,   110,   335,   336,
 -     111,   112,   190,   191,    73,    74,    75,    76,    77,    78,
 -      79,   110,   199,   200,   111,   112,   343,   337,   345,   201,
 -      24,    25,    26,   346,    28,   347,   446,   446,   446,   373,
 -     446,    34,    35,    36,    37,   455,   456,   457,   458,   459,
 -     460,    87,    88,    89,    90,    91,    92,    93,   383,    53,
 -     229,   230,   407,    54,    94,    95,    96,    97,    98,    99,
 -     100,   101,   102,   103,   104,   105,   106,   107,   108,   470,
 -     471,   472,   473,   474,   475,   476,   477,   480,   387,   109,
 -      31,    32,    33,    34,    35,    36,    37,   427,   428,   490,
 -     491,   492,   493,   480,   495,   496,   497,   431,   433,   435,
 -      31,    32,    33,    34,    35,    36,    37,   510,   461,   511,
 -     512,   513,    84,   515,   464,   516,   517,   518,   466,   328,
 -      73,    74,    75,    76,    77,    78,    79,   467,   528,   529,
 -     530,   531,   532,   468,   328,   534,    32,    33,    34,    35,
 -      36,    37,   469,   542,   481,   544,   482,   483,   484,   547,
 -      33,    34,    35,    36,    37,   328,   485,   447,   448,   555,
 -     451,   557,    30,   486,   487,    86,   488,   561,   328,   489,
 -     328,   389,   390,   391,   392,   393,   394,   395,   396,   499,
 -     501,   502,   328,   503,   404,   405,   406,   504,   505,   507,
 -     328,   508,   520,   328,   351,   352,   353,   354,   355,   356,
++      18,    27,   193,    82,   304,     3,   217,   305,   220,   538,
++     259,    29,   541,   318,   192,   329,     4,     5,     6,   352,
++       7,    83,   550,   167,   168,   169,   145,   116,   170,   511,
++      24,    25,    26,     8,    28,   145,   340,     5,     6,   341,
++     350,   374,   204,     5,     6,   321,   317,   233,   372,   376,
++     377,    87,    88,    89,    90,    91,    92,    93,   309,   311,
++     352,   388,   306,   352,   196,   197,   387,   210,   211,   212,
++     524,   198,   213,   542,   403,   119,   218,     9,   221,   352,
++     130,   131,   205,   118,    73,    74,    75,    76,    77,    78,
++      79,   386,   204,   290,   342,   128,   129,     5,     6,    10,
++      11,     5,     6,    12,    13,   138,   171,    14,   141,   142,
++     143,   352,     5,     6,   144,    36,    37,   380,   436,    10,
++      11,   554,   545,    12,    13,    10,    11,    14,   149,    12,
++      13,   451,   291,    14,   556,   150,   279,   280,   281,   282,
++     283,   284,   285,   163,   250,   251,   252,   173,   174,   552,
++     214,   568,   164,   177,   178,   179,   180,   181,   182,   183,
++     552,   185,   186,   352,   189,   165,   207,   552,   194,   253,
++     254,   195,   552,   277,   255,     5,     6,   187,   250,   251,
++     252,   202,   110,    10,    11,   111,   112,    12,    13,   117,
++     219,    14,   215,   216,    10,    11,   344,   203,    12,    13,
++     223,   224,    14,   253,   254,   500,   227,   228,   255,   208,
++       5,     6,  -217,   317,   209,  -217,  -217,   222,   431,   432,
++     516,     5,     6,   382,    34,    35,    36,    37,   560,   247,
++     248,   249,  -217,   434,   258,   566,   260,   225,   262,   263,
++     569,   535,     5,     6,   480,   565,   199,   200,   401,   402,
++     231,   405,   188,   201,   547,   232,   548,    10,    11,   234,
++     236,    12,    13,   238,   294,    14,   464,   465,   558,   240,
++     110,   190,   191,   111,   112,   307,   564,   265,   241,   567,
++     266,   467,   267,   242,   310,   312,   313,   314,     5,     6,
++     147,   244,    10,    11,   151,   320,    12,    13,     5,     6,
++      14,   153,   110,    10,    11,   111,   112,    12,    13,   449,
++     450,    14,   453,   349,   110,   229,   230,   111,   112,   277,
++     328,   328,   148,   286,    10,    11,  -240,   287,    12,    13,
++     373,   315,    14,   110,   151,   324,   111,   112,   288,   289,
++     295,   379,   343,   381,   384,   348,   351,   110,   352,   345,
++     111,   112,   346,   153,   347,   328,   328,   375,   385,   389,
++     435,   400,   400,   400,   409,   400,   437,   226,   429,   430,
++      10,    11,   328,  -217,    12,    13,  -217,  -217,    14,   433,
++      10,    11,   463,   466,    12,   325,   468,    30,   326,   469,
++     470,   296,   471,  -217,   483,   484,    38,   297,   485,    39,
++     486,   487,    40,    41,    42,    43,    44,    45,    46,    47,
++      48,    49,   488,    50,    51,    52,   489,   490,   448,   448,
++     448,   491,   448,   501,   503,   504,   505,   457,   458,   459,
++     460,   461,   462,   506,   298,   299,   110,   300,   301,   111,
++     112,   268,    33,    34,    35,    36,    37,   331,   269,   270,
++     271,   272,   507,   332,   509,   273,   302,   510,   522,   523,
++     525,   472,   473,   474,   475,   476,   477,   478,   479,   482,
++      53,   526,   527,   529,    54,    32,    33,    34,    35,    36,
++      37,   492,   493,   494,   495,   482,   497,   498,   499,   537,
++     333,   334,   110,   335,   336,   111,   112,   539,    86,   512,
++     540,   513,   514,   515,   543,   517,   553,   518,   519,   520,
++     555,   328,   337,   155,   156,   157,   158,   159,   160,   161,
++     530,   531,   532,   533,   534,   521,   328,   536,   162,   561,
++     120,   121,   122,   562,   246,   544,   316,   546,   256,   496,
++     338,   549,   292,   261,     0,     0,     0,   328,     0,     0,
++       0,   557,     0,   559,     0,     0,     0,     0,   127,   563,
++     328,     0,   328,   132,   133,     0,   135,   136,   137,     0,
++     139,   140,     0,     0,   328,    73,    74,    75,    76,    77,
++      78,    79,   328,     0,     0,   328,   353,   354,   355,   356,
+      357,   358,   359,   360,   361,   362,   363,   364,   365,   366,
 -     367,   368,   408,   409,   410,   411,   412,   413,   414,   415,
++     367,   368,   369,   370,   410,   411,   412,   413,   414,   415,
+      416,   417,   418,   419,   420,   421,   422,   423,   424,   425,
 -     521,   437,   438,   439,   440,   441,   442,   443,   444,   523,
 -     524,   525,   527,   535,   452,   453,   454,   537,   127,   538,
 -     541,   551,   369,   132,   133,   553,   135,   136,   137,   559,
 -     139,   140,   560,   246,   316,   519,   338,   494,   256,   261,
 -     426,   292
++     426,   427,    94,    95,    96,    97,    98,    99,   100,   101,
++     102,   103,   104,   105,   106,   107,   108,    31,    32,    33,
++      34,    35,    36,    37,   371,     0,     0,   109,     0,    84,
++     391,   392,   393,   394,   395,   396,   397,   398,     0,     0,
++       0,     0,   428,   406,   407,   408,     0,   439,   440,   441,
++     442,   443,   444,   445,   446,     0,     0,     0,     0,     0,
++     454,   455,   456,    31,    32,    33,    34,    35,    36,    37,
++      73,    74,    75,    76,    77,    78,    79
  };
  
 -static const unsigned short yycheck[] =
 +static const short yycheck[] =
  {
-        2,    13,   172,    22,     4,     5,     6,     0,    41,     9,
-       41,    42,   238,    93,   296,    81,    83,     4,     5,     6,
-        6,    23,    80,     4,     5,     6,    93,    93,     9,    93,
-      276,   276,    10,    11,    12,     6,    14,    93,     4,     5,
-        6,     7,   301,     4,     5,   333,     6,   217,    81,   331,
-       81,    88,    89,    31,    32,    33,    34,    35,    36,    37,
-      286,   287,   308,   308,    93,   353,    93,   326,    93,    60,
-       83,    93,    63,    64,     6,    94,   335,   336,   366,   276,
-       99,   100,    95,    85,     3,     4,     5,    87,     7,    80,
-       76,     4,     5,   352,    81,    97,    98,     4,     5,    86,
-       87,    20,    93,    90,    91,   107,    87,    94,   110,   111,
-      112,   308,     4,     5,   116,     6,    76,     4,     5,   345,
-       86,    87,   410,   557,    90,    91,     4,     5,    94,     7,
-       60,   565,     6,    63,    64,   423,   570,    93,    51,    52,
-       53,    54,    55,    56,    57,    64,    93,   149,   150,    93,
-       80,    93,   539,   155,   156,   157,   158,   159,   160,   161,
-       83,   163,   164,   550,   166,    93,   185,    86,    87,    93,
-       93,    90,    91,    86,    87,    94,    93,    90,    91,    86,
-       87,    94,   569,    90,    91,    93,   546,    94,    93,    81,
-        4,     5,   194,   195,    86,    87,    93,   557,    90,    91,
-      202,   203,    94,    93,    83,   565,   208,   209,    86,    87,
-      570,    93,    90,    91,    93,    83,    94,    83,   388,   389,
-       47,    48,    49,    76,    80,    93,    79,    93,    81,   231,
-      232,   233,   491,   403,   236,    93,   238,    60,   240,   241,
-       63,    64,     4,     5,     6,    72,    73,   506,   364,   365,
-       77,   367,     4,     5,     6,    15,    80,    80,    74,    75,
-       80,    21,    74,    75,   266,    81,   436,   437,   527,    81,
-        4,     5,    86,    87,    93,   277,    90,    91,    93,   538,
-       94,   451,   541,    93,   286,   287,   288,   289,   421,   422,
-       60,   424,   551,    63,    64,   297,   555,    93,    58,    59,
-       60,    61,    62,    63,    64,   564,    93,    93,   567,     4,
-        5,    60,    93,   325,    63,    64,     6,     6,    93,    93,
-       80,    93,   300,   301,    86,    87,    93,    83,    90,    91,
-      332,    80,    94,     6,    86,    87,     6,     6,    90,    91,
-       93,   343,    94,   345,   346,    93,    93,   325,   326,    93,
-        6,     6,    47,    48,    49,    93,    60,   335,   336,    63,
-       64,   363,   364,   365,    93,   367,   249,   250,   251,   252,
-      253,   254,   255,    93,   352,    93,    80,    72,    73,    93,
-       93,    60,    77,    93,    63,    64,    93,    93,     6,     7,
-        8,    86,    87,    93,    93,    90,    91,     4,    30,    94,
-        7,    80,    93,    10,    11,    12,    13,    14,    15,    16,
-       17,    18,    19,    93,    21,    22,    23,    93,   420,   421,
-      422,    60,   424,   228,    63,    64,   309,   429,   430,   431,
-      432,   433,   434,    51,    52,    53,    54,    55,    56,    57,
-       36,    80,    86,    87,    88,    89,    15,    43,    44,    45,
-       46,    93,    21,    93,    50,    84,    85,    86,    87,    88,
-       89,   463,   464,   465,   466,   467,   468,   469,   470,   471,
-       93,    78,    93,    93,    93,    82,    85,    86,    87,    88,
-       89,   483,   484,   485,   486,   487,   488,   489,   490,    58,
-       59,    60,    61,    62,    63,    64,    93,    18,    93,   501,
 -       2,     6,    22,   172,   238,     6,     3,     4,     5,   301,
 -       7,    41,    42,   536,    41,    60,     4,     5,    63,    64,
 -     296,    23,     0,    20,    80,   548,    93,   276,   276,    81,
 -       4,     5,     6,    13,   326,    80,     4,     5,     6,     7,
 -     276,    93,   565,   335,   336,     4,     5,     6,   217,    93,
 -       9,    81,   286,   287,    81,   331,     4,     5,   350,   308,
 -     308,     4,     5,     6,    83,    76,     9,    64,    79,    93,
 -      81,    76,   308,    80,    94,    76,    95,    93,    60,    99,
 -     100,    63,    64,    85,     4,     5,     4,     5,    80,    86,
 -      87,     6,    83,    90,    91,    97,    98,    94,    80,    47,
 -      48,    49,    93,    91,    93,   107,    94,    81,   110,   111,
 -     112,   345,    86,    87,   116,    80,    90,    91,    86,    87,
 -      94,    93,    90,    91,    72,    73,    94,   529,    87,    77,
 -     532,    51,    52,    53,    54,    55,    56,    57,    86,    87,
 -     542,    83,    90,    91,    87,     6,    94,   149,   150,    93,
 -      83,    93,    93,   155,   156,   157,   158,   159,   160,   161,
 -      93,   163,   164,    81,   166,   185,    86,    87,    86,    87,
 -      90,    91,    90,    91,    94,     6,    94,   249,   250,   251,
 -     252,   253,   254,   255,    93,   543,    93,     4,     5,    83,
 -       7,    60,   194,   195,    63,    64,   554,   489,   554,    93,
 -     202,   203,    93,   561,    93,   561,   208,   209,   566,    83,
 -     566,    80,   504,     6,     4,     5,     6,   386,   387,    93,
 -       4,     5,     6,   333,    93,    93,     4,     5,    93,   231,
 -     232,   233,   401,   525,   236,    36,   238,   309,   240,   241,
 -      93,   351,    43,    44,    45,    46,   538,    60,   540,    50,
 -      63,    64,    60,    93,   364,    63,    64,    93,    60,    93,
 -     552,    63,    64,    93,   266,   434,   435,    80,   560,    86,
 -      87,   563,    80,    90,    91,   277,     6,    94,    80,    60,
 -     449,    93,    63,    64,   286,   287,   288,   289,    15,    47,
 -      48,    49,     4,     5,    21,   297,    86,    87,   408,    80,
 -      90,    91,    86,    87,    94,    93,    90,    91,    86,    87,
 -      94,   421,    90,    91,    72,    73,    94,    88,    89,    77,
 -     300,   301,     6,    65,    66,    67,    68,    69,    70,    71,
 -     332,    58,    59,    60,    61,    62,    63,    64,    80,    93,
 -      93,   343,    15,   345,   346,   325,   326,    93,    21,     6,
 -       7,     8,    93,    80,    93,   335,   336,    74,    75,   361,
 -     362,   363,    93,   365,    81,     4,   362,   363,     7,   365,
 -     350,    10,    11,    12,    13,    14,    15,    16,    17,    18,
 -      19,    83,    21,    22,    23,    58,    59,    60,    61,    62,
 -      63,    64,     4,     5,    51,    52,    53,    54,    55,    56,
 -      57,    60,    74,    75,    63,    64,    93,    80,    93,    81,
 -      10,    11,    12,    93,    14,    93,   418,   419,   420,     6,
 -     422,    86,    87,    88,    89,   427,   428,   429,   430,   431,
 -     432,    31,    32,    33,    34,    35,    36,    37,     6,    78,
 -       4,     5,    93,    82,    40,    41,    42,    43,    44,    45,
 -      46,    47,    48,    49,    50,    51,    52,    53,    54,   461,
 -     462,   463,   464,   465,   466,   467,   468,   469,     6,    65,
 -      83,    84,    85,    86,    87,    88,    89,    93,    93,   481,
 -     482,   483,   484,   485,   486,   487,   488,    93,     6,     6,
 -      83,    84,    85,    86,    87,    88,    89,   499,    93,   501,
 -     502,   503,    95,   505,    93,   507,   508,   509,    93,   489,
 -      51,    52,    53,    54,    55,    56,    57,    93,   520,   521,
 -     522,   523,   524,    93,   504,   527,    84,    85,    86,    87,
 -      88,    89,    93,   535,    93,   537,    93,    93,    93,   541,
 -      85,    86,    87,    88,    89,   525,    93,   419,   420,   551,
 -     422,   553,    18,    93,    93,    30,    93,   559,   538,    93,
 -     540,   353,   354,   355,   356,   357,   358,   359,   360,    93,
 -      93,    93,   552,    93,   366,   367,   368,    93,    93,    93,
 -     560,    93,    93,   563,    23,    24,    25,    26,    27,    28,
++       2,    13,   172,    22,   276,     0,     6,   276,     6,   531,
++     238,    80,   534,   296,    81,   301,     3,     4,     5,    83,
++       7,    23,   544,     4,     5,     6,    93,    93,     9,    93,
++      10,    11,    12,    20,    14,    93,   308,     4,     5,   308,
++     326,   333,    41,     4,     5,     6,     7,   217,   331,   335,
++     336,    31,    32,    33,    34,    35,    36,    37,   286,   287,
++      83,   353,   276,    83,    74,    75,   352,     4,     5,     6,
++      93,    81,     9,    93,   366,    94,    76,    64,    76,    83,
++      99,   100,    81,    85,    51,    52,    53,    54,    55,    56,
++      57,    95,    41,    42,   308,    97,    98,     4,     5,    86,
++      87,     4,     5,    90,    91,   107,    87,    94,   110,   111,
++     112,    83,     4,     5,   116,    88,    89,   345,   410,    86,
++      87,    93,   538,    90,    91,    86,    87,    94,    93,    90,
++      91,   423,    81,    94,   550,    93,   249,   250,   251,   252,
++     253,   254,   255,    93,    47,    48,    49,   149,   150,   545,
++      87,   567,    93,   155,   156,   157,   158,   159,   160,   161,
++     556,   163,   164,    83,   166,     6,   185,   563,    93,    72,
++      73,    93,   568,    93,    77,     4,     5,     6,    47,    48,
++      49,    93,    60,    86,    87,    63,    64,    90,    91,    81,
++       6,    94,   194,   195,    86,    87,   309,    93,    90,    91,
++     202,   203,    94,    72,    73,   491,   208,   209,    77,    93,
++       4,     5,    60,     7,    93,    63,    64,     6,   388,   389,
++     506,     4,     5,     6,    86,    87,    88,    89,   556,   231,
++     232,   233,    80,   403,   236,   563,   238,     6,   240,   241,
++     568,   527,     4,     5,     6,    93,    74,    75,   364,   365,
++      93,   367,    81,    81,   540,    93,   542,    86,    87,    93,
++      93,    90,    91,    93,   266,    94,   436,   437,   554,    93,
++      60,     4,     5,    63,    64,   277,   562,    76,    93,   565,
++      79,   451,    81,    80,   286,   287,   288,   289,     4,     5,
++      80,    93,    86,    87,    80,   297,    90,    91,     4,     5,
++      94,    80,    60,    86,    87,    63,    64,    90,    91,   421,
++     422,    94,   424,   325,    60,     4,     5,    63,    64,    93,
++     300,   301,    80,    93,    86,    87,    93,    93,    90,    91,
++     332,     6,    94,    60,    80,     6,    63,    64,    93,    93,
++      93,   343,    93,   345,   346,   325,   326,    60,    83,    93,
++      63,    64,    93,    80,    93,   335,   336,     6,     6,     6,
++       6,   363,   364,   365,    93,   367,     6,    80,    93,    93,
++      86,    87,   352,    60,    90,    91,    63,    64,    94,    93,
++      86,    87,    93,    93,    90,    91,    93,    18,    94,    93,
++      93,    15,    93,    80,    93,    93,     4,    21,    93,     7,
++      93,    93,    10,    11,    12,    13,    14,    15,    16,    17,
++      18,    19,    93,    21,    22,    23,    93,    93,   420,   421,
++     422,    93,   424,    93,    93,    93,    93,   429,   430,   431,
++     432,   433,   434,    93,    58,    59,    60,    61,    62,    63,
++      64,    36,    85,    86,    87,    88,    89,    15,    43,    44,
++      45,    46,    93,    21,    93,    50,    80,    93,    93,    93,
++      93,   463,   464,   465,   466,   467,   468,   469,   470,   471,
++      78,    93,    93,    93,    82,    84,    85,    86,    87,    88,
++      89,   483,   484,   485,   486,   487,   488,   489,   490,    93,
++      58,    59,    60,    61,    62,    63,    64,    93,    30,   501,
 +      93,   503,   504,   505,    93,   507,    93,   509,   510,   511,
-       93,    80,    93,   491,    93,    93,    93,    93,    93,    93,
-      522,   523,   524,   525,   526,    93,    93,   529,   506,    93,
-       93,    93,   295,   513,   544,   537,   534,   308,   540,   487,
-      264,   543,    65,    66,    67,    68,    69,    70,    71,   527,
-      235,   239,   554,    -1,   556,    -1,    -1,    80,    -1,    -1,
-      538,   563,    -1,   541,    -1,   355,   356,   357,   358,   359,
-      360,   361,   362,   551,    -1,    -1,    -1,   555,   368,   369,
-      370,    -1,    -1,    -1,    -1,    -1,   564,    -1,    -1,   567,
-       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
-       33,    34,    35,    36,    37,    38,    39,    40,    23,    24,
-       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-       35,    36,    37,    38,    39,    40,    40,    41,    42,    43,
-       44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
-       54,    83,    84,    85,    86,    87,    88,    89,    81,    -1,
-       -1,    65,    -1,    95,   412,   413,   414,   415,   416,   417,
-      418,   419,    -1,    -1,    -1,    96,    81,   425,   426,   427,
-      101,   102,    -1,   104,   105,   106,    -1,   108,   109,    83,
-       84,    85,    86,    87,    88,    89,    51,    52,    53,    54,
-       55,    56,    57
++      93,   491,    80,    65,    66,    67,    68,    69,    70,    71,
++     522,   523,   524,   525,   526,   513,   506,   529,    80,    93,
++       6,     7,     8,    93,   228,   537,   295,   539,   235,   487,
++     308,   543,   264,   239,    -1,    -1,    -1,   527,    -1,    -1,
++      -1,   553,    -1,   555,    -1,    -1,    -1,    -1,    96,   561,
++     540,    -1,   542,   101,   102,    -1,   104,   105,   106,    -1,
++     108,   109,    -1,    -1,   554,    51,    52,    53,    54,    55,
++      56,    57,   562,    -1,    -1,   565,    23,    24,    25,    26,
++      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
++      37,    38,    39,    40,    23,    24,    25,    26,    27,    28,
+       29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
 -      39,    40,    23,    24,    25,    26,    27,    28,    29,    30,
 -      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
 -      93,   410,   411,   412,   413,   414,   415,   416,   417,    93,
 -      93,    93,    93,    93,   423,   424,   425,    93,    96,    93,
 -      93,    93,    81,   101,   102,    93,   104,   105,   106,    93,
 -     108,   109,    93,   228,   295,   511,   308,   485,   235,   239,
 -      81,   264
++      39,    40,    40,    41,    42,    43,    44,    45,    46,    47,
++      48,    49,    50,    51,    52,    53,    54,    83,    84,    85,
++      86,    87,    88,    89,    81,    -1,    -1,    65,    -1,    95,
++     355,   356,   357,   358,   359,   360,   361,   362,    -1,    -1,
++      -1,    -1,    81,   368,   369,   370,    -1,   412,   413,   414,
++     415,   416,   417,   418,   419,    -1,    -1,    -1,    -1,    -1,
++     425,   426,   427,    83,    84,    85,    86,    87,    88,    89,
++      51,    52,    53,    54,    55,    56,    57
  };
  
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@@ -1302,58 -1294,57 +1300,57 @@@ static const unsigned char yystos[] 
       101,    83,    84,    85,    86,    87,    88,    89,     4,     7,
        10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
        21,    22,    23,    78,    82,   104,   106,   107,   108,   109,
-      110,   111,   112,   113,   114,   115,   116,   121,   133,   143,
-      147,   156,   163,    51,    52,    53,    54,    55,    56,    57,
-      166,   167,   168,   176,    95,   154,   104,   177,   177,   177,
-      177,   177,   177,   177,   165,   165,   165,   165,   165,   165,
-      165,   165,   165,   165,   165,   165,   165,   165,   165,   165,
-       60,    63,    64,   169,   170,   171,    93,    81,   176,   168,
-        6,     7,     8,   105,   168,   172,   174,   174,   176,   176,
-      168,   168,   174,   174,   157,   174,   174,   174,   176,   174,
-      174,   176,   176,   176,   176,    93,   155,    80,    80,    93,
-       93,    80,   144,    80,   148,    65,    66,    67,    68,    69,
+      110,   111,   112,   113,   114,   115,   116,   121,   132,   142,
+      146,   155,   162,    51,    52,    53,    54,    55,    56,    57,
+      165,   166,   167,   175,    95,   153,   104,   176,   176,   176,
+      176,   176,   176,   176,   164,   164,   164,   164,   164,   164,
+      164,   164,   164,   164,   164,   164,   164,   164,   164,   164,
+       60,    63,    64,   168,   169,   170,    93,    81,   175,   167,
+        6,     7,     8,   105,   167,   171,   173,   173,   175,   175,
+      167,   167,   173,   173,   156,   173,   173,   173,   175,   173,
+      173,   175,   175,   175,   175,    93,   154,    80,    80,    93,
+       93,    80,   143,    80,   147,    65,    66,    67,    68,    69,
        70,    71,    80,    93,    93,     6,   117,     4,     5,     6,
-        9,    87,   173,   176,   176,   145,   149,   176,   176,   176,
-      176,   176,   176,   176,   158,   176,   176,     6,    81,   176,
-        4,     5,    81,   155,    93,    93,    74,    75,    81,    74,
-       75,    81,    93,    93,    41,    81,   159,   168,    93,    93,
-        4,     5,     6,     9,    87,   176,   176,     6,    76,     6,
-        6,    76,     6,   176,   176,     6,    80,   176,   176,     4,
-        5,    93,    93,   155,    93,   146,    93,   150,    93,   151,
-       93,    93,    80,   164,    93,   118,   118,   176,   176,   176,
-       47,    48,    49,    72,    73,    77,   144,   175,   176,   175,
-      176,   148,   176,   176,   160,    76,    79,    81,    36,    43,
-       44,    45,    46,    50,   119,   120,   122,    93,   140,   146,
-      146,   146,   146,   146,   146,   146,    93,    93,    93,    93,
-       42,    81,   159,   161,   176,    93,    15,    21,    58,    59,
-       61,    62,    80,   128,   169,   170,   171,   176,   134,   175,
-      176,   175,   176,   176,   176,     6,   120,     7,   102,   176,
-      176,     6,   102,   103,     6,    91,    94,   131,   177,   131,
-      123,    15,    21,    58,    59,    61,    62,    80,   128,   141,
-      169,   170,   171,    93,   146,    93,    93,    93,   177,   178,
-      131,   177,    83,    23,    24,    25,    26,    27,    28,    29,
+        9,    87,   172,   175,   175,   144,   148,   175,   175,   175,
+      175,   175,   175,   175,   157,   175,   175,     6,    81,   175,
+        4,     5,    81,   154,    93,    93,    74,    75,    81,    74,
+       75,    81,    93,    93,    41,    81,   158,   167,    93,    93,
+        4,     5,     6,     9,    87,   175,   175,     6,    76,     6,
+        6,    76,     6,   175,   175,     6,    80,   175,   175,     4,
+        5,    93,    93,   154,    93,   145,    93,   149,    93,   150,
+       93,    93,    80,   163,    93,   118,   118,   175,   175,   175,
+       47,    48,    49,    72,    73,    77,   143,   174,   175,   174,
+      175,   147,   175,   175,   159,    76,    79,    81,    36,    43,
+       44,    45,    46,    50,   119,   120,   122,    93,   139,   145,
+      145,   145,   145,   145,   145,   145,    93,    93,    93,    93,
+       42,    81,   158,   160,   175,    93,    15,    21,    58,    59,
+       61,    62,    80,   128,   168,   169,   170,   175,   133,   174,
+      175,   174,   175,   175,   175,     6,   120,     7,   102,   175,
 -     175,     6,   102,   103,     6,    91,    94,   130,   177,   130,
++     175,     6,   102,   103,     6,    91,    94,   130,   176,   130,
+      123,    15,    21,    58,    59,    61,    62,    80,   128,   140,
 -     168,   169,   170,    93,   145,    93,    93,    93,   177,   130,
 -      83,    23,    24,    25,    26,    27,    28,    29,    30,    31,
 -      32,    33,    34,    35,    36,    37,    38,    39,    40,    81,
 -     102,   175,   103,     6,   130,   130,   134,   175,   174,   175,
 -       6,   161,   175,     6,    95,   130,   103,     6,   124,   124,
 -     124,   124,   124,   124,   124,   124,   124,   125,   175,   125,
 -     125,   103,   127,   125,   124,   124,   124,    93,    23,    24,
 -      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
 -      35,    36,    37,    38,    39,    40,    81,    93,    93,   154,
 -     154,    93,   154,     6,   103,     6,   136,   136,   136,   136,
 -     136,   136,   136,   136,   136,   137,   175,   137,   137,   103,
 -     135,   137,   136,   136,   136,   175,   175,   175,   175,   175,
 -     175,    93,   154,   154,    93,   154,    93,    93,    93,    93,
 -     175,   175,   175,   175,   175,   175,   175,   175,     6,   131,
 -     175,    93,    93,    93,    93,    93,    93,    93,    93,    93,
 -     175,   175,   175,   175,   131,   175,   175,   175,   130,    93,
 -     141,    93,    93,    93,    93,    93,   126,    93,    93,    93,
 -     175,   175,   175,   175,   130,   175,   175,   175,   175,   126,
 -      93,    93,    93,    93,    93,    93,   129,    93,   175,   175,
 -     175,   175,   175,   130,   175,    93,   129,    93,    93,   129,
 -      93,    93,   175,   139,   175,   130,   130,   175,   129,   138,
 -     171,    93,    93,    93,   139,   175,   130,   175,   138,    93,
 -      93,   175,   130,    93,   138,   130,   139,   138
++     168,   169,   170,    93,   145,    93,    93,    93,   176,   177,
++     130,   176,    83,    23,    24,    25,    26,    27,    28,    29,
 +      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
-       40,    81,   102,   176,   103,     6,   131,   131,   135,   176,
-      175,   176,     6,   162,   176,     6,    95,   131,   103,     6,
++      40,    81,   102,   175,   103,     6,   130,   130,   134,   175,
++     174,   175,     6,   161,   175,     6,    95,   130,   103,     6,
 +     124,   124,   124,   124,   124,   124,   124,   124,   124,   125,
-      176,   125,   125,   103,   127,   125,   124,   124,   124,    93,
++     175,   125,   125,   103,   127,   125,   124,   124,   124,    93,
 +      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
 +      33,    34,    35,    36,    37,    38,    39,    40,    81,    93,
-       93,   155,   155,    93,   155,     6,   103,     6,   137,   137,
-      137,   137,   137,   137,   137,   137,   137,   138,   176,   138,
-      138,   103,   136,   138,   137,   137,   137,   176,   176,   176,
-      176,   176,   176,    93,   155,   155,    93,   155,    93,    93,
-       93,    93,   176,   176,   176,   176,   176,   176,   176,   176,
-        6,   132,   176,    93,    93,    93,    93,    93,    93,    93,
-       93,    93,   176,   176,   176,   176,   132,   176,   176,   176,
-      131,    93,   142,    93,    93,    93,    93,    93,   126,    93,
-       93,    93,   176,   176,   176,   176,   131,   176,   176,   176,
-      176,   126,    93,    93,    93,    93,    93,    93,   129,    93,
-      176,   176,   176,   176,   176,   131,   176,    93,    93,   130,
-       93,    93,   129,    93,   176,   131,   140,   176,   131,   176,
-      130,    93,   139,   172,    93,    93,    93,   140,   131,   176,
-      131,   176,   139,    93,    93,   176,   131,    93,   139,   131,
-      140,   139
++      93,   154,   154,    93,   154,     6,   103,     6,   136,   136,
++     136,   136,   136,   136,   136,   136,   136,   137,   175,   137,
++     137,   103,   135,   137,   136,   136,   136,   175,   175,   175,
++     175,   175,   175,    93,   154,   154,    93,   154,    93,    93,
++      93,    93,   175,   175,   175,   175,   175,   175,   175,   175,
++       6,   131,   175,    93,    93,    93,    93,    93,    93,    93,
++      93,    93,   175,   175,   175,   175,   131,   175,   175,   175,
++     130,    93,   141,    93,    93,    93,    93,    93,   126,    93,
++      93,    93,   175,   175,   175,   175,   130,   175,   175,   175,
++     175,   126,    93,    93,    93,    93,    93,    93,   129,    93,
++     175,   175,   175,   175,   175,   130,   175,    93,   129,    93,
++      93,   129,    93,    93,   175,   139,   175,   130,   130,   175,
++     129,   138,   171,    93,    93,    93,   139,   175,   130,   175,
++     138,    93,    93,   175,   130,    93,   138,   130,   139,   138
  };
  
  #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
@@@ -4132,7 -4125,7 +4131,7 @@@ yyreduce
      }
  
  /* Line 999 of yacc.c.  */
- #line 4136 "y.tab.c"
 -#line 4129 "y.tab.c"
++#line 4135 "y.tab.c"
  \f
    yyvsp -= yylen;
    yyssp -= yylen;