WMBIFF_VERSION="0.2p"
prefix=
BIN=/usr/local/bin
MAN=/usr/local/man
CONF=/etc
LIBDIR = -L/usr/X11R6/lib
LIBS   = -lXpm -lXext -lX11
CFLAGS = -O2 -Wall -DWMBIFF_VERSION='$(WMBIFF_VERSION)'
#CFLAGS = -g -Wall -pedantic -DWMBIFF_VERSION='$(WMBIFF_VERSION)'
OBJS =	wmbiff.o socket.o \
	Pop3Client.o Imap4Client.o LicqClient.o mboxClient.o \
	maildirClient.o \
	../wmgeneral/wmgeneral.o \
	../wmgeneral/misc.o \
	../wmgeneral/list.o

INSTALL = /usr/bin/install -p

.c.o:
	gcc  $(CFLAGS) -c -Wall $< -o $*.o

all: wmbiff-master.xpm wmbiff

wmbiff-master.xpm:
	ln -s wmbiff-master-led.xpm wmbiff-master.xpm

wmbiff:	$(OBJS)
	gcc $(CFLAGS) -o wmbiff -lX11 -lnsl $^ $(LIBDIR) $(LIBS)

clean: indent
	for i in $(OBJS) ; do \
		rm -f $$i ; \
	done
	rm -f wmbiff *~ tags core

install: wmbiff
	$(INSTALL) -m 755 wmbiff $(prefix)$(BIN)
	$(INSTALL) -m 755 wmbiff.1 $(prefix)$(MAN)/man1/
	$(INSTALL) -m 755 wmbiffrc.5 $(prefix)$(MAN)/man5
#	strip $(prefix)$(BIN)/wmbiff
#	chmod 755 $(prefix)$(BIN)/wmbiff

# CODING STYLE AND INDENTATION [2001-Mar-12]:
#
# There have been some problems with coding style in the past.  Many people
# contributed to wmbiff (thank you!), and the code got really messy.  To help
# resolve this, I used GNU indent with what I believe to be the most
# widely-accepted coding style options (K&R style) with 4-space TAB indents
# (because some of the code is highly nested) to clean up the code.  Not
# everyone may be happy with this, but has been determined to be necessary for
# consistency and legibility.
#
# In other words, make sure you run "make clean" or "make indent", and do not
# change the options on the indent command, before you submit patches against
# wmbiff.  This will make everyone's life easier.
#
#	-- Dwayne C. Litzenberger <dlitz@dlitz.net>
indent:
	indent -npro -kr -i4 -ts4 *.[ch] || true
