# makefile.bc
# This is the makefile for DOS/Windows
#
#########################################################################
#If you are using BORLAND C:
#
#	If you want to run the LTOOLS under DOS or Windows 9x, you need:
#            	Borland C 16bit Compiler (tested with BC 3.1, 4.52, 5.0)
#
#	If you want to run the LTOOLS under Windows NT/2000, you need:
# 		Borland C 32bit Compiler (tested with BC 4.52, 5.0, 5.5)
#
#If you are using Microsoft VISUAL C++:
#
#	Use Visual C++ only, when you want to run the LTOOLS under Windows NT/2000
#
#
#To use Microsoft VISUAL C++ remove the comment character '#' from the beginning of
#the following line:

#MICROSOFT=1;


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

####no user configurable items below this line############################

!ifdef MICROSOFT	#Microsoft C compiler settings (32bit only!)
CC32=cl
LKFLAGS=
CCFLAGS=/c /D__WIN32__  -D_Windows
OD=-Fo
!else			#Borland C compiler settings (16bit and 32bit)
CC=bcc -ml
CC32=bcc32
LKFLAGS= -C -3 -wall -N -DSTRICT $(WIN) $(MODEL) -O2
CCFLAGS= -c $(LKFLAGS)
OD=-o
!endif



INCLUDES=ldir.h  proto.h  ext2.h  makefile

lread:          16bitObj  32bitObj
!ifdef CC
		$(CC) $(LKFLAGS) main.obj readdisk.obj dir.obj super.obj inode.obj group.obj
		@if exist ..\bin\ldir.exe      del ..\bin\ldir.exe
		@move main.exe ..\bin\ldir.exe
!endif
!ifdef CC32
		$(CC32) $(LKFLAGS) NTmain.obj NTread.obj NTdir.obj NTsuper.obj NTinode.obj NTgroup.obj
		@if exist ..\bin\ldirNT.exe   del ..\bin\ldirNT.exe
		@move NTmain.exe ..\bin\ldirNT.exe
!endif
                @copy *.bat    ..\bin


16bitObj:       main.obj readdisk.obj dir.obj super.obj inode.obj group.obj

32bitObj:       NTmain.obj NTread.obj NTdir.obj NTsuper.obj NTinode.obj NTgroup.obj


# #################DOS / Windows 9x 16bit binaries#################################
main.obj:       $(INCLUDES) main.c
!ifdef CC
		$(CC)   $(CCFLAGS) main.c
!endif

readdisk.obj:   $(INCLUDES) readdisk.c  DOSdisk.h
!ifdef CC
		$(CC) $(CCFLAGS) readdisk.c
!endif

dir.obj:        $(INCLUDES) dir.c
!ifdef CC
		$(CC) $(CCFLAGS) dir.c
!endif

super.obj:      $(INCLUDES) super.c
!ifdef CC
		$(CC) $(CCFLAGS) super.c
!endif

inode.obj:      $(INCLUDES) inode.c
!ifdef CC
		$(CC) $(CCFLAGS) inode.c
!endif

group.obj:      $(INCLUDES) group.c
!ifdef CC
		$(CC) $(CCFLAGS) group.c
!endif

# #################Windows NT 32bit binaries#######################################
NTmain.obj:	$(INCLUDES) main.c
!ifdef CC32
                $(CC32) $(CCFLAGS) $(OD)NTmain.obj main.c
!endif

NTread.obj: 	$(INCLUDES) readdisk.c   DOSdisk.h
!ifdef CC32
                $(CC32) $(CCFLAGS) $(OD)NTread.obj readdisk.c
!endif

NTdir.obj:	$(INCLUDES) dir.c
!ifdef CC32
                $(CC32) $(CCFLAGS) $(OD)NTdir.obj dir.c
!endif

NTsuper.obj:	$(INCLUDES) super.c
!ifdef CC32
                $(CC32) $(CCFLAGS) $(OD)NTsuper.obj super.c
!endif

NTinode.obj:	$(INCLUDES) inode.c
!ifdef CC32
                $(CC32) $(CCFLAGS) $(OD)NTinode.obj inode.c
!endif

NTgroup.obj:	$(INCLUDES) group.c
!ifdef CC32
                $(CC32) $(CCFLAGS) $(OD)NTgroup.obj group.c
!endif


clean:
		@if exist *.obj del *.obj
		@if exist *.sym del *.sym
		@if exist *.bak del *.bak
		@if exist *.exe del *.exe
                @if exist li*   del li*
                @if exist *.asm del *.asm

