# $Id: makefile,v 1.2 2002/04/26 23:09:41 smilcke Exp $

#===================================================================
# Makefile for SK32 driver
#===================================================================
DEVTYPE=LIB32
!if "$(KEE)" == "1"
TARGET   = linuxkee
!else
TARGET   = linux
!endif

#EVERYTHING_AS_CPP=1
32BIT=1

!Message ************************
!Message Building $(TARGET)
!Message ************************

!include ..\makes\paths.mak
!ifndef DRV_BASE
!error No DRV paths defined.
!endif

CINCLUDES = $(%WATCOM)\H;..\include;
AINCLUDES = $(%DDK)\H

CDEFINES = -D__KERNEL__ -DMODULE -dTARGET_OS2

#===================================================================
#
#   List of source files
#
#===================================================================
OBJ1    = debug.obj
OBJ2    = misc.obj
OBJ3    = sprintf.obj
OBJ4    = str.obj
OBJ5    = kmod.obj
OBJ6    =
OBJ7    =
OBJ8    =
OBJ9    =
OBJLAST =
OBJS    = $(OBJ0) $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(OBJ7) $(OBJ8) $(OBJ9) $(OBJLAST)

!include $(DRV_MAKES)\envchk.mak
!include $(DRV_MAKES)\common.mak
!include $(LX_MAINMAKE)

LNKFILE  = $(DRV_OBJ)\$(TARGET).lrf


#===================================================================
#
#   Specific dependencies
#
#===================================================================
all: $(DRV_LIB)\$(TARGET).lib

lxapilib.obj: .AUTODEPEND
       $(CC) -oai $(COBJ) $^&.c
       @$(WDIS) $(DRV_OBJ)\$^&.obj

$(LNKFILE): makefile
    @%create $(LNKFILE)
    @for %f in ($(OBJS)) do @%append $(LNKFILE) -+$(DRV_OBJ)\%f

$(DRV_LIB)\$(TARGET).lib: $(LNKFILE) $(OBJS)
    @echo ------------------- $^&.lib
    $(LIB) $(DRV_LIB)\$(TARGET).lib @$(LNKFILE)

clean: .SYMBOLIC
       @if exist $(DRV_OBJ)\*.obj del $(DRV_OBJ)\*.obj
       @if exist $(DRV_OBJ)\*.lrf del $(DRV_OBJ)\*.lrf
       @if exist $(DRV_OBJ)\*.lst del $(DRV_OBJ)\*.lst
       @if exist $(DRV_SRC)\*.err del $(DRV_SRC)\*.err
       @if exist $(DRV_LIB)\linuxkee.lib del $(DRV_LIB)\linuxkee.lib
       @if exist $(DRV_LIB)\linux.lib del $(DRV_LIB)\linux.lib
