Metropoli BBS
VIEWER: makefile MODE: TEXT (ASCII)
#
# $Header: D:/ext2-os2/RCS/makefile,v 1.13 1995/08/16 17:41:02 Willm Exp Willm $
#

# Linux ext2 file system driver for OS/2 2.x and WARP - Allows OS/2 to     
# access your Linux ext2fs partitions as normal drive letters.
# OS/2 implementation : Copyright (C) 1995  Matthieu WILLM
#
# 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.

#
# makefile.inc contains configuration dependant definitions (base directories)
#
!include makefile.inc

MAKEFILE = makefile
DEF  = ext2-os2.def
OBJS = fs_misc.o16   \
       banner.o16    \
       fs_dir.o16    \
       fs_find.o16   \
       DevHelp.o16   \
       DevHelp2.o16   \
       log.o16       \
       vfs\rw.o16    \
       pathutil.o16  \
       isfat.o16     \
       ext2\inode.o16     \
       ext2\balloc.o16    \
       ext2\super.o16    \
       ext2\bitmap.o16    \
       ext2\file.o16    \
       ext2\dir.o16    \
       ext2\namei.o16    \
       ext2\ialloc.o16    \
       ext2\truncate.o16    \
       volume.o16    \
       files.o16     \
       unsupp.o16    \
       vfs\buffer.o16    \
       vfs\inode.o16     \
       vfs\misc.o16      \
       vfs\ll_rwblk.o16      \
       vfs\dcache.o16        \
       vfs\sched.o16         \
       util.o16              \
       attr.o16		     \
       vsprintf.o16   \
       maperr.o16

#
# 16 bits compiler to build the IFS - I use MS Visual C++ 1.51 in a DOS box
#
CC16      = cl

#
# INCL16 : include file search path - modify it whenever needed
#
INCL16    = /I$(DDKPATH)\h /I$(IFSTKTPATH) /I$(EXT2OS2_BASE)\include

#
# IFS compiler optimization options :
#     /G3 : use 386 instruction set
#     /O2 : optimize code
#     /On : disable 'unsafe' optimization (I'm not sure it is really necessary)
#
# FS_TRACE       : output to ext2-os2 debug console enabled
# FS_CHECK_BUFS  : tests buffer management structure integrity after each buffer operation
# FS_TRACE_LOCKS : useful to track deadlocks .....
#
#CC16OPT   = /G3 /O2 /On /DFS_TRACE /DFS_CHECK_BUFS /DFS_DEBUG
#CC16OPT  = /G3 /O2 /On /DFS_DEBUG /DFS_TRACE
CC16OPT  = /O2 /G3 /DFS_DEBUG
CC32OPT  = -O

#
# Defined macros : 
#     OS2         : needed almost everywhere
#     __KERNEL__  : needed in some Linux include files
#
OS2_DEFINES = /DOS2 /D__KERNEL__

#
# 16 bits compiler options
#     /nologo : no banner
#     /c      : compile only
#     /AL     : use large memory model  (IT IS ABSOLUTELY NECESSARY)
#     /Zp     : pack structures on one byte boundaries
#     /Gs     : remove stack check calls
#     /Gx-    : assume that data is far (IT IS ABSOLUTELY NECESSARY)
#     /W3     : all warnings enabled
#     /Aw     :
#     /Au     : 
#     /Ld     : select dynamic library (maybe useless here)
CC16FLAGS = /nologo /c $(INCL16) /DCCHMAXPATH=260 /AL /Zp /Gs /Gx- /W3 /Aw /Au $(CC16OPT) /Ld $(OS2_DEFINES) /Lp

#
# 16 bits library search path - modify it whenever needed
#
!if "$(CC)" == "cl"
LIB       = $(DDKPATH)\lib;$(IFSTKTPATH);$(MSVCPATH)\lib
!endif

#
# 16 bits linker - I use Microsoft link 5.60.220 (the one shipped with MSVC 1.51) in a DOS box
#
LD        = link

#
# 16 bits linker options
#     /noi      : case sensitive link
#     /map      : linker map file (necessary to produce a .sym file)
#     /noe      : no extended dictionary
LDFLAGS   =  /map /noe

#
# 32 bits C compiler for building ext2-os2.exe - Currently IBM Visualage C++ beta 2 compiler
#
CC32       = icc


CC32FLAGS  = -Ss+ -I$(EXT2OS2_BASE)\include


TESTDIR=e:\mwfs

.asm.o16:
!if "$(CC)" == "cl"
	$(DDKPATH)\tools\masm -I$(DDKPATH)\inc -ml $?,$@;
!else
	@echo Please run nmake in a DOSbox
	@exit 255
!endif

.c.obj:;

.c.o16:
!if "$(CC)"== "cl"
	@echo Compilation de $(@:.o16=.c)
	@$(CC16) $(CC16FLAGS) -Fo$@ -Fl$(@:.o16=.l) $(@:.o16=.c)
!else   
	@echo Please run nmake in a DOS box           
	@exit 255
!endif

.c.o32:
!if "$(CC)" == "icc"
        $(CC32) -Fo$@ $(CC32FLAGS) $(CC32OPT) -c $<
!else
	@echo Please run nmake in an OS/2 session
	@exit 1
!endif

all : ext2-os2.ifs     \
      ext2-os2.exe     \
      sync.exe         \
      ext2_lw.exe

ext2-os2.ifs :         \
        $(OBJS)        \
        $(DEF)         \
        $(MAKEFILE)
!if "$(CC)" == "cl"
       @echo Compilation de banner.c
        @$(CC16) $(CC16FLAGS) banner.c
        @echo Edition des liens de $@
#        @$(LD) $(LDFLAGS) $(OBJS), $@, $(@:.ifs=.map), os2286 + fshelper, $(DEF)
	@$(LD) $(LDFLAGS) @<<
       fs_misc.o16          +
       banner.o16           +
       fs_dir.o16           +
       fs_find.o16          +
       DevHelp.o16          +
       DevHelp2.o16         +
       log.o16              +
       pathutil.o16         +
       isfat.o16            +
       ext2\inode.o16       +
       ext2\balloc.o16      +
       ext2\super.o16       +
       ext2\bitmap.o16      +
       ext2\file.o16        +
       ext2\dir.o16         +
       ext2\namei.o16       +
       ext2\ialloc.o16      +
       ext2\truncate.o16    +
       volume.o16           +
       files.o16            +
       unsupp.o16           +
       attr.o16             +
       vfs\buffer.o16       +
       vfs\inode.o16        +
       vfs\dcache.o16       +
       vfs\ll_rwblk.o16     +
       vfs\misc.o16         +
       vfs\rw.o16           +
       vfs\sched.o16        +
       vsprintf.o16         +
       util.o16             +
       maperr.o16
$@
$(@:.ifs=.map)
os2286  +
os2286p + 
fshelper
$(DEF)
<<
        @mapsym $(@:.ifs=.map)
        @copy $@ $(TESTDIR)
        @copy $(@:.ifs=.sym) $(TESTDIR)
!else
	@echo Please run "nmake" in a DOS box
!endif

ext2-os2.exe : ifsdbg.o32
!if "$(CC)" == "icc"
	copy ifsdbg.o32 ifsdbg.obj
        $(CC32) $(CC32FLAGS) $(CC32OPT) -c banner.c
        $(CC32) -Fe$@ ifsdbg.obj banner.obj
!else
	@echo Please run "nmake" in an OS/2 session
	@exit 1
!endif

sync.exe : sync.o32
!if "$(CC)" == "icc"
	copy sync.o32 sync.obj
        $(CC32) -Fe$@ sync.obj
!else
	@echo Please run "nmake" in an OS/2 session
	@exit 1
!endif

ext2_lw.exe : ext2_lw.o32
!if "$(CC)" == "icc"
	copy ext2_lw.o32 ext2_lw.obj
        $(CC32) -Fe$@ ext2_lw.obj
!else
	@echo Please run "nmake" in an OS/2 session
	@exit 1
!endif




clean:
	-@del *.obj
	-@del *.o16
	-@del *.o32
	-@del *.map
	-@del *.sym
	-@del *.s
	-@del *.l
	-@del vfs\*.obj
	-@del vfs\*.o16
	-@del vfs\*.s
	-@del vfs\*.l
        -@del ext2\*.obj
        -@del ext2\*.o16
        -@del ext2\*.s
        -@del ext2\*.l
        -@del ext2-os2.ifs
        -@del ext2-os2.exe
        -@del sync.exe
        -@del ext2_lw.exe

install:
        -@copy ext2-os2.ifs $(TESTDIR)
        -@copy ext2-os2.exe $(TESTDIR)
        -@copy sync.exe $(TESTDIR)
        -@copy ext2_lw.exe $(TESTDIR)
        -@copy ext2-os2.sym $(TESTDIR)





[ RETURN TO DIRECTORY ]