#############################################################################
#
# The make process relies on the creation of DLL and library response file  #
# creation.  To control the location of object modules the following should #
# be defined:                                                               #
#                                                                           #
#     IMPOBJS - A list of object modules that should appear in the DLL      #
#               import library.                                             #
#                                                                           #
#        OBJS - If a DLL is build, this is a list of the object modules     #
#               that are linked into the DLL.  If building a library, this  #
#               is the list of object modules that goes into the library.   #
#                                                                           #
# The building of miscellaneous object modules and libraries is controlled  #
# by the list of files in the MISC variable.                                #
#                                                                           #
#############################################################################

#############################################################################
# Build the object module lists.                                            #
#############################################################################
OBJS =               \
	fmemccpy.obj \
	fmemchr.obj  \
	fmemcmp.obj  \
	fmemcpy.obj  \
	fmemicmp.obj \
	fmemset.obj  \
	fmovmem.obj  \
	fstrcat.obj  \
	fstrchr.obj  \
	fstrcmp.obj  \
	fstrcpy.obj  \
	fstrcspn.obj \
	fstrdup.obj  \
	fstricmp.obj \
	fstrlen.obj  \
	fstrncat.obj \
	fstrncmp.obj \
	fstrncpy.obj \
	fstrnicm.obj \
	fstrnset.obj \
	fstrpbrk.obj \
	fstrrchr.obj \
	fstrrev.obj  \
	fstrset.obj  \
	fstrspn.obj  \
	fstrstr.obj  \
	fstrtok.obj  \
	memicmp.obj  \
	strcspn.obj  \
	strdate.obj  \
	strdup.obj   \
	strerror.obj \
	strncat.obj  \
	strnset.obj  \
	strpbrk.obj  \
	strrchr.obj  \
	strset.obj   \
	strspn.obj   \
	strtok.obj   \
	memccpy.obj  \
	memchr.obj   \
	memcmp.obj   \
	memcpy.obj   \
	memset.obj   \
	movmem.obj   \
	strcat.obj   \
	strchr.obj   \
	strcmp.obj   \
	strcpy.obj   \
	stricmp.obj  \
	strlen.obj   \
	strncmp.obj  \
	strncpy.obj  \
	strnicmp.obj \
	strrev.obj   \
	strstr.obj

AUXOBJS =            \
	stpcpy.obj   \
	_stpcpy.obj

!if $d(DLL)
    IMPOBJS = $(AUXOBJS)
!else
    OBJS    = $(AUXOBJS) $(OBJS)
!endif

#############################################################################
# Configure the environment apprpriately.                                   #
#############################################################################
TASMCFG = 1        # Force tasm.cfg creation

!include rules.mak

#############################################################################
# Miscellaneous explicit rules.                                             #
#############################################################################
!if $(MODEL) == h
    COMPILE = $(CC) -mh -D__FARFUNCS__ -o$<
!else
    COMPILE = $(CC) -ml -D__FARFUNCS__ -o$<
!endif

fmemccpy.obj : memccpy.cas
	$(COMPILE) $?

fmemchr.obj : memchr.cas
	$(COMPILE) $?

fmemcmp.obj : memcmp.cas
	$(COMPILE) $?

fmemcpy.obj : memcpy.cas
	$(COMPILE) $?

fmemicmp.obj : memicmp.c
	$(COMPILE) $?

fmemset.obj : memset.cas
	$(COMPILE) $?

fmovmem.obj : movmem.cas
	$(COMPILE) $?

fstrcat.obj : strcat.cas
	$(COMPILE) $?

fstrchr.obj : strchr.cas
	$(COMPILE) $?

fstrcmp.obj : strcmp.cas
	$(COMPILE) $?

fstrcpy.obj : strcpy.cas
	$(COMPILE) $?

fstrcspn.obj : strcspn.c
	$(COMPILE) $?

fstrdup.obj : strdup.c
	$(COMPILE) $?

fstricmp.obj : stricmp.cas
	$(COMPILE) $?

fstrlen.obj : strlen.cas
	$(COMPILE) $?

fstrncat.obj : strncat.c
	$(COMPILE) $?

fstrncmp.obj : strncmp.cas
	$(COMPILE) $?

fstrncpy.obj : strncpy.cas
	$(COMPILE) $?

fstrnicm.obj : strnicmp.cas
	$(COMPILE) $?

fstrnset.obj : strnset.c
	$(COMPILE) $?

fstrpbrk.obj : strpbrk.c
	$(COMPILE) $?

fstrrchr.obj : strrchr.c
	$(COMPILE) $?

fstrrev.obj : strrev.cas
	$(COMPILE) $?

fstrset.obj : strset.c
	$(COMPILE) $?

fstrspn.obj : strspn.c
	$(COMPILE) $?

fstrstr.obj : strstr.cas
	$(COMPILE) $?

fstrtok.obj : strtok.c
	$(COMPILE) $?

