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
MODCFLAGS = `pkg-config --cflags gtk+-x11-2.0 \
                                 gthread-2.0`
MODLDFLAGS = `pkg-config --libs gtk+-x11-2.0 \
                                gthread-2.0` -ldebian-installer
else
MODCFLAGS = `pkg-config --cflags gtk+-2.0 gthread-2.0`
MODLDFLAGS = `pkg-config --libs gtk+-2.0 gthread-2.0` -ldebian-installer
endif

# 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
