SUBDIRS=lib
AUTOMAKE_OPTIONS=foreign

AM_CFLAGS=$(GLIB_CFLAGS) -DLIBDIR=\"$(pkgdatadir)\" -DDLTYPE=\"@DLTYPE@\"
YFLAGS=-d

bin_PROGRAMS=stubby stubby-auto
bin_SCRIPTS=stubby-config
man_MANS=stubby.1 stubby-config.1 stubby-auto.1

EXTRA_DIST=cparser.h pte.h str.h stubby.h $(man_MANS) \
	stubby.pod stubby-config.pod stubby-auto.pod stubby.txt

stubby_SOURCES=cparser.y clexer.l codegen.c pte.c str.c stubby.c type.c
stubby_LDADD=$(GLIB_LIBS)

stubby_auto_SOURCES=stubby-auto.c

all-local: stubby.txt

dist-hook:
	cd example; $(MAKE) clean
	mkdir $(distdir)/example
	cp example/* $(distdir)/example/

%.1: %.pod 
	pod2man --release="Stubby 1.0" \
	 --center="OneGeek Software Documentation" --lax $< > $@

%.txt: %.pod
	pod2text $< > $@