#
# $Id$
#

#
# Directory macros. These should never have to change.
#

INCLUDE_DIR = ..\..\include
OBJ_DIR     = ..\..\obj\vc
LIB_DIR     = ..\..\lib\vc
BIN_DIR     = ..\..\bin\vc

#
# C compiler definition and C flags. These should never have to change.
#

CC = cl
CFLAGS = -TP -W3 -nologo -I$(INCLUDE_DIR)
CLIBFLAGS = $(CFLAGS) -c
CLIBFLAGSDEBUG = $(CLIBFLAGS) -Zi

#
# Macros to access our library names
#

ADS_LIB = $(LIB_DIR)\rddads.lib
HARBOUR_EXE = $(BIN_DIR)\harbour.exe
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w -es2 -gc0

#
# OBJ list for ads.lib
#

ADS_LIB_OBJS = \
    $(OBJ_DIR)\ads0.obj \
    $(OBJ_DIR)\ads1.obj \
    $(OBJ_DIR)\adsfunc.obj

#
# Our default target
#

all: $(ADS_LIB)

#
# Library dependencies and build rules
#

$(ADS_LIB) : $(ADS_LIB_OBJS)
    lib /OUT:$(ADS_LIB) $(ADS_LIB_OBJS)

#
# ADS dependencies
#

$(OBJ_DIR)\ads0.obj : ads0.prg
    $(HARBOUR_EXE) $** $(HARBOURFLAGS) -o$*.c
    $(CC) $(CLIBFLAGS) -Fo$@ $*.c

$(OBJ_DIR)\adsfunc.obj : adsfunc.c
    $(CC) $(CLIBFLAGS) -Fo$@ $**

$(OBJ_DIR)\ads1.obj : ads1.c
    $(CC) $(CLIBFLAGS) -Fo$@ $**

