# Makefile for the CLISP module set gtk2

srcdir = .
CC = gcc
CPPFLAGS = -I/usr/pkg/include -I/usr/pkg/include/libxml2 -I/usr/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/X11R7/include -I/usr/pkg/include/freetype2 -I/usr/pkg/include/harfbuzz
CFLAGS = -O2 -fno-builtin-calloc -fno-builtin-malloc -fno-builtin-memalign -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -falign-functions=4 -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -O -DENABLE_UNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES -I. -fPIC
LIBS = 
# defined by AM_PATH_GTK_2_0
GTK_CFLAGS = -I/usr/pkg/include/gtk-2.0 -I/usr/pkg/lib/gtk-2.0/include -I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/X11R7/include -I/usr/pkg/include -I/usr/pkg/include/atk-1.0 -I/usr/pkg/include/gdk-pixbuf-2.0 -pthread -I/usr/pkg/include/fribidi -I/usr/pkg/include/cairo -D_REENTRANT -I/usr/X11R7/include/pixman-1 -I/usr/pkg/include/harfbuzz -I/usr/pkg/include/freetype2 -I/usr/pkg/include/libpng16 -I/usr/pkg/include/glib-2.0 -I/usr/pkg/lib/glib-2.0/include
GTK_LIBS = -L/usr/pkg/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -L/usr/X11R7/lib -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes -latk-1.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpango-1.0 -lgio-2.0 -lcairo -lfontconfig -lXext -lXrender -Wl,-rpath,/usr/X11R7/lib -lX11 -lharfbuzz -lfreetype -lgobject-2.0 -Wl,-R/usr/pkg/lib -lglib-2.0 -lintl
# defined by PKG_CHECK_MODULES
LIBGLADE_CFLAGS = -I/usr/pkg/include/libglade-2.0 -I/usr/pkg/include/gtk-2.0 -I/usr/pkg/lib/gtk-2.0/include -I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/X11R7/include -I/usr/pkg/include -I/usr/pkg/include/atk-1.0 -I/usr/pkg/include/gdk-pixbuf-2.0 -pthread -I/usr/pkg/include/fribidi -I/usr/pkg/include/cairo -D_REENTRANT -I/usr/X11R7/include/pixman-1 -I/usr/pkg/include/harfbuzz -I/usr/pkg/include/freetype2 -I/usr/pkg/include/libpng16 -I/usr/pkg/include/glib-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/libxml2
LIBGLADE_LIBS = -L/usr/pkg/lib -lglade-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -L/usr/X11R7/lib -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes -latk-1.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpango-1.0 -lgio-2.0 -lcairo -lfontconfig -lXext -lXrender -Wl,-rpath,/usr/X11R7/lib -lX11 -lharfbuzz -lfreetype -lgobject-2.0 -lglib-2.0 -lintl -Wl,-R/usr/pkg/lib -lxml2

CLISP = /usr/pkg/bin/clisp -norc -q
CLISP_LINKKIT = /usr/pkg/lib/clisp/linkkit

LN = ln
LN_S = ln -s

MAKE = make

SHELL = /bin/sh

GENERATED = gtk.fas gtk.o preload.lisp
DISTRIBFILES = link.sh Makefile $(GENERATED) \
	$(srcdir)/gtk-server.cfg $(srcdir)/gtk.lisp $(srcdir)/ui.glade
distribdir =

# default target: make the module
clisp-module : $(GENERATED)

gtk.fas gtk.c : $(srcdir)/gtk.lisp $(srcdir)/gtk-server.cfg
	$(CLISP) -c $(srcdir)/gtk.lisp -o ./

gtk.o : gtk.c config.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -I$(CLISP_LINKKIT) $(GTK_CFLAGS) \
		$(LIBGLADE_CFLAGS) -c gtk.c

preload.lisp : $(srcdir)/preload.lisp
	$(LN_S) $(srcdir)/preload.lisp .

# Make a module distribution into $(distribdir)
clisp-module-distrib : clisp-module force
	$(LN) $(DISTRIBFILES) $(distribdir)

clean : force
	rm -f core *.o *.a *.fas *.lib

distclean : clean

force :
