bin_PROGRAMS = ppVizPattern

if HAVE_SVNVERSION
PPVIZPATTERN_VERSION=`$(SVNVERSION) ..`
else
PPVIZPATTERN_VERSION="UNKNOWN"
endif

if HAVE_SVN
PPVIZPATTERN_BRANCH=`$(SVN) info .. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'`
PPVIZPATTERN_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
else
PPVIZPATTERN_BRANCH="UNKNOWN"
PPVIZPATTERN_SOURCE="UNKNOWN"
endif

# Force recompilation of ppVizPatternVersion.c, since it gets the version information
ppVizPatternVersion.c: ppVizPatternVersionDefinitions.h
ppVizPatternVersionDefinitions.h: ppVizPatternVersionDefinitions.h.in FORCE
	-$(RM) ppVizPatternVersionDefinitions.h
	$(SED) -e "s|@PPVIZPATTERN_VERSION@|\"$(PPVIZPATTERN_VERSION)\"|" -e "s|@PPVIZPATTERN_BRANCH@|\"$(PPVIZPATTERN_BRANCH)\"|" -e "s|@PPVIZPATTERN_SOURCE@|\"$(PPVIZPATTERN_SOURCE)\"|" ppVizPatternVersionDefinitions.h.in > ppVizPatternVersionDefinitions.h
FORCE: ;

BUILT_SOURCES = ppVizPatternVersionDefinitions.h


ppVizPattern_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPVIZPATTERN_CFLAGS)
ppVizPattern_LDFLAGS  = $(PSLIB_LIBS)   $(PSMODULE_LIBS)   $(PPVIZPATTERN_LIBS)

ppVizPattern_SOURCES =		\
	ppVizPattern.c		\
	ppVizPatternArguments.c	\
	ppVizPatternCamera.c	\
	ppVizPatternData.c		\
	ppVizPatternLoop.c		\
	ppVizPatternVersion.c            

noinst_HEADERS = \
	ppVizPattern.h

clean-local:
	-rm -f TAGS

# Tags for emacs
tags:
	etags `find . -name \*.[ch] -print`

