# Makefile for ring 0 piece

.AUTODEPEND

# Project constants
NAME       = hfs
IFS        = $(NAME).ifs
MAP        = $(NAME).map
DEF        = $(NAME).def
CFG        = $(NAME).cfg
CSM        = $(NAME).csm

# Pathnames
DDKPATH    = \prog\ddk
DDKHEADERS = $(DDKPATH)\base\h
IFSTOOLKIT = \prog\ifstool
BORLANDC   = \prog\borlandc

# The DDK headers do not work right now - they include 16-bit definitions
# while some parts of the IFS expect the 32-bit include files.
# For example, PID should be ULONG, not USHORT.
# We don't use the DDK headers.
DDKHEADERS = $(DDKPATH)\base\h
DDKINC     = $(DDKPATH)\base\inc
DDKLIB     = $(DDKPATH)\base\lib
# Use ICC headers instead
ICCINCLUDE = \prog\ibmcpp\include\os2

# Translator Definitions
#CFLAGS     = -DDEBUG
CFLAGS      =
CC         = bcc $(CFLAGS) +$(CFG)
TASM       = TASM
TLIB       = tlib
TLINK      = tlink
TLINKOPT   = /3/n/e/s/c/Tod
LIBPATH    = $(BORLANDC)\lib
CINCL      = $(BORLANDC)\include;$(ICCINCLUDE);$(IFSTOOLKIT);$(DDKHEADERS);..
AINCL      = $(DDKINC)

# Implicit Rules
.c.obj:
  $(CC) -c {$< }

# Targets
OBJS = c0.obj \
 r0devhlp.obj \
 stubs.obj \
 r0comm.obj \
 r0global.obj 
# log.obj 
# vsprintf.obj
# vsprintf must be provided if DEBUG is defined, otherwise not.

$(IFS): $(OBJS) $(DEF) $(CFG)
  $(TLINK) $(TLINKOPT) /L$(LIBPATH) @&&|
$(OBJS)
$(IFS),$(MAP)
$(IFSTOOLKIT)\fshelper.lib+
cl.lib+
$(DDKLIB)\os2286.lib
$(DEF)
|

# Individual File Dependencies
stubs.obj: $(CFG) stubs.c

r0comm.obj: $(CFG) r0comm.c

r0global.obj: $(CFG) r0global.c

vsprintf.obj: $(CFG) vsprintf.c

log.obj: $(CFG) log.c

r0devhlp.obj: $(CFG) r0devhlp.asm
        $(TASM) /MX /i$(AINCL) R0DEVHLP.ASM,R0DEVHLP.OBJ

c0.obj: $(CFG) c0.asm
	$(TASM) /d__LARGE__ /MX /i$(AINCL) c0.ASM,c0.OBJ

# Compiler Configuration File
$(CFG): Makefile
  copy &&|
#-S
-K
-N-
-a-
-R
-ml!
-3
-f-
-C
-G
-O
-Og
-Oe
-Om
-Ov
-Ol
-Op
-O-i
-Z
#-pr   FASTCALL --- may be broken
-k-
-d
-vi-
-H=$(CSM)
-weas
-wpre
-I$(CINCL)
-L$(LIBPATH)
#-P.C
| $(CFG)