i386 = 1
C_DEPENDENCIES = \
argset.$(ASM_TAG) \
conio.$(ASM_TAG) \
envset.$(ASM_TAG) \
dir.$(ASM_TAG) \
direct.$(ASM_TAG) \
dpmi.$(ASM_TAG) \
dos.$(ASM_TAG) \
llfpstub.$(ASM_TAG) \
llmalloc.$(ASM_TAG) \
llmisc.$(ASM_TAG) \
llsig.$(ASM_TAG) \
llstdio.$(ASM_TAG) \
path.$(ASM_TAG) \
profile.$(ASM_TAG) \
proftime.$(ASM_TAG) \
_stklen.$(ASM_TAG) \
system.$(ASM_TAG)

DEBUG_DEPENDENCIES = \
asm.obj \
asmops.obj \
BREAKS.obj \
compare.obj \
DIS.obj 
DEBUG_DEPENDENCIES_2 = \
DISPATCH.obj \
DUMP.obj \
ENTRY.obj \ 
EXEC.obj \
FILL.obj 
DEBUG_DEPENDENCIES_3 = \
FP.obj \
HBREAK.obj \
HELP.obj \
INOUT.obj \
INPUT.obj 
DEBUG_DEPENDENCIES_4 = \
MATH.obj \
MTRAP.obj  \
move.obj \
OPCODES.obj \
OPCOM.obj 
DEBUG_DEPENDENCIES_5 = \
OPERANDS.obj \
PRINTS.obj \
REGS.obj \
SEARCH.obj \
SWIFT.obj 

startup: all c0dos c0dosd c0dosw pmode.obj debug wildargs
!include "..\clib.mak"

profile.obj: profile.c
        cc386 /C+N /I..\stdinc profile
	mkliblst $(LIBLIST) .obj profile
        nasm -fobj profile.asm

proftime.obj: proftime.c
        cc386 /C+N /I..\stdinc proftime
	mkliblst $(LIBLIST) .obj proftime
        nasm -fobj proftime.asm

pmode.obj: pmode308\pmode.asm
	tasm /ml /m2 pmode308\pmode
	mkliblst $(LIBLIST) .obj pmode
	move pmode.obj ..\object
	
c0dos: 386\c0dos.asm
	tasm  /ml /m2 386\c0dos
	move c0dos.obj ..\object

c0dosd: 386\c0dos.asm
	tasm  /ml /m2 /DDEBUG /DCOPYRIGHT 386\c0dos,c0dosd
	move c0dosd.obj ..\object

c0dosw: 386\c0dosw.asm
	tasm  /ml /m2 386\c0dosw
	move c0dosw.obj ..\object

wildargs: wildargs.c
	cc386 /C+N wildargs
	nasm -fobj wildargs.asm
	move wildargs.obj ..\object

debug: $(DEBUG_DEPENDENCIES) $(DEBUG_DEPENDENCIES_2) $(DEBUG_DEPENDENCIES_3) $(DEBUG_DEPENDENCIES_4) $(DEBUG_DEPENDENCIES_5)
	mkliblst $(LIBLIST) .obj $(DEBUG_DEPENDENCIES:.obj=)
	mkliblst $(LIBLIST) .obj $(DEBUG_DEPENDENCIES_2:.obj=)
	mkliblst $(LIBLIST) .obj $(DEBUG_DEPENDENCIES_3:.obj=)
	mkliblst $(LIBLIST) .obj $(DEBUG_DEPENDENCIES_4:.obj=)
	mkliblst $(LIBLIST) .obj $(DEBUG_DEPENDENCIES_5:.obj=)
	move *.obj ..\object
breaks.obj: debug\breaks.asm
	tasm /ml /m3 /idebug debug\breaks.asm
dis.obj: debug\dis.asm
	tasm /ml /m3 /idebug debug\dis.asm
dispatch.obj: debug\dispatch.asm
	tasm /ml /m3 /idebug debug\dispatch.asm
dump.obj: debug\dump.asm
	tasm /ml /m3 /idebug debug\dump.asm
entry.obj: debug\entry.asm
	tasm /ml /m3 /idebug debug\entry.asm
exec.obj: debug\exec.asm
	tasm /ml /m3 /idebug debug\exec.asm
fill.obj: debug\fill.asm
	tasm /ml /m3 /idebug debug\fill.asm
fp.obj: debug\fp.asm
	tasm /ml /m3 /idebug debug\fp.asm
help.obj: debug\help.asm
	tasm /ml /m3 /idebug debug\help.asm
inout.obj: debug\inout.asm
	tasm /ml /m3 /idebug debug\inout.asm
input.obj: debug\input.asm
	tasm /ml /m3 /idebug debug\input.asm
math.obj: debug\math.asm
	tasm /ml /m3 /idebug debug\math.asm
mtrap.obj: debug\mtrap.asm
	tasm /ml /m3 /idebug debug\mtrap.asm
opcodes.obj: debug\opcodes.asm
	tasm /ml /m3 /idebug debug\opcodes.asm
opcom.obj: debug\opcom.asm
	tasm /ml /m3 /idebug debug\opcom.asm
operands.obj: debug\operands.asm
	tasm /ml /m3 /idebug debug\operands.asm
prints.obj: debug\prints.asm
	tasm /ml /m3 /idebug debug\prints.asm
regs.obj: debug\regs.asm
	tasm /ml /m3 /idebug debug\regs.asm
search.obj: debug\search.asm
	tasm /ml /m3 /idebug debug\search.asm
swift.obj: debug\swift.asm
	tasm /ml /m3 /idebug debug\swift.asm
asm.obj: debug\asm.asm
	tasm /ml /m3 /idebug debug\asm.asm
asmops.obj: debug\asmops.asm
	tasm /ml /m3 /idebug debug\asmops.asm
compare.obj: debug\compare.asm
	tasm /ml /m3 /idebug debug\compare.asm
move.obj: debug\move.asm
	tasm /ml /m3 /idebug debug\move.asm
hbreak.obj: debug\hbreak.asm
	tasm /ml /m3 /idebug debug\hbreak.asm