CC =		gcc

GIMPTOOL= gimptool-1.3

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

CFLAGS = $(GIMP_CFLAGS) -O2 -Wall
LDFLAGS = $(GIMP_LDFLAGS) -lm

all:	sharpfeather texturetiler
	@echo
	@echo 'Now type "make install" to install the plug-ins'
	@echo

install: sharpfeather texturetiler
	$(GIMPTOOL) --install-bin sharpfeather
	$(GIMPTOOL) --install-bin texturetiler
	$(GIMPTOOL) --install-script patchsynth.scm
	@echo
	@echo After restarting the Gimp, you should find the following
	@echo items in the pop-up image menu:
	@echo
	@echo '  * Filters/Enhance/Sharpen Feathering'
	@echo '  * Filters/Map/Make Seamless Texture'
	@echo '  * Script-fu/Render/Synthesize Texture...'
	@echo

sharpfeather: sharpfeather.c 
	$(CC) $(CFLAGS) -o $@ sharpfeather.c $(LDFLAGS)

texturetiler: texturetiler.c 
	$(CC) $(CFLAGS) -o $@ texturetiler.c $(LDFLAGS)

clean:
	-rm -f *~ *.o core sharpfeather texturetiler
