SHELL = @SHELL@
srcdir = @srcdir@
PLATFORM = @with_platform@
PLATFORM_DIR = ../${PLATFORM}
.SUFFIXES:
.SUFFIXES: .c .o

CC = @CC@
LIBS = @LIBS@

CFLAGS = @CFLAGS@ `pkg-config --cflags gtk+-2.0 libxml-2.0` -I.
LDFLAGS = @LDFLAGS@ ${LIBS} `pkg-config --libs gtk+-2.0 libxml-2.0` -I.
EXEC = ${PLATFORM_DIR}/${PROG}

############ Things to change for different programs

PROG = ROX-Session

SRCS = main.c gui_support.c choices.c i18n.c log.c options.c rox_gettext.c \
	session.c wm.c xsettings-common.c xsettings-manager.c

OBJECTS = main.o gui_support.o choices.o i18n.o log.o options.o rox_gettext.o \
	  session.o wm.o xsettings-common.o xsettings-manager.o

############ Things to keep the same

${EXEC}: ${PLATFORM_DIR} ${OBJECTS}
	${CC} -o ${EXEC} ${OBJECTS} ${LDFLAGS}

${PLATFORM_DIR}:
	mkdir ${PLATFORM_DIR}

clean:
	rm -f *.o Makefile.bak

depend:
	makedepend -- $(CFLAGS) -- $(SRCS)

Makefile: Makefile.in config.status
	./config.status

config.h: config.h.in
	./config.status

config.status: configure
	./configure --with-platform="${PLATFORM}" --enable-rox

configure: configure.in
	autoconf

messages.pot: ${SRCS} ../Options.xml
	python po/tips.py
	xgettext --keyword=_ --keyword=N_ --output=$@ ${SRCS} tips
