#-------------------------------------------------------------------------------
# Define Program, Program Directory, Program Version, Install Directories, and
# Target Names ... set mode to default (empty)
#-------------------------------------------------------------------------------
PROGRAM				= libslbmshell_test
PROG_NAM			= slbmtestc

SOURCES			= src/slbmtestc.c
OBJECTS			= slbmtestc.obj

INCLUDE_DIR			= include/
INCLUDE_SHELLDIR	= ../SLBM_C_shell/include/
INCLUDE_SLBMDIR		= ../SLBM/include/

BIN_DIR				= ../bin/
LIB_DIR				= ../lib/

CV = @

ifeq ($(ARCH),32bit)
MACHINE=/MACHINE:X86
else
MACHINE=/MACHINE:X64
endif

CC = cl
RM = del
BIN_DIR	= ..\bin
LIB_DIR	= ..\lib
#curses.h is in the INCLUDE var.  Make sure you have curses.dll/so in your path somewhere.
CCFLAGS = /O2 /MD /Gm /Zi /D"ASCII" /D "WIN32" /I"${INCLUDE_DIR}" /I"${INCLUDE}" /I"${INCLUDE_SLBMDIR}" /EHsc /nologo /Fo"$@"
COMMAND = ${CV} ${CC} ${OBJECTS} $(CCFLAGS) -link $(MACHINE) -out:"${BIN_DIR}/slbmtestc.exe" -LIBPATH:"${LIB_DIR}" ${LIB_DIR}\libslbmCshell.lib ${LIB_DIR}\libslbm.lib
VERSION_FLAG =



#-------------------------------------------------------------------------------
# targets
#-------------------------------------------------------------------------------

all : info cshelltest cleanobjs done

cshelltest : ${OBJECTS}
#-@if [ ! -d $(prefix)]; then mkdir -p $(prefix); fi
	${CV} echo "building executable slbmtestc"
	${COMMAND}

cleanobjs :
	${CV} echo "removing object files"
	${RM} slbmtestc.obj
	${CV} echo ""

slbmtestc.obj :
	${CV} echo "compiling slbmtestc.c"
	${CV} ${CC} ${CCFLAGS} -I${INCLUDE_DIR} -I${INCLUDE_SHELLDIR} -I ${INCLUDE_SLBMDIR} -c ${SOURCES}
	${CV} echo ""
	
info :
	@ echo "========================================="
	@ echo "Building" $(PROG_NAM) "on" $(OS) 
	@ echo ""

done :
	@echo "Done building" $(PROG_NAM)
	@ echo ""
