#/DRSPDEBUG
#/Zi
#/DNDEBUG
#/W4

extension=c
OTIMIZACAO=/Ox /Ferspov.dll /Gy /MT /LD /W3 /DRSPDEBUG123
NOTIMIZACAO=/Od /FAs /Ferspov.dll /MT /W3 /LD /DRSPDEBUG 
CHECK=/Od /Ferspov.dll /MT /W3 /Zs /LD /DRSPDEBUG

all:
	rc test.rc

	cl $(OTIMIZACAO) /I "./" /DUSE_LAYER_2 /DUSE_LAYER_1 \
	/DHAVE_CONFIG_H /DWINDOWS /D_WINDOWS \
	decoder.c security.c crc322.c \
	mpglib.lib libmp3lame.lib mp3wav.$(extension) \
	 rspogg.$(extension) id3.$(extension) fourier.$(extension) \
	 filebuffer.$(extension) ws2_32.lib winmm.lib \
	 test.res def.def dprintf.c folder.c \
	 iir.$(extension) iir2.$(extension) \
	 gain_analysis.$(extension) analisys.$(extension) \
	 id3update.$(extension) detect.$(extension) \
	 dsp.$(extension) assign.$(extension) strings.$(extension) strings2.$(extension) \
	 crc32.c rc4.c wininet.c
	 copy rspov.dll rspov.ori.dll
	 
	upx rspov.dll
	 	 
	fix rspov.dll
	 
#crc32 rspov.dll
		
	 rc rspwav.rc
	 
#copy rspwav.res "C:\aoprojeto\RSP New MP3 Player OCX 1.5.0" /y
	

	
gera:
	-cl /Fegera.exe /DRSPDEBUG gerador.c folder.c dprintf.c
	-gera
	-cl /Fegera2.exe /DRSPDEBUG gerador2.c folder.c dprintf.c
	-gera2
check:


	cl $(CHECK) /I "./" /DUSE_LAYER_2 /DUSE_LAYER_1 /DHAVE_CONFIG_H \
	/DWINDOWS /D_WINDOWS /Ferspov.dll \
	 fourier.c 
	


mp3lib:
	del mpeglib.lib
	"C:\acprojects\rsp wav player\mpeglib\mpeglib.bat"

fast:
	rc test.rc
	cl /Ox /Gy /W2 /DRSPDEBUG123 /MT /I "./" /DUSE_LAYER_2 /DUSE_LAYER_1 /DHAVE_CONFIG_H \
	/LD /DWINDOWS /D_WINDOWS /Ferspov.dll\
	 decoder.c mpglib.lib libmp3lame.lib mp3wav.obj rspogg.obj \
	 id3.c ws2_32.lib\
	 winmm.lib test.res def.def dprintf.obj folder.obj iir.obj iir2.obj\
	 gain_analysis.obj analisys.obj id3update.obj detect.obj
	 rc rspwav.rc
	copy rspwav.res "C:\aoprojeto\RSP New MP3 Player OCX 1.5.0" /y
	

rede:
	cl /DRSPDEBUG /MT /Ox /I "./" /DUSE_LAYER_2 /DUSE_LAYER_1 /DHAVE_CONFIG_H \
	 /Gy /DWINDOWS /D_WINDOWS /Ferede.exe\
	 decoder.c mpglib.lib libmp3lame.lib mp3wav.c rspogg.c \
	 ws2_32.lib\
	 winmm.lib test.res def.def dprintf.c folder.c iir.c \
	 gain_analysis.c analisys.c id3update.c detect.c
	 rc rspwav.rc
	
compile:
	cl /Zs /DRSPDEBUG /MT /I "./" /DUSE_LAYER_2 /DUSE_LAYER_1 /DHAVE_CONFIG_H \
	/LD /Gy /DWINDOWS /D_WINDOWS \
	 decoder.c mp3wav.c rspogg.c \
	 \
	 dprintf.c folder.c iir.c \
	 gain_analysis.c analisys.c id3update.c detect.c
id:
	-indent *.c
	-indent *.h
	-@copy *.*~ c:\zlixoc /y >nul 2>nul
	-@del *.*~  >nul 2>nul
	
idcom:
	indentcom decoder.c
	indentcom test2.cs
	indentcom rspogg.c
	indentcom mp3dec.c
	indentcom mp3wav.c
	indentcom iir.c
	
mak:
	makefile
	
cs:
	csc test2.cs
	
testexe:
	cl /MT rspogg.c vorbisenc_static.lib vorbis_static.lib ogg_static.lib vorbisfile_static.lib 
	
prepro:
	cl /EP /C decoder.c > out.c

limpaid:
	@-rm *.*~ >no.no 2>no.non
	
filebuffer:
	cl /Dfilebufferdebug2 /MT /Od /Zi /Femak.exe filebuffer.c folder.c dprintf.c
	
new:
	cl /Dfilebufferdebug2 /Dnew_modeok /FAs /MT /Od /Zi /Femak.exe filebuffer.c folder.c dprintf.c
	mak >new.txt
ori:
	cl /Dfilebufferdebug2 /MT /Od /Zi /Femak.exe filebuffer.c folder.c dprintf.c
	mak >ori.txt

newu:
	gcc -O3 -Dfilebufferdebug2 -Dnew_modeok -o mak.exe filebuffer.c folder.c dprintf.c
	mak >new.txt
oriu:
	gcc -O3 -Dfilebufferdebug2 -o mak.exe filebuffer.c folder.c dprintf.c
	mak >ori.txt
	
folder:
	notepad "c:\folder.c\folder.c"
	
dsp:
	cl /MT /Ox /Femak.exe /Dtesting_rsp dsp.c  
	
id3v2:
	cl /Zi /Femak.exe /D_debug_v2_ok_ id3.c folder.c dprintf.c
	
gerador:
	cl /Fegera.exe /DRSPDEBUG gerador.c folder.c dprintf.c
	
assembler:
	cl $(OTIMIZACAO) /I "./" /DUSE_LAYER_2 /DUSE_LAYER_1 \
	/DHAVE_CONFIG_H /DWINDOWS /D_WINDOWS /Fetest.exe \
	assembler.c folder.c dprintf.c
gass:
	cl /Feexecuta.exe /DRSPDEBUG asm.c folder.c dprintf.c

did:
	cl /MT /LD /FAsc /Zi /Od /Fedid.dll def.def /DRSPDEBUG assme.c \
	

didold:
	cl /MT /FAsc /Zi /Od /Fedid.exe /DRSPDEBUG assme.c \
	folder.c dprintf.c crc32.c /link  /section:.text,rwe
#crc32 did.exe

stringasm:
	cl /W3 /Festrasm.exe /DRSPDEBUG escasm.c folder.c dprintf.c

crc32:
	cl /FAsc /Zi /Od /Fecrc32.exe /DRSPDEBUG escrc32.c  \
	folder.c dprintf.c crc32.c
fix:
	cl /FAsc /Zi /Od /Fefix.exe /DRSPDEBUG rspfix.c  \
	folder.c dprintf.c crc32.c

geracrcocx:
	crc32 "C:\aoprojeto\RSP New MP3 Player OCX 1.5.0\rsp_software_mp3_ocx_r271.ocx"
	
parcial:
	 rc rspwav.rc
	copy rspwav.res "C:\aoprojeto\RSP New MP3 Player OCX 1.5.0" /y
	
file=mp3wavc.rar

backup:
	-del *.dll
	-del *.pdb
	-del *.exe
	-del *.ilk
	-del *.asm
	-del *.cod
	-del *.txt
	-del *.ocx
	-del $(file)
	rar a -p31415923 $(file) *.*
	copy $(file) c:\thebackup /y
	copy $(file) a:\ /v
