
NASM?=nasm
nasflags	=-Ox -P$(inc)/nasm.mac
nasinc		=-I$(@D)/ -I$(inc)/ -I$(dos)/

.SUFFIXES:
.SUFFIXES: .obj .asm .fob .nas

.nas.obj:
	$(NASM) $(nasflags) $(nasinc) $*.nas -fobj -o$*.obj -l$*.lst

.obj.fob:
	fixupp $*.obj $*.fob


#************************** makefile for bios ***************************

dest	=msbio
dos	=src/DOS
inc	=src/INC
bios	=src/BIOS
share	=src/CMD/SHARE
hinc	=src/H
boot	=src/BOOT
format	=src/CMD/FORMAT

#
#######################	dependencies begin here. #########################
#

all: $(bios)/$(dest).bin $(share)/share.exe $(format)/format.com

$(dos)/dossym.mac: $(inc)/dosmac.mac $(inc)/bpb.mac \
	 $(inc)/buffer.mac $(inc)/sysvar.mac $(inc)/vector.mac \
	 $(inc)/mult.mac $(inc)/dirent.mac $(inc)/dpb.mac \
	 $(inc)/curdir.mac $(inc)/cpmfcb.mac $(inc)/find.mac \
	 $(inc)/pdb.mac $(inc)/exe.mac $(inc)/sf.mac \
	 $(inc)/arena.mac $(inc)/intnat.mac $(inc)/mi.mac \
	 $(inc)/filemode.mac $(inc)/error.mac $(inc)/syscall.mac
	touch $(inc)/dossym.mac


$(bios)/msbio1.obj: $(bios)/msbio1.nas \
	 $(bios)/msbdata.nas $(bios)/entry.asm $(bios)/msgroup.mac \
	 $(bios)/jumpmac.mac $(bios)/pushpop.mac $(inc)/devsym.mac \
	 $(bios)/msdskpr.mac $(bios)/msmacro.mac $(inc)/dosseg.nas \
	 $(inc)/codesw.mac $(inc)/msbds.mac $(bios)/msbio.cl2 \
	 $(bios)/code.asm $(inc)/lstruct.mac $(inc)/entrysw.mac \
	 $(inc)/dcodeseg.nas $(inc)/ddataseg.nas $(inc)/entryseg.nas \
	 $(inc)/amis.mac $(inc)/sysinisw.mac


$(bios)/mscon.obj: $(bios)/mscon.nas \
	 $(bios)/msgroup.mac $(bios)/jumpmac.mac $(bios)/msmacro.mac \
	 $(inc)/entrysw.mac


$(bios)/msaux.obj: $(bios)/msaux.nas \
	 $(bios)/msgroup.mac $(bios)/jumpmac.mac $(bios)/msmacro.mac


$(bios)/mslpt.obj: $(bios)/mslpt.nas \
	 $(bios)/msgroup.mac $(bios)/msequ.mac $(inc)/msbds.mac \
	 $(bios)/msmacro.mac $(inc)/devsym.mac $(inc)/ioctl.mac \
	 $(inc)/bpb.mac


$(bios)/msclock.obj: $(bios)/msclock.nas \
	 $(bios)/msgroup.mac $(bios)/msmacro.mac $(inc)/entryseg.nas \
	 $(inc)/ddataseg.nas \
	 $(inc)/entrysw.mac


$(bios)/msdisk.obj: $(bios)/msdisk.nas \
	 $(bios)/msgroup.mac $(bios)/msequ.mac $(inc)/msbds.mac \
	 $(bios)/pushpop.mac $(bios)/msmacro.mac $(inc)/devsym.mac \
	 $(bios)/msdskpr.mac $(bios)/msioctl.nas $(inc)/ioctl.mac \
	 $(inc)/bpb.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(bios)/msinit.obj: $(bios)/msinit.nas \
	 $(bios)/msgroup.mac $(bios)/msdskpr.mac $(bios)/msequ.mac \
	 $(inc)/msbds.mac $(inc)/cputype.mac $(bios)/msmacro.mac \
	 $(bios)/readcloc.nas $(bios)/clocksub.nas $(bios)/msextrn.mac \
	 $(inc)/codesw.mac $(bios)/scanptab.asm $(inc)/scanptab.mac \
	 $(inc)/lstruct.mac \
	 $(inc)/lmacros3.mac $(inc)/lmacros2.mac $(inc)/lmacros1.mac \
	 $(inc)/sysinisw.mac $(inc)/haltflag.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(bios)/sysinit1.obj: $(bios)/sysinit1.nas \
	 $(bios)/msstack.nas $(bios)/msbio.cl4 $(bios)/msbio.cl5 \
	 $(bios)/stkinit.nas $(bios)/devmark.mac $(inc)/smifssym.mac \
	 $(inc)/devsym.mac $(inc)/ioctl.mac $(inc)/cputype.mac \
	 $(inc)/smdossym.mac $(inc)/dosmac.mac $(inc)/bpb.mac \
	 $(inc)/buffer.mac $(inc)/sysvar.mac $(inc)/vector.mac \
	 $(inc)/dirent.mac $(inc)/dpb.mac $(inc)/curdir.mac \
	 $(inc)/pdb.mac $(inc)/exe.mac $(inc)/sf.mac \
	 $(inc)/arena.mac $(inc)/intnat.mac $(inc)/mi.mac \
	 $(inc)/syscall.mac $(inc)/buf2sw.mac $(bios)/init.asm \
	 $(inc)/codesw.mac $(inc)/msbds.mac $(inc)/dpb.mac \
	 $(inc)/entrysw.mac $(inc)/scanptab.mac \
	 $(inc)/sysinisw.mac $(inc)/verbose.mac \
	 $(inc)/entryseg.nas



$(bios)/sysconf.obj: $(bios)/sysconf.nas \
	 $(bios)/psoption.mac $(bios)/devmark.mac $(inc)/psdata.mac \
	 $(inc)/parse.nas $(inc)/smifssym.mac $(inc)/devsym.mac \
	 $(inc)/ioctl.mac $(inc)/smdossym.mac $(inc)/dosmac.mac \
	 $(inc)/bpb.mac $(inc)/buffer.mac $(inc)/sysvar.mac \
	 $(inc)/vector.mac $(inc)/dirent.mac $(inc)/dpb.mac \
	 $(inc)/curdir.mac $(inc)/pdb.mac $(inc)/exe.mac \
	 $(inc)/sf.mac $(inc)/arena.mac $(inc)/intnat.mac \
	 $(inc)/mi.mac $(inc)/syscall.mac $(inc)/buf2sw.mac \
	 $(inc)/lstruct.mac $(inc)/lmacros2.mac $(inc)/lmacros1.mac \
	 $(inc)/mzheader.mac \
	 $(inc)/memsw.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(bios)/sysinit2.obj: $(bios)/sysinit2.nas \
	 $(bios)/devmark.mac $(inc)/copyrigh.mac $(inc)/smifssym.mac \
	 $(inc)/devsym.mac $(inc)/ioctl.mac $(inc)/smdossym.mac \
	 $(inc)/dosmac.mac $(inc)/bpb.mac $(inc)/buffer.mac \
	 $(inc)/sysvar.mac $(inc)/vector.mac $(inc)/dirent.mac \
	 $(inc)/dpb.mac $(inc)/curdir.mac $(inc)/pdb.mac \
	 $(inc)/exe.mac $(inc)/sf.mac $(inc)/arena.mac \
	 $(inc)/intnat.mac $(inc)/mi.mac $(inc)/syscall.mac \
	 $(inc)/buf2sw.mac $(inc)/lstruct.mac $(inc)/lmacros2.mac \
	 $(inc)/lmacros1.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(bios)/sysimes.obj: $(bios)/sysimes.nas \
	 $(bios)/msmacro.mac $(bios)/msbio.cl3 $(bios)/msequ.mac \
	 $(inc)/msbds.mac


$(bios)/msbio2.obj: $(bios)/msbio2.nas \
	 $(bios)/msgroup.mac $(bios)/msequ.mac $(inc)/msbds.mac \
	 $(inc)/devsym.mac $(bios)/pushpop.mac $(bios)/msmacro.mac \
	 $(bios)/ms96tpi.nas $(bios)/msvolid.nas \
	 $(inc)/codesw.mac $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(bios)/mshard.obj: $(bios)/mshard.nas \
	$(inc)/entrysw.mac \
	$(inc)/entryseg.nas


$(bios)/mzstack.obj: $(bios)/mzstack.nas


$(bios)/$(dest).bin: $(bios)/msbio.cl1 $(bios)/msbio1.obj \
	 $(bios)/mscon.obj $(bios)/msaux.obj $(bios)/mslpt.obj \
	 $(bios)/msclock.obj $(bios)/msdisk.obj $(bios)/msbio2.obj \
	 $(bios)/msinit.obj $(bios)/mshard.obj $(bios)/sysinit1.obj \
	 $(bios)/sysconf.obj $(bios)/sysinit2.obj $(bios)/sysimes.obj \
	 $(dos)/msdos.cl1 $(inc)/nibdos.obj $(inc)/const2.obj \
	 $(inc)/msdata.obj $(dos)/mscode.obj $(inc)/msdosme.obj \
	 $(dos)/time.obj $(dos)/getset.obj $(dos)/dosparse.obj \
	 $(dos)/misc.obj $(dos)/misc2.obj $(dos)/crit.obj \
	 $(dos)/cpmio.obj $(dos)/cpmio2.obj $(inc)/mstable.obj \
	 $(dos)/msdisp.obj $(dos)/fcbio.obj $(dos)/fcbio2.obj \
	 $(dos)/search.obj $(dos)/path.obj $(dos)/ioctl.obj \
	 $(dos)/delete.obj $(dos)/rename.obj $(dos)/finfo.obj \
	 $(dos)/dup.obj $(dos)/create.obj $(dos)/open.obj \
	 $(dos)/dinfo.obj $(dos)/isearch.obj $(dos)/buf.obj \
	 $(dos)/abort.obj $(dos)/close.obj $(dos)/dircall.obj \
	 $(dos)/disk.obj $(dos)/disk2.obj $(dos)/disk3.obj \
	 $(dos)/dir.obj $(dos)/dir2.obj $(dos)/dev.obj \
	 $(dos)/mknode.obj $(dos)/rom.obj $(dos)/fcb.obj \
	 $(dos)/msctrlc.obj $(dos)/fat.obj $(dos)/proc.obj \
	 $(dos)/alloc.obj $(dos)/srvcall.obj $(dos)/util.obj \
	 $(dos)/macro.obj $(dos)/macro2.obj $(dos)/ifs.obj \
	 $(dos)/handle.obj $(dos)/file.obj $(dos)/lock.obj \
	 $(dos)/share.obj $(dos)/extattr.obj $(bios)/mzstack.obj \
	 msbiow.lnk
	./warplink.sh @msbiow.lnk
	./x2b2.sh /b /s /l=60h $(bios)/msbiow.exe $(bios)/$(dest).bin

#*************************** Makefile for DOS ***************************

###################### Dependencies begin here ##########################
#

$(dos)/msdisp.obj: $(dos)/msdisp.nas $(dos)/mssw.nas \
	 $(dos)/disp.nas $(inc)/dossym.mac $(inc)/dosseg.nas \
	 $(inc)/buf2sw.mac version.inc \
	 $(inc)/entrysw.mac


$(dos)/mscode.obj: $(dos)/mscode.nas $(dos)/mssw.nas \
	 $(dos)/ms_code.nas $(inc)/dossym.mac $(inc)/dosseg.nas \
	 $(inc)/devsym.mac $(inc)/buf2sw.mac $(inc)/codesw.mac \
	 $(inc)/lstruct.mac $(inc)/entrysw.mac $(dos)/idtable.asm \
	 $(inc)/entryseg.nas


$(dos)/time.obj: $(dos)/time.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/getset.obj: $(dos)/getset.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/dosparse.obj: $(dos)/dosparse.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/misc.obj: $(dos)/misc.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/bugtyp.nas


$(dos)/misc2.obj: $(dos)/misc2.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/bugtyp.nas \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(dos)/crit.obj: $(dos)/crit.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/bugtyp.nas


$(dos)/cpmio.obj: $(dos)/cpmio.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(dos)/kstrin.nas \
	 $(dos)/strin.nas


$(dos)/cpmio2.obj: $(dos)/cpmio2.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/fcbio.obj: $(dos)/fcbio.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/sf.mac \
	 $(inc)/fastopen.mac


$(dos)/fcbio2.obj: $(dos)/fcbio2.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buf2sw.mac


$(dos)/search.obj: $(dos)/search.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/path.obj: $(dos)/path.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/ioctl.obj: $(dos)/ioctl.nas $(inc)/ioctl.mac \
	 $(inc)/dosseg.nas $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/delete.obj: $(dos)/delete.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/sf.mac \
	 $(inc)/fastxxxx.mac $(inc)/fastopen.mac $(inc)/buf2sw.mac


$(dos)/rename.obj: $(dos)/rename.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/sf.mac \
	 $(inc)/buf2sw.mac


$(dos)/finfo.obj: $(dos)/finfo.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buf2sw.mac


$(dos)/dup.obj: $(dos)/dup.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/create.obj: $(dos)/create.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/open.obj: $(dos)/open.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/fastopen.mac


$(dos)/dinfo.obj: $(dos)/dinfo.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/bugtyp.nas \
	 $(inc)/buffer.mac $(inc)/buf2sw.mac


$(dos)/isearch.obj: $(dos)/isearch.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/abort.obj: $(dos)/abort.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/sf.mac


$(dos)/close.obj: $(dos)/close.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buffer.mac \
	 $(inc)/buf2sw.mac


$(dos)/dircall.obj: $(dos)/dircall.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buffer.mac \
	 $(inc)/fastopen.mac $(inc)/buf2sw.mac


$(dos)/disk.obj: $(dos)/disk.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buf2sw.mac


$(dos)/disk2.obj: $(dos)/disk2.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buffer.mac \
	 $(inc)/buf2sw.mac


$(dos)/disk3.obj: $(dos)/disk3.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buf2sw.mac


$(dos)/dir.obj: $(dos)/dir.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/buffer.mac $(inc)/fastopen.mac \
	 $(inc)/buf2sw.mac


$(dos)/dir2.obj: $(dos)/dir2.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/buffer.mac $(inc)/fastopen.mac \
	 $(inc)/buf2sw.mac


$(dos)/dev.obj: $(dos)/dev.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buf2sw.mac


$(dos)/mknode.obj: $(dos)/mknode.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buffer.mac \
	 $(inc)/fastopen.mac $(inc)/filemode.mac $(inc)/buf2sw.mac


$(dos)/rom.obj: $(dos)/rom.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buffer.mac \
	 $(inc)/buf2sw.mac


$(dos)/fcb.obj: $(dos)/fcb.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/msctrlc.obj: $(dos)/msctrlc.nas $(dos)/mssw.nas \
	 $(dos)/ctrlc.nas $(inc)/dosseg.nas $(inc)/dossym.mac \
	 $(inc)/devsym.mac $(inc)/bugtyp.nas $(inc)/buf2sw.mac \
	 $(inc)/entrysw.mac $(inc)/entryseg.nas


$(dos)/fat.obj: $(dos)/fat.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/buffer.mac \
	 $(inc)/curdir.mac $(inc)/buf2sw.mac


$(dos)/buf.obj: $(dos)/buf.nas $(dos)/buf2.nas \
	 $(inc)/dosseg.nas $(inc)/dossym.mac $(inc)/devsym.mac \
	 $(inc)/buffer.mac $(inc)/buf2sw.mac


$(dos)/proc.obj: $(dos)/proc.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/curdir.mac \
	 $(dos)/exec.nas $(inc)/buf2sw.mac $(inc)/memsw.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(dos)/alloc.obj: $(dos)/alloc.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/lstruct.mac \
	 $(dos)/memory.asm $(inc)/memsw.mac


$(dos)/srvcall.obj: $(dos)/srvcall.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/util.obj: $(dos)/util.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/macro.obj: $(dos)/macro.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/curdir.mac


$(dos)/macro2.obj: $(dos)/macro2.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/curdir.mac


$(dos)/handle.obj: $(dos)/handle.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/bugtyp.nas \
	 $(inc)/buf2sw.mac $(inc)/memsw.mac


$(dos)/file.obj: $(dos)/file.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/bugtyp.nas \
	 $(inc)/fastopen.mac $(inc)/filemode.mac


$(dos)/lock.obj: $(dos)/lock.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/share.obj: $(dos)/share.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac


$(dos)/extattr.obj: $(dos)/extattr.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/ea.mac \
	 $(inc)/buffer.mac $(inc)/buf2sw.mac


$(dos)/ifs.obj: $(dos)/ifs.nas $(inc)/dosseg.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/doscntry.mac \
	 $(inc)/buffer.mac $(inc)/buf2sw.mac \
	 $(inc)/entrysw.mac


$(dos)/mzstack.obj: $(dos)/mzstack.nas $(inc)/nasm.mac

#*************************** makefile for inc ****************************

#######################	dependencies begin here. #########################
#


$(inc)/errtst.obj: $(inc)/errtst.c $(hinc)/types.h \
	 $(hinc)/comsub.h $(hinc)/dpb.h


$(inc)/sysvar.obj: $(inc)/sysvar.c $(hinc)/types.h \
	 $(hinc)/sysvar.h


$(inc)/cds.obj: $(inc)/cds.c $(hinc)/types.h \
	 $(hinc)/sysvar.h $(hinc)/cds.h $(hinc)/dpb.h


$(inc)/dpb.obj: $(inc)/dpb.c $(hinc)/dpb.h \
	 $(inc)/dpb.inc


$(inc)/nibdos.obj: $(inc)/nibdos.nas $(dos)/mssw.nas \
	 $(dos)/msconst.nas $(inc)/dossym.mac $(inc)/dosseg.nas \
	 $(inc)/mshead.nas $(inc)/buf2sw.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(inc)/const2.obj: $(inc)/const2.nas $(inc)/dossym.mac \
	 $(inc)/devsym.mac $(inc)/dosseg.nas


$(inc)/msdata.obj: $(inc)/msdata.nas $(dos)/mssw.nas \
	 $(inc)/dosseg.nas $(inc)/dosmac.mac $(inc)/msdata.nas \
	 $(dos)/dosinit.nas $(inc)/devsym.mac $(inc)/vector.mac \
	 $(inc)/buffer.mac $(inc)/dirent.mac $(inc)/dpb.mac \
	 $(inc)/curdir.mac $(inc)/find.mac $(inc)/pdb.mac \
	 $(inc)/sf.mac $(inc)/arena.mac $(inc)/mi.mac \
	 $(inc)/buf2sw.mac $(inc)/ms_data.nas $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(inc)/msdosme.obj: $(inc)/msdosme.nas $(dos)/mssw.nas \
	 $(inc)/dosseg.nas $(dos)/dosmes.nas $(inc)/dosmac.mac \
	 $(inc)/intnat.mac $(inc)/divmes.nas \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(inc)/nibdosn.obj: $(inc)/nibdosn.nas $(inc)/nibdos.nas \
	 $(dos)/mssw.nas $(dos)/msconst.nas $(inc)/dossym.mac \
	 $(inc)/dosseg.nas $(inc)/mshead.nas $(inc)/nobits.mac \
	 $(inc)/buf2sw.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(inc)/const2n.obj: $(inc)/const2n.nas $(inc)/const2.nas \
	 $(inc)/dossym.mac $(inc)/devsym.mac $(inc)/dosseg.nas \
	 $(inc)/nobits.mac


$(inc)/msdatan.obj: $(inc)/msdatan.nas $(inc)/msdata.nas \
	 $(dos)/mssw.nas $(inc)/dosseg.nas $(inc)/dosmac.mac \
	 $(inc)/msdata.nas $(dos)/dosinit.nas $(inc)/devsym.mac \
	 $(inc)/vector.mac $(inc)/buffer.mac $(inc)/dirent.mac \
	 $(inc)/dpb.mac $(inc)/curdir.mac $(inc)/find.mac \
	 $(inc)/pdb.mac $(inc)/sf.mac $(inc)/arena.mac \
	 $(inc)/mi.mac $(inc)/nobits.mac $(inc)/buf2sw.mac \
	 $(inc)/ms_data.nas \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(inc)/msdatai.obj: $(inc)/msdatai.nas $(inc)/msdata.nas \
	 $(dos)/mssw.nas $(inc)/dosseg.nas $(inc)/dosmac.mac \
	 $(inc)/msdata.nas $(dos)/dosinit.nas $(inc)/devsym.mac \
	 $(inc)/vector.mac $(inc)/buffer.mac $(inc)/dirent.mac \
	 $(inc)/dpb.mac $(inc)/curdir.mac $(inc)/find.mac \
	 $(inc)/pdb.mac $(inc)/sf.mac $(inc)/arena.mac \
	 $(inc)/mi.mac $(inc)/nobits.mac $(inc)/buf2sw.mac \
	 $(inc)/ms_data.nas \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(inc)/msdosmen.obj: $(inc)/msdosmen.nas $(inc)/msdosme.nas \
	 $(dos)/mssw.nas $(inc)/dosseg.nas $(dos)/dosmes.nas \
	 $(inc)/dosmac.mac $(inc)/intnat.mac $(inc)/divmes.nas \
	 $(inc)/nobits.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas


$(inc)/mstable.obj: $(inc)/mstable.nas $(dos)/mssw.nas \
	 $(dos)/ms_table.nas $(inc)/dossym.mac $(inc)/dosseg.nas \
	 $(inc)/buf2sw.mac $(inc)/memsw.mac \
	 $(inc)/entrysw.mac \
	 $(inc)/entryseg.nas

#************************ makefile for cmd\share *************************

#######################	dependencies begin here. #########################
#


$(share)/gshare.obj: $(share)/gshare.nas $(inc)/dossym.mac \
	 $(inc)/mft.mac $(inc)/bugtyp.nas


$(share)/gshare2.obj: $(share)/gshare2.nas $(inc)/dossym.mac \
	 $(inc)/dosseg.nas $(inc)/mft.mac $(inc)/bugtyp.nas


$(share)/sharesr.obj: $(share)/sharesr.nas $(inc)/parse.nas \
	 $(inc)/psdata.mac \
	 $(share)/msgserv.nas


$(share)/sharelnk.obj: $(share)/sharelnk.nas


$(share)/share.exe: $(share)/share.ctl $(share)/gshare.obj \
	 $(share)/gshare2.obj $(share)/sharesr.obj $(inc)/nibdosn.obj \
	 $(inc)/const2n.obj $(inc)/msdatan.obj $(inc)/msdosmen.obj \
	 $(share)/sharelnk.obj sharew.lnk
	./warplink.sh @sharew.lnk
	round $(share)/sharew2.exe $(share)/share.exe 1


#************************ makefile for cmd\format *************************

#######################	dependencies begin here. #########################
#

$(format)/display.obj: $(format)/display.nas $(format)/forequ.mac \
	 $(format)/formsg.mac $(format)/formacro.mac \
	 $(format)/format.ctl $(format)/format.cl1 $(format)/format.cl2 \
	 $(format)/format.cla $(inc)/sysmsg.mac $(inc)/msgserv.nas \
	 $(format)/format.clb $(format)/format.clc $(format)/formacro.mac


$(format)/forexec.obj: $(format)/forexec.nas $(format)/forequ.mac \
	 $(inc)/syscall.mac $(format)/formacro.mac


$(format)/forlabel.obj: $(format)/forlabel.nas $(format)/forequ.mac \
	 $(format)/formacro.mac $(inc)/syscall.mac \
	 $(inc)/ioctl.mac $(inc)/dosmac.mac $(format)/forswtch.mac


$(format)/format.obj: $(format)/format.nas $(inc)/dosmac.mac \
	 $(inc)/bpb.mac $(inc)/dirent.mac $(inc)/dpb.mac \
	 $(inc)/curdir.mac $(inc)/cpmfcb.mac $(inc)/pdb.mac \
	 $(inc)/error.mac $(inc)/syscall.mac \
	 $(inc)/ioctl.mac $(format)/forequ.mac $(format)/formacro.mac \
	 $(format)/forswtch.mac


$(format)/forinit.obj: $(format)/forinit.nas $(format)/forequ.mac \
	 $(format)/formacro.mac $(inc)/syscall.mac \
	 $(inc)/ioctl.mac $(format)/forparse.mac $(format)/forswtch.mac \
	 $(format)/parse.nas $(inc)/psdata.mac


$(format)/msfor.obj: $(format)/msfor.nas $(inc)/dosmac.mac \
	 $(inc)/syscall.mac $(inc)/bpb.mac $(inc)/dirent.mac \
	 $(format)/boot.cl1 $(inc)/ioctl.mac $(inc)/boot.mac \
	 $(inc)/boot11.mac $(inc)/bootform.mac \
	 $(format)/filesize.mac $(format)/forequ.mac $(format)/formacro.mac \
	 $(format)/forswtch.mac


$(format)/forproc.obj: $(format)/forproc.nas $(inc)/syscall.mac \
	 $(format)/forequ.mac $(format)/formacro.mac \
	 $(format)/forswtch.mac


$(format)/format.com: $(format)/format.obj $(format)/forproc.obj \
	 $(format)/msfor.obj $(format)/forexec.obj $(format)/display.obj \
	 $(format)/forinit.obj $(format)/forlabel.obj
	./warplink.sh @formatw.lnk
	./convert.sh $(format)/format.exe
