#
# $Header: d:\\32bits\\ext2-os2\\microfsd\\rcs\\makefile,v 1.3 1997/03/15 22:24:42 Willm Exp $
#

# 32 bits Linux ext2 file system driver for OS/2 WARP - Allows OS/2 to
# access your Linux ext2fs partitions as normal drive letters.
# Copyright (C) 1995, 1996, 1997  Matthieu WILLM (willm@ibm.net)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

!include ..\makefile.inc

!ifdef OPT
DEFINES = -DMICROFSD_TEST -DOS2
!endif


.asm.u16:
        $(DDKPATH)\tools\masm -ml -I$(DDKPATH)\inc $(DEFINES) $<, $@;

.c.u16:
        @cl -c -nologo -G3 -O2s -On -AT -I. -I..\include -I$(DDKPATH)\h -Fl$(@:.u16=.lu) $(DEFINES) -DOS2 -DMICROFSD -D__KERNEL__  -Fo$@ $<

MUOBJS = entry.u16       \
         start.u16       \
         open.u16        \
         close.u16       \
         read.u16        \
         term.u16        \
         video.u16       \
         ll_rwblk.u16    \
         buffer.u16      \
         super.u16       \
         inode.u16       \
         file.u16        \
         ..\util\pathutil.u16 \
         dir.u16         \
         vsprintf.u16    \
         panic.u16

all:microfsd.com boot.com

microfsd.fsd : microfsd.com boot.com
        build boot.com microfsd.com $@


microfsd.com: $(MUOBJS)
        link /tiny /map:full /noe $(MUOBJS), $@, $(@:.com=.map);

ldr.com : fake.u16 ldr.u16 vsprintf.u16 video.u16
        link /co /tiny /map:full /noe fake.u16 ldr.u16 vsprintf.u16 video.u16, $@, $(@:.com=.map);

boot.com: boot.u16
        link /tiny /map:full /noe boot.u16, $@, $(@:.com=.map);

clean :
        -del *.map
        -del build.exe
        -del *.u16
        -del *.lu
        -del ..\util\*.u16
        -del ..\util\*.lu
        -del microfsd.com
        -del microfsd.fsd
        -del boot.com

build.exe : build.c
        icc -Ss+ build.c

install : microfsd.fsd build.exe
        -copy microfsd.fsd f:\.
        -copy microfsd.fsd c:\.

tt:
        nmake OPT=1

