#
#   Kernel Make file
#
# Macros defined on command line:
# DEST   - Destination of obj's.
# CFLAGS - DOS version dependent C compiler flags
# AFLAGS - DOS version dependent assembler flags

!INCLUDE ..\makefile.inc

# For DOS.
MAKE=NMAKE


# Uncomment one of the two following lines.  The first disables our
# protected-mode-only Int 21 handlers for testing.  The second is
# the way we ship.
#WOW_QUICK_INT21=
WOW_QUICK_INT21=-DW_Q21

#####################################################################
#                                                                   #
# The command lines in this section MUST AGREE with their parallels #
# in the master CORE makefile.                                      #
#                                                                   #
#####################################################################

!ifndef ALT_PROJECT
ALT_PROJECT=USA
ALT_PROJECT_TARGET=.
!endif

!if !$(FREEBUILD) && "$(ALT_PROJECT)" !=  "NEC_98"
A1FLAGS=-DWOW $(WOW_QUICK_INT21) -DWINDEBUG -DPM386 -DWOW_$(PROCESSOR_ARCHITECTURE) $(DBCS_FLAGS)
CFLAGS=-DWINDEBUG -DPM386 $(DBCS_FLAGS)
!else
A1FLAGS=-DWOW $(WOW_QUICK_INT21) -DPM386 -DWOW_$(PROCESSOR_ARCHITECTURE) $(DBCS_FLAGS)
CFLAGS=-DPM386 $(DBCS_FLAGS)
!endif


# Turn on the PMODE and BUILDDLL flags

MAP=map/li/warnfixup

WOWINC  = ..\..\inc
AINC = -I..\inc -I$(WOWINC)
CINC = -I..\inc -I$(WOWINC) -I$(SDK_INC_PATH)
RCINC=..\inc;$(WOWINC);$(SDK_INC_PATH)

#make sure the tools can see all the right files
PATH    = .\$(DEST);$(PATH)



##########

#
#  Standard command line definitions
#

AFLAGS = $(A1FLAGS) -s -t -P -W0

# flags for kernstub.asm compiles (no protect mode)
KSAFLAGS = -I..\..\.. -I..\..\..\..\inc -I..\..\..\..\..\inc $(A1FLAGS) -DPMODE=0 -DBUILDDLL -s -t -P -W2


#
# -Zi gives exes larger than 600K, so use -Zd
#
!if !$(FREEBUILD)
AFLAGS  = $(AFLAGS) -Zd
CFLAGS  = $(CFLAGS) -Od -Oi -Zd
LDEBUG  = /LI
!endif

ASMCMD = $(ASM) $(AINC) $(AFLAGS)


CP_FLAGS = -c -Asnw -G2sc -Oase -Zpe -W2 -Fo$*.obj $(CFLAGS)
CPF_FLAGS = -c -DWOW -Alnw -G2sc -Oase -Zpe -W2 -Fo$*.obj $(CFLAGS)

CP = $(CL) $(CP_FLAGS)
CPF = $(CL) $(CPF_FLAGS)


##############################################################################

# (leave a blank line above this one)
#
#  The Assembler File List
#
all: makedir setenv oldobjs $(DEST)\kernel.exe $(DEST)\krnl386.sym
    -binplace -o $(ALT_PROJECT_TARGET) $(DEST)\krnl386.exe
    -binplace -o $(ALT_PROJECT_TARGET) $(DEST)\krnl386.sym
    -binplace -o $(ALT_PROJECT_TARGET) $(DEST)\krnl386.map

makedir:
    @-if not exist $(DEST) md $(DEST)

setenv:
    set include=$(ENVINCS);$(INCLUDE)

oldobjs:
    @if exist strings.asm del strings.asm

clean: all

OBJ  = $(DEST)\winexec.obj      \
       $(DEST)\kdata.obj        \
       $(DEST)\ldboot.obj       \
       $(DEST)\ldutil.obj       \
       $(DEST)\ldfile.obj       \
       $(DEST)\ldseg.obj        \
       $(DEST)\ldreloc.obj      \
       $(DEST)\ldint.obj        \
       $(DEST)\gpfix.obj        \
       $(DEST)\ldopen.obj       \
       $(DEST)\ld.obj           \
       $(DEST)\ldaux.obj        \
       $(DEST)\ldcache.obj      \
       $(DEST)\lddebug.obj      \
       $(DEST)\ldfastb.obj      \
       $(DEST)\stack.obj        \
       $(DEST)\mapdata.obj      \
       $(DEST)\kdataend.obj     \
       $(DEST)\ldstack.obj      \
       $(DEST)\ldheader.obj     \
       $(DEST)\resaux.obj       \
       $(DEST)\strings.obj      \
       $(DEST)\ripaux.obj       \
       $(DEST)\module.obj       \
       $(DEST)\task.obj         \
       $(DEST)\context.obj      \
       $(DEST)\i21file.obj      \
       $(DEST)\int24.obj        \
       $(DEST)\dosinit.obj      \
       $(DEST)\atom.obj         \
       $(DEST)\diskio.obj       \
       $(DEST)\lstring.obj      \
       $(DEST)\hmem.obj         \
       $(DEST)\userpro.obj      \
       $(DEST)\handle.obj       \
       $(DEST)\lacheck.obj      \
       $(DEST)\lalloc.obj       \
       $(DEST)\lcompact.obj     \
       $(DEST)\linterf.obj      \
       $(DEST)\lhandle.obj      \
       $(DEST)\i21entry.obj     \
       $(DEST)\i21task.obj      \
       $(DEST)\ldappl.obj       \
       $(DEST)\ldself.obj       \
       $(DEST)\rip.obj          \
       $(DEST)\intnn.obj        \
       $(DEST)\enable.obj       \
       $(DEST)\miscapi.obj      \
       $(DEST)\lzexp.obj        \
       $(DEST)\rom.obj          \
       $(DEST)\layer.obj        \
       $(DEST)\error.obj        \
       $(DEST)\diag.obj         \
       $(DEST)\wow16cal.obj     \
       $(DEST)\kthunks.obj      \
       $(DEST)\wowdeb.obj       \
       $(DEST)\tasking.obj      \
       $(DEST)\selman.obj       \
       $(DEST)\kflatstb.obj

OBJ3 = $(DEST)\3glru.obj        \
       $(DEST)\3gmemini.obj     \
       $(DEST)\3gmoreme.obj     \
       $(DEST)\3protect.obj     \
       $(DEST)\3gacheck.obj     \
       $(DEST)\3galloc.obj      \
       $(DEST)\3gcompac.obj     \
       $(DEST)\3ginterf.obj     \
       $(DEST)\3gmem.obj        \
       $(DEST)\gpcont.obj       \
       $(DEST)\disasm.obj       \
       $(DEST)\patch.obj        \
       $(DEST)\reboot.obj      \
       $(DEST)\kold.obj


$(DEST)\kernel.exe: $(LINKFILE) kernel.def $(DEST)\kernstub.exe $(OBJ) $(OBJ3) \
                    $(DEST)\krnl386.res
    @echo $(DEST)\kdata+ >$(DEST)\tmp.lnk
    @echo $(DEST)\strings+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\atom+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\context+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\dosinit+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\i21file+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\i21task+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ld+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldaux+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldboot+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\lddebug+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldopen+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldutil+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\lstring+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\reboot+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\userpro+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\winexec+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\wow16cal+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldint+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\stack+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\mapdata+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\layer+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldfastb+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3gmemini+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldself+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\int24+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\diskio+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3ginterf+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\intnn+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\i21entry+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3protect+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3gmoreme+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3gcompac+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\lhandle+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3galloc+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3glru+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3gmem+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\handle+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\kold+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldfile+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\gpfix+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\hmem+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\module+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldheader+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldcache+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldreloc+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldappl+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldseg+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\tasking+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\task+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ldstack+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\resaux+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\linterf+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\lcompact+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\lalloc+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\ripaux+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\rip+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\3gacheck+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\lacheck+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\rom+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\enable+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\miscapi+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\lzexp+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\error+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\gpcont+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\disasm+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\patch+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\diag+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\kthunks+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\wowdeb+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\kdataend+ >>$(DEST)\tmp.lnk
    @echo $(DEST)\selman+  >>$(DEST)\tmp.lnk
    @echo $(DEST)\kflatstb >>$(DEST)\tmp.lnk
    @echo $(DEST)\kernel.exe/align:16/warnfixup/farcall/nopackcode/onerror:noexe >>$(DEST)\tmp.lnk
    @echo $(DEST)\kernel.map/map >>$(DEST)\tmp.lnk
    @echo /NOD/NOE >>$(DEST)\tmp.lnk
    $(LINK) $(LDEBUG) @$(DEST)\tmp.lnk,kernel.def
    $(RC) -t $(DEST)\krnl386.res $(DEST)\kernel.exe
    fixexe $(DEST)\kernel.exe
    @-del $(DEST)\tmp.lnk

$(DEST)\kernstub.exe: kernstub.asm
    cd $(DEST)
    $(ASM) $(KSAFLAGS) ..\..\..\kernstub;
    $(LINK) kernstub;
    -erase kernstub.obj
    cd ..\..\..

$(DEST)\kernel.map:  $(DEST)\kernel.exe

$(DEST)\kernel.sym: $(DEST)\kernel.map
    mapsym /n -o $(DEST)\kernel.sym $(DEST)\kernel.map

$(DEST)\krnl386.rc : krnl386.rc
    copy $? $@

$(DEST)\kernel.rcv : kernel.rcv
    copy $? $@

$(DEST)\krnl386.res: $(DEST)\krnl386.rc $(DEST)\kernel.rcv ..\inc\common.ver
    set INCLUDE=$(RCINC)
    $(RC) -r $(DEST)\krnl386.rc

$(DEST)\krnl386.sym: $(DEST)\kernel.map
    mapsym /n -o $(DEST)\kernel.sym $(DEST)\kernel.map
    copy $(DEST)\kernel.exe $(DEST)\krnl386.exe
    copy $(DEST)\kernel.map $(DEST)\krnl386.map
    copy $(DEST)\kernel.sym $(DEST)\krnl386.sym
    -erase $(DEST)\kernel.exe


#
#  The C File List
#

$(DEST)\rip.obj:: rip.c
    Set CL=$(CPF_FLAGS)
    $(CL) rip.c
    Set CL=

$(DEST)\lzexp.obj:: lzexp.c
    Set CL=$(CP_FLAGS)
    $(CL) -NT _TEXT lzexp.c
    Set CL=

$(DEST)\error.obj:: error.c
    Set CL=$(CP_FLAGS)
    $(CL) -NT _TEXT error.c
    Set CL=

$(DEST)\disasm.obj:: disasm.c
    Set CL=$(CPF_FLAGS)
    $(CL) disasm.c
    Set CL=


# DO NOT DELETE THE FOLLOWING LINE
# Dependencies follow

$(DEST)\3gacheck.obj 3gacheck.lst: 3gacheck.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc winkern.inc
        $(ASMCMD) 3gacheck,$(DEST)\;

$(DEST)\3galloc.obj 3galloc.lst: 3galloc.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc protect.inc \
        winkern.inc
        $(ASMCMD) 3galloc,$(DEST)\;

$(DEST)\3gcompac.obj 3gcompac.lst: 3gcompac.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc winkern.inc
        $(ASMCMD) 3gcompac,$(DEST)\;

$(DEST)\3ginterf.obj 3ginterf.lst: 3ginterf.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/newexe.inc ../inc/rom.inc ikernel.inc \
        kernel.inc krom.inc pdb.inc protect.inc tdb.inc winkern.inc \
        $(WOWINC)\tdb16.inc $(WOWINC)\wow.inc $(WOWINC)\wowkrn.inc
        $(ASMCMD) 3ginterf,$(DEST)\;

$(DEST)\3glru.obj 3glru.lst: 3glru.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) 3glru,$(DEST)\;

$(DEST)\3gmem.obj 3gmem.lst: 3gmem.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc \
        winkern.inc
        $(ASMCMD) 3gmem,$(DEST)\;

$(DEST)\3gmemini.obj 3gmemini.lst: 3gmemini.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc winkern.inc
        $(ASMCMD) 3gmemini,$(DEST)\;

$(DEST)\3gmoreme.obj 3gmoreme.lst: 3gmoreme.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/newexe.inc ../inc/rom.inc ikernel.inc \
        kernel.inc krom.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) 3gmoreme,$(DEST)\;

$(DEST)\3protect.obj 3protect.lst: 3protect.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        pdb.inc protect.inc winkern.inc
        $(ASMCMD) 3protect,$(DEST)\;

$(DEST)\aliases.obj aliases.lst: aliases.asm
        $(ASMCMD) aliases,$(DEST)\;

$(DEST)\atom.obj atom.lst: atom.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        winkern.inc
        $(ASMCMD) atom,$(DEST)\;

$(DEST)\context.obj context.lst: context.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/rom.inc eems.inc ikernel.inc kernel.inc \
        krom.inc pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc $(WOWINC)\wowcmpat.inc
        $(ASMCMD) context,$(DEST)\;

$(DEST)\diag.obj diag.lst: diag.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) diag,$(DEST)\;

$(DEST)\diskio.obj diskio.lst: diskio.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) diskio,$(DEST)\;

$(DEST)\dosinit.obj dosinit.lst: dosinit.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc pdb.inc winkern.inc
        $(ASMCMD) dosinit,$(DEST)\;

$(DEST)\enable.obj enable.lst: enable.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc eems.inc ikernel.inc kernel.inc \
        krom.inc pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) enable,$(DEST)\;

$(DEST)\gacheck.obj gacheck.lst: gacheck.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) gacheck,$(DEST)\;

$(DEST)\gpcont.obj gpcont.lst: gpcont.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc gpcont.inc ikernel.inc kernel.inc \
        krom.inc winkern.inc
        $(ASMCMD) gpcont,$(DEST)\;

$(DEST)\gpfix.obj gpfix.lst: gpfix.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/newexe.inc ../inc/rom.inc ikernel.inc \
        kernel.inc krom.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) gpfix,$(DEST)\;

$(DEST)\handle.obj handle.lst: handle.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) handle,$(DEST)\;

$(DEST)\hmem.obj hmem.lst: hmem.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        winkern.inc
        $(ASMCMD) hmem,$(DEST)\;

$(DEST)\i21entry.obj i21entry.lst: i21entry.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/newexe.inc ../inc/rom.inc eems.inc \
        ikernel.inc kernel.inc krom.inc pdb.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc \
        winkern.inc
        $(ASMCMD) i21entry,$(DEST)\;

$(DEST)\i21file.obj i21file.lst: i21file.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc eems.inc ikernel.inc kdos.inc kernel.inc krom.inc \
        pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) i21file,$(DEST)\;

$(DEST)\i21task.obj i21task.lst: i21task.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc eems.inc ikernel.inc kdos.inc kernel.inc krom.inc \
        pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) i21task,$(DEST)\;


$(DEST)\int24.obj int24.lst: int24.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) int24,$(DEST)\;

$(DEST)\intnn.obj intnn.lst: intnn.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc pdb.inc tdb.inc $(WOWINC)\tdb16.inc \
        winkern.inc
        $(ASMCMD) intnn,$(DEST)\;

$(DEST)\kdata.obj kdata.lst: kdata.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/rom.inc gpcont.inc ikernel.inc kernel.inc \
        krom.inc winkern.inc
        $(ASMCMD) kdata,$(DEST)\;

$(DEST)\kdataend.obj kdataend.lst: kdataend.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        winkern.inc
        $(ASMCMD) kdataend,$(DEST)\;

$(DEST)\kernstub.obj kernstub.lst: kernstub.asm ../inc/cmacros.inc \
        ../inc/newexe.inc protect.inc
        $(ASMCMD) kernstub,$(DEST)\;

$(DEST)\kthunks.obj kthunks.lst: kthunks.asm ../inc/cmacros.inc \
        $(WOWINC)\wow.inc $(WOWINC)\wowkrn.inc
        $(ASMCMD) kthunks,$(DEST)\;

$(DEST)\lacheck.obj lacheck.lst: lacheck.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) lacheck,$(DEST)\;

$(DEST)\lalloc.obj lalloc.lst: lalloc.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) lalloc,$(DEST)\;

$(DEST)\layer.obj layer.lst: layer.asm ../inc/gpfix.inc ../inc/klayer.inc \
        ../inc/logerror.inc kernel.api
        $(ASMCMD) layer,$(DEST)\;

$(DEST)\lcompact.obj lcompact.lst: lcompact.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        winkern.inc
        $(ASMCMD) lcompact,$(DEST)\;

$(DEST)\ld.obj ld.lst: ld.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc eems.inc ikernel.inc kernel.inc \
        krom.inc pdb.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ld,$(DEST)\;

$(DEST)\ldappl.obj ldappl.lst: ldappl.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc appl.inc ikernel.inc kernel.inc \
        krom.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldappl,$(DEST)\;

$(DEST)\ldaux.obj ldaux.lst: ldaux.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldaux,$(DEST)\;

$(DEST)\ldboot.obj ldboot.lst: ldboot.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc eems.inc gpcont.inc ikernel.inc \
        kernel.inc krom.inc pdb.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc \
        winkern.inc $(WOWINC)\doswow.inc
        $(ASMCMD) ldboot,$(DEST)\;

$(DEST)\ldcache.obj ldcache.lst: ldcache.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldcache,$(DEST)\;

$(DEST)\lddebug.obj lddebug.lst: lddebug.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc $(WOWINC)\tdb16.inc \
        $(WOWINC)\bop.inc $(WOWINC)\wow.inc $(WOWINC)\dbgsvc.inc
        $(ASMCMD) lddebug,$(DEST)\;

$(DEST)\ldfastb.obj ldfastb.lst: ldfastb.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc eems.inc ikernel.inc kernel.inc \
        krom.inc pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldfastb,$(DEST)\;

$(DEST)\ldfile.obj ldfile.lst: ldfile.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        winkern.inc
        $(ASMCMD) ldfile,$(DEST)\;

$(DEST)\ldheader.obj ldheader.lst: ldheader.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/newexe.inc ../inc/rom.inc ikernel.inc \
        kernel.inc krom.inc winkern.inc
        $(ASMCMD) ldheader,$(DEST)\;

$(DEST)\ldint.obj ldint.lst: ldint.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ../inc/windows.inc gpcont.inc \
        ikernel.inc kdos.inc kernel.inc krom.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc \
        winkern.inc $(WOWINC)\bop.inc
        $(ASMCMD) ldint,$(DEST)\;

$(DEST)\ldopen.obj ldopen.lst: ldopen.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldopen,$(DEST)\;

$(DEST)\ldreloc.obj ldreloc.lst: ldreloc.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/newexe.inc ../inc/rom.inc ikernel.inc \
        kernel.inc krom.inc protect.inc winkern.inc
        $(ASMCMD) ldreloc,$(DEST)\;

$(DEST)\ldseg.obj ldseg.lst: ldseg.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldseg,$(DEST)\;

$(DEST)\ldself.obj ldself.lst: ldself.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldself,$(DEST)\;

$(DEST)\ldstack.obj ldstack.lst: ldstack.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc eems.inc ikernel.inc kernel.inc \
        krom.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldstack,$(DEST)\;

$(DEST)\ldutil.obj ldutil.lst: ldutil.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) ldutil,$(DEST)\;

$(DEST)\lhandle.obj lhandle.lst: lhandle.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) lhandle,$(DEST)\;

$(DEST)\linterf.obj linterf.lst: linterf.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) linterf,$(DEST)\;

$(DEST)\lstring.obj lstring.lst: lstring.asm ../inc/cmacros.inc ../inc/gpfix.inc \
        ../inc/logerror.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        winkern.inc $(WOWINC)\wowcmpat.inc
        $(ASMCMD) lstring,$(DEST)\;

$(DEST)\mapdata.obj mapdata.lst: mapdata.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) mapdata,$(DEST)\;

$(DEST)\miscapi.obj miscapi.lst: miscapi.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc eems.inc ikernel.inc kernel.inc \
        krom.inc pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) miscapi,$(DEST)\;

$(DEST)\module.obj module.lst: module.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) module,$(DEST)\;

$(DEST)\patch.obj patch.lst: patch.asm ../inc/cmacros.inc kernel.inc \
        ../inc/gpfix.inc pdb.inc tdb.inc ../inc/newexe.inc protect.inc
        $(ASMCMD) patch,$(DEST)\;

$(DEST)\reboot.obj reboot.lst: reboot.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) reboot,$(DEST)\;

$(DEST)\resaux.obj resaux.lst: resaux.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) resaux,$(DEST)\;

$(DEST)\ripaux.obj ripaux.lst: ripaux.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc ikernel.inc kernel.inc krom.inc \
        winkern.inc
        $(ASMCMD) ripaux,$(DEST)\;

$(DEST)\rom.obj rom.lst: rom.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc pdb.inc protect.inc \
        winkern.inc
        $(ASMCMD) rom,$(DEST)\;

$(DEST)\stack.obj stack.lst: stack.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc
        $(ASMCMD) stack,$(DEST)\;

$(DEST)\strings.obj strings.lst: messages\$(ALT_PROJECT)\strings.asm gpcont.inc
        $(ASMCMD) messages\$(ALT_PROJECT)\strings,$(DEST)\;

$(DEST)\task.obj task.lst: task.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/newexe.inc ../inc/rom.inc eems.inc ikernel.inc kernel.inc \
        krom.inc pdb.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc \
        $(WOWINC)\bop.inc
        $(ASMCMD) task,$(DEST)\;

$(DEST)\tasking.obj tasking.lst: tasking.asm ../inc/cmacros.inc \
        tdb.inc $(WOWINC)\tdb16.inc $(WOWINC)\wow.inc
        $(ASMCMD) tasking,$(DEST)\;

$(DEST)\userpro.obj userpro.lst: userpro.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc pdb.inc winkern.inc
        $(ASMCMD) userpro,$(DEST)\;

$(DEST)\w32sys.obj w32sys.lst: w32sys.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) w32sys,$(DEST)\;

$(DEST)\winexec.obj winexec.lst: winexec.asm ../inc/cmacros.inc ../inc/logerror.inc \
        ../inc/rom.inc ikernel.inc kernel.inc krom.inc winkern.inc $(WOWINC)\wowcmpat.inc
        $(ASMCMD) winexec,$(DEST)\;

$(DEST)\kold.obj kold.lst: kold.asm ../inc/cmacros.inc \
        ../inc/logerror.inc ../inc/newexe.inc ../inc/rom.inc ikernel.inc \
        kernel.inc krom.inc protect.inc tdb.inc $(WOWINC)\tdb16.inc winkern.inc
        $(ASMCMD) kold,$(DEST)\;

$(DEST)\wowdeb.obj wowdeb.lst: wowdeb.asm ../inc/cmacros.inc \
        kernel.inc $(WOWINC)\wow.inc
        $(ASMCMD) wowdeb,$(DEST)\;

$(DEST)\wow16cal.obj wow16cal.lst: wow16cal.asm ../inc/cmacros.inc \
        $(WOWINC)\wow.inc $(WOWINC)\dpmi.inc tdb.inc $(WOWINC)\tdb16.inc
        $(ASMCMD) wow16cal,$(DEST)\;

$(DEST)\selman.obj selman.lst: selman.asm ../inc/gpfix.inc kernel.inc
        $(ASMCMD) selman,$(DEST)\;

$(DEST)\kflatstb.obj kflatstb.lst: kflatstb.asm kernel.inc
        $(ASMCMD) kflatstb,$(DEST)\;


disasm.obj disasm.lst:: disasm.c ../inc/windows.h ../inc/windowsx.h

error.obj error.lst:: error.c ../inc/logerror.h ikernel.h kernel.h

fixexe.obj fixexe.lst:: fixexe.c

lzexp.obj lzexp.lst:: lzexp.c ikernel.h kernel.h

rip.obj rip.lst:: rip.c ikernel.h kernel.h newexe.h

# IF YOU PUT STUFF HERE IT WILL GET BLASTED
