#
SHELL=/bin/sh

@SET_MAKE@

top_srcdir=@top_srcdir@
srcdir=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
bin_dir=@exec_prefix@/bin
x_includes=@x_includes@
x_libraries=@x_libraries@
fvwm_icons=@fvwm_icons@
fvwm_rc=@fvwm_rc@
fvwm_name=@fvwm_name@
#
# This is where the modules will be installed
#fvwm_dir=@prefix@/lib/X11/@fvwm_name@
fvwm_dir=@libdir@

#
# Dynamic loading options - uncomment for your platform
#
# solaris
DL_CFLAGS = -fPIC
DL_LFLAGS = -r
DL_LIBS = -ldl
# linux
#DL_CFLAGS = -rdynamic
#DL_LFLAGS = -rdynamic -shared
#DL_LIBS = -ldl

#
# Libs
X_LIBRARY=-lX11 @LIBS@
XPM_LIBRARY=-lXpm
XEXT_LIBRARY=-lXext
FVWM_LIBRARY=-l${fvwm_name}
LIBS=-L${top_srcdir}/libs ${x_libraries} ${FVWM_LIBRARY} ${XPM_LIBRARY} ${XEXT_LIBRARY} ${X_LIBRARY} ${DL_LIBS}

EXTRA_DEFINES=-DXPM -DSHAPE -DFVWM_ICONDIR=\"${fvwm_icons}\" -DPLUGINS=\"${fvwm_dir}/plugins\"
CC=@CC@
LD.so=@CC@ ${DL_LFLAGS}
INCLUDES=-I${top_srcdir}/include ${x_includes}
CFLAGS=${INCLUDES} @CFLAGS@ ${EXTRA_DEFINES}
MAKEDEPEND=@MAKEDEPEND@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
RM=@RM@

PROG=FvwmTaskBar

SRCS=FvwmTaskBar.c \
	List.c \
	ButtonArray.c \
	Mallocs.c \
	Colors.c \
	Goodies.c \
	Start.c \
	GoodyLoadable.c

OBJS=FvwmTaskBar.o \
	List.o \
	ButtonArray.o \
	Mallocs.o \
	Colors.o \
	Goodies.o \
	Start.o \
	GoodyLoadable.o

MODULES_SRC=CheckLockModule.c \
	GoodyModule.c \
	ShowDateModule.c \
	MailCheckModule.c

MODULES=CheckLockModule.so \
	GoodyModule.so \
	ShowDateModule.so \
	MailCheckModule.so


all: ${PROG} modules

depend:
	${MAKEDEPEND} ${CFLAGS} ${SRCS}

install: all
	${INSTALL_PROGRAM} ${PROG} ${fvwm_dir}
	for f in `/bin/ls *.so` ; do \
		${INSTALL_PROGRAM} $$f ${fvwm_dir}/plugins ;\
	done

clean:
	${RM} ${PROG} ${OBJS} *~ core *.bak *.so

distclean: clean

modules: ${MODULES}
#	cat INSTALL

CheckLockModule.so: CheckLockModule.c GoodyLoadable.h
	${CC} ${INCLUDES} ${DL_CFLAGS} -c CheckLockModule.c
	${LD.so} -o CheckLockModule.so CheckLockModule.o

GoodyModule.so: GoodyModule.c GoodyLoadable.h
	${CC} ${INCLUDES} ${DL_CFLAGS} -c GoodyModule.c
	${LD.so} -o GoodyModule.so GoodyModule.o

ShowDateModule.so: ShowDateModule.c GoodyLoadable.h
	${CC} ${INCLUDES} ${DL_CFLAGS} -c ShowDateModule.c
	${LD.so} -o ShowDateModule.so ShowDateModule.o

MailCheckModule.so: MailCheckModule.c GoodyLoadable.h
	${CC} ${INCLUDES} ${DL_CFLAGS} -c MailCheckModule.c
	${LD.so} -o MailCheckModule.so MailCheckModule.o

${PROG}: ${OBJS}
	${CC} -o ${PROG} ${OBJS} ${LIBS}
