#
# Skeleton makefile for Silicon Creations, Inc. software
#
# Note: this is for the large memory model only
#
# To compile the PEX version, use 'make -DPB_SDK'
# To compile with debug information, use 'make -Ddebug'
# To remove all object files, use 'make clean'
# To remove all object, exe and pex files, use 'make cleanall'
#
!include "common.def"

#
# define this for any custom libraries
#
# CUSTOMLIBS =

#
# Set up the startup code object file and the default libraries
#
PEX_STARTUP = $(PBLIB)\pb_sdk.obj
EXE_STARTUP = $(STDLIB)\c0l.obj
BCCLIB = $(STDLIB)\cl.lib

#
# set up the macros for EXE or PEX version
#
!if $d(PB_SDK)
STARTUP = $(PEX_STARTUP)
CLIBS =
EXT = PEX
!else
STARTUP = $(EXE_STARTUP)
CLIBS = $(BCCLIB)
EXT = EXE
!endif

#
# List all object files required for the program
#
EXE_depend =  \
 who.obj \
 usersidx.obj \
 date.obj \
 getopt.obj \
 llistadt.obj \
 strichr.obj \
 crc32.obj


#
# This is the main line, the file is made here
#
who.$(EXT): $(EXE_depend)
	$(LINK) $(STARTUP) $**, $<,, $(CLIBS) $(CUSTOMLIBS),

#
# for each object file, list its source dependent, if source is in
# different directory, use $(CC) $(CFLAGS) <sourcepath> as action line
# otherwise, leave the action line empty
#
who.obj: who.c
usersidx.obj: usersidx.c
date.obj: date.c
getopt.obj: getopt.c
llistadt.obj: llistadt.c
crc32.obj: crc32.c
strichr.obj: strichr.c

#
# clean up all intermediary files
#
clean:
	del *.obj

cleanall:
	del *.pex
	del *.exe
	del *.obj
