#
# Cygwin gcc
#

TARGET = net_sf_colorer.dll
all: $(TARGET)

shared_path=../../shared/
JAVA_INCLUDE=$(JAVA_HOME)/include/
JAVA_INCLUDE_MD=$(JAVA_INCLUDE)win32/

CYGWIN=-mno-cygwin

obj_output=objs

include $(shared_path)makefile.colorer.cygwin
include makefile.core


DLLMAIN=_DllMain@12

LIBINC = -lwininet
LIBFLAGS = -nostartfiles -mdll -Wl,-e,$(DLLMAIN),-Map=colorer.map $(FLAGS)

$(obj_output_slash)net_sf_colorer.$(obj):
	$(CPP) $(CPPFLAGS) -D__int64='long long'  -Wp,-I$(shared_path),-I$(unzipdir),-I$(JAVA_INCLUDE),-I$(JAVA_INCLUDE_MD),-w -s -O3 -c net_sf_colorer.cpp

$(TARGET): *.cpp *.h $(objs)
	$(LINK) $(LIBFLAGS) -o nul -Wl,--base-file,net_sf_colorer.dll.base $(objs) $(LIBINC)
	$(DLLTOOL) -k -A -z net_sf_colorer.def  $(objs)
	$(DLLTOOL) --dllname net_sf_colorer.dll --base-file net_sf_colorer.dll.base --output-exp net_sf_colorer.dll.exp --def net_sf_colorer.def
	$(LINK) $(LIBFLAGS) -o $@ $(objs) net_sf_colorer.dll.exp $(LIBINC)
	$(RM) net_sf_colorer.dll.base
	$(RM) net_sf_colorer.dll.exp
	$(RM) net_sf_colorer.def

clean:
	$(RM) $(objs) colorer.map
