## Makefile for building gimp modules with gcc -mno-cygwin
## Use: make -f makefile.cygwin

# Change this to wherever you install the gimp.
GIMP = /gimp
BIN = $(GIMP)/modules

OPTIMIZE = -O

################################################################

# Nothing much configurable below

CC = gcc -mno-cygwin -mpentium -fnative-struct

INSTALL = install

GIMP_VER = 1.1
GTK_VER = 1.3
GLIB_VER = 1.3

GLIB = ../../glib
GMODULE = $(GLIB)/gmodule
GTK = ../../gtk+
INTL = ../../intl

CFLAGS = $(OPTIMIZE) -DHAVE_CONFIG_H -DMODULE_COMPILATION -I. -I.. -I$(GLIB) -I$(GMODULE) -I$(GTK)/gdk -I$(GTK) -I$(INTL)
LDFLAGS = -s

MODULES = \
	colorsel_gtk-$(GIMP_VER).dll \
	colorsel_triangle-$(GIMP_VER).dll \
	colorsel_water-$(GIMP_VER).dll

all : \
	$(MODULES)

install : all
	for m in $(MODULES); do $(INSTALL) $$m $(BIN); done

../config.h : ../config.h.win32
	cp ../config.h.win32 $@

colorsel_gtk-$(GIMP_VER).dll : colorsel_gtk.o module.def
	$(GLIB)/build-dll colorsel_gtk $(GIMP_VER) module.def colorsel_gtk.o $(LDFLAGS) -L ../app -lgimp -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GLIB) -lgmodule-$(GLIB_VER) -lglib-$(GLIB_VER)

colorsel_triangle-$(GIMP_VER).dll : colorsel_triangle.o module.def
	$(GLIB)/build-dll colorsel_triangle $(GIMP_VER) module.def colorsel_triangle.o $(LDFLAGS) -L ../app -lgimp -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk -lgdk-$(GTK_VER) -L $(INTL) -lgnu-intl -L $(GLIB) -lgmodule-$(GLIB_VER) -lglib-$(GLIB_VER)

colorsel_water-$(GIMP_VER).dll : colorsel_water.o module.def
	$(GLIB)/build-dll colorsel_water $(GIMP_VER) module.def colorsel_water.o $(LDFLAGS) -L ../app -lgimp -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk -lgdk-$(GTK_VER) -L $(INTL) -lgnu-intl -L $(GLIB) -lgmodule-$(GLIB_VER) -lglib-$(GLIB_VER)

clean:
	-rm *.dll *.a *.o *.exp *.base
