#repdef == Replacing /.*@/ --> /.*=.*@/
#http://hp.vector.co.jp/authors/VA020429/gccdll.html
#http://www.vector.co.jp/soft/win95/prog/se160172.html

OBJ=cokus-dll.o
OPTIMIZE=-mrtd -g -O3 -Wall
EXENAME=cokus
EXEEXT=dll
LIBFILE=libcokus.a

all:$(OBJ)
	dllwrap -s --export-all --output-def $(EXENAME).def --driver-name gcc -o $(EXENAME).$(EXEEXT) $(OBJ)
#	dlltool --dllname $(EXENAME).$(EXEEXT) --def $(EXENAME).def --output-lib $(LIBFILE)

%.o: ..\src\%.c
	gcc -c $(OPTIMIZE) $<

%.o: ..\src\%.cpp
	gcc -c $(OPTIMIZE) $<

%.o: ..\src\%.asm
	as -o $@ $<
	
%.o: ..\src\%.rc
	windres $<

clean:
	del $(OBJ) *.def *.bak
