DEPLIBS = $(DEPXLIB)
#CFLAGS += -Wall -ansi -pedantic

LOCAL_LIBRARIES = $(XPMLIB) $(XLIB)

SRCS = getopt.c getopt1.c misc.c xmisc.c notes.c wmpinboard.c
OBJS = getopt.o getopt1.o misc.o xmisc.o notes.o wmpinboard.o

ComplexProgramTarget(wmpinboard)

dist: all wmpinboard.lsm wmpinboard.1
	chmod 0644 *
	chmod 0755 wmpinboard .
	strip wmpinboard

clean::
	$(RM) $(OBJS)
	$(RM) -rf .xvpics

distclean: clean
	$(RM) Makefile

realclean: distclean
	$(RM) wmpinboard.lsm wmpinboard.1

bindistclean: dist
	$(RM) *.[cho] *.{in,pod,xpm} Makefile* Imakefile INSTALL
	$(RM) -rf .xvpics

wmpinboard.lsm: wmpinboard.h wmpinboard.lsm.in
	sed `grep VERSION wmpinboard.h|head -1|perl -ne '/([\d.]+).*?\((\d+)\s+(\w+)\s+(\d+)/; print "s/__VERSION__/$$1/;s/__DATE__/@{[uc sprintf \"%02d%s%02d\", $$2, $$3, $$4]}/"'` wmpinboard.lsm.in >wmpinboard.lsm

wmpinboard.1: wmpinboard.h wmpinboard.pod
	pod2man --release=v`grep VERSION wmpinboard.h|head -1|perl -ne '/[\d.]+/; print $$&'` --center=wmpinboard wmpinboard.pod >wmpinboard.1

all::
	@test -e ./ReleaseNotes && cat ReleaseNotes || true

install::
	$(INSTALL) -m 0644 wmpinboard.1 $(DESTDIR)/man/man1

DESTDIR = /usr/local
BINDIR  = /bin

