include ../../../../globalmakeflags

MODULE = gtk
SOBJ = gtk.so
OBJS = cdebconf_gtk.opic \
       select_handlers.opic \
       descriptions.opic \
       choice_model.opic \
       progress.opic \
       go.opic \
       handlers.opic \
       ui.opic \
       align_text_renderer.opic

ifneq ($(strip $(filter -DDI_UDEB, $(CFLAGS))),)
OBJS += screenshot.opic di.opic
endif

MODCFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/gio-unix-2.0/  
MODLDFLAGS = -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lcairo -lfreetype -lfontconfig -lpango-1.0 -lgmodule-2.0 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0  

MODCFLAGS += -DGTK_DISABLE_DEPRECATED

# XXX: Does not work because of a path issue, needs to be fixed.
#MODLDFLAGS += -Wl,--version-script=linker-script

# let the type char be unsigned by default
MODCFLAGS += -funsigned-char
# apply strict aliasing rules
MODCFLAGS += -fstrict-aliasing
# turn on all common warnings
MODCFLAGS += -Wall
# turn on extra warnings
MODCFLAGS += -W
# treat warnings as errors
MODCFLAGS += -Werror
# warn about undefined preprocessor identifiers
MODCFLAGS += -Wundef
# warn about casting of pointers to increased alignment requirements
# (XXX: can't be used due to broken GTK_PROGRESS_BAR)
#MODCFLAGS += -Wcast-align
# make string constants const
MODCFLAGS += -Wwrite-strings
# warn about comparisons between signed and unsigned values
MODCFLAGS += -Wsign-compare
# warn about unused declared stuff
MODCFLAGS += -Wno-unused-parameter
# warn about variables which are initialized with themselves
MODCFLAGS += -Winit-self
# warn about pointer arithmetic on void* and function pointers
MODCFLAGS += -Wpointer-arith
# warn about multiple declarations
MODCFLAGS += -Wredundant-decls
# do not warn about zero-length formats.
MODCFLAGS += -Wno-format-zero-length
# missing prototypes
MODCFLAGS += -Wmissing-prototypes
# warn about functions without format attribute that should have one
MODCFLAGS += -Wmissing-format-attribute

include ../modules.mak

install::
ifneq ($(TARGET),udeb)
	install -m 644 ${srcdir}/src/modules/frontend/gtk/cdebconf_gtk.h $(DESTDIR)${incdir}
endif
