CC = /mingw/bin/x86_64-w64-mingw32-g++.exe

GIMPTOOL = /usr/x86_64-w64-mingw32/sys-root/mingw/bin/gimptool-2.0.exe

GIMP_LDFLAGS=`$(GIMPTOOL) --libs`
GIMP_CFLAGS=`$(GIMPTOOL) --cflags`

CFLAGS=$(GIMP_CFLAGS) -L/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/mingw/include -I/mingw/x86_64-w64-mingw32/include -I/python/include -pipe -O3 -mms-bitfields -s -m64 -ffast-math

LDFLAGS=$(GIMP_LDFLAGS) -L/usr/x86_64-w64-mingw32/sys-root/mingw/lib -L/mingw/lib -L/mingw/x86_64-w64-mingw32/lib -L/mingw/x86_64-w64-mingw32/lib64 -L/python/Lib -L/python/libs -mwindows


all: resynth
	@echo
	@echo 'Now type "make install" to install resynthesizer'
	@echo 

install: resynth smart-enlarge.scm smart-remove.scm
	$(GIMPTOOL) --install-bin resynth
	$(GIMPTOOL) --install-script smart-enlarge.scm
	$(GIMPTOOL) --install-script smart-remove.scm
	@echo
	@echo After restarting the Gimp you should find the
	@echo following items in the pop-up image menu:
	@echo
	@echo "  * Filters/Map/Resynthesize"
	@echo "  * Filters/Enhance/Smart enlarge"
	@echo "  * Filters/Enhance/Smart sharpen"
	@echo "  * Filters/Enhance/Smart remove selection"
	@echo

resynth: resynth.cc
	$(CC) $(CFLAGS) -o $@ resynth.cc $(LDFLAGS)

clean:
	-rm -f *~ *.o core resynth

