#Gandharva.dll make file for Borland Free C Compiler.
# $Id: MAKEFILE,v 1.9 2001/05/21 10:42:02 Yoshi Exp $

##################################################config
#DEBUG?
DEBUGSW=-D_DEBUG

#A2UNVLIB
A2UNVLIBSW=-D_A2UNVLIB

# COMMENTOUT follow line if you DONOT use Winamp3Alpha.
WA3=-D_WINAMP3_ALPHA

LSAPI_H_DIR  =c:\litestep\dev
LSAPI_LIB_DIR=$(LSAPI_H_DIR)
LSLIB=lsapiBcc.lib

#ifdef _A2UNVLIB
A2UNVLIB=A2UNV_BCC.LIB
A2UNVLIB_DIR=..\A2UNVLIB
#endif

############################################################


# project name & use copydll
# Sendbang.exe is required to execute "copydll::" in debugmode.
# If you don't have Sendbang.exe, get it or commentout COPYDLL.
!ifdef DEBUGSW
PRJ=GandharvaDebug.dll
COPYDLL=copydll
!else
PRJ=Gandharva.dll
!endif

CPP=bcc32.exe
SOURCE=Gandharva.cpp GandharvaSettings.cpp winampFunc.cpp exports.cpp
OBJ=$(SOURCE:.cpp=.obj)
OUTDIR=.\OUTPUT


DIR_SET=-n$(OUTDIR) -I$(LSAPI_H_DIR) -L$(LSAPI_LIB_DIR) -I$(A2UNVLIB_DIR) -L$(A2UNVLIB_DIR)
CPP_OPT=-w-8057- -5 -WD -O2 -G- -Og -Ox -Os -Oi -D_MBCS $(DEBUGSW) $(A2UNVLIBSW)

all: $(OUTDIR) $(A2UNVLIB) $(PRJ) $(COPYDLL)

$(PRJ):
	$(CPP) -e$@ $(CPP_OPT) $(WA3) $(DIR_SET) $(SOURCE) $(LSLIB) $(A2UNVLIB)

A2UNV_BCC.LIB::
	cd $(A2UNVLIB_DIR)
	make
	cd ..\Gandharva

$(OUTDIR):
    if not exist $(OUTDIR) mkdir $(OUTDIR)

copydll::
	sendbang !unloadmodule C:\temp\$(PRJ)
	cd $(OUTDIR)
	copy $(PRJ) c:\temp
	sendbang !recycle
	cd ..

clean:
	-del $(OUTDIR)\*.obj
	-del $(OUTDIR)\*.dll
	-del $(OUTDIR)\*.tds
