+PREFIX=/usr
+
all: src examples
-.PHONY: src examples
+.PHONY: src examples clean install
src:
$(MAKE) -C src
examples: src
$(MAKE) -C examples
+
+install:
+ mkdir -p "$(DESTDIR)$(PREFIX)/lib/boost-statechart-viewer"
+ install -m0644 src/visualizer.so "$(DESTDIR)$(PREFIX)/lib/boost-statechart-viewer"
+ mkdir -p "$(DESTDIR)$(PREFIX)/bin"
+ install src/boost-statechart-viewer "$(DESTDIR)$(PREFIX)/bin"
+
+clean:
+ $(MAKE) -C src $@
+ $(MAKE) -C examples $@
--- /dev/null
+.\" Hey, EMACS: -*- nroff -*-
+.\" (C) Copyright 2012 Michal Sojka <sojkam1@fel.cvut.cz>,
+.\"
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH BOOST-STATECHART-VIEWER 1 "December 15, 2012"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+boost-statechart-viewer \- program for visualization of state machines
+written in C++ with boost/statechart library
+.SH SYNOPSIS
+.B boost-statechart-viewer
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B boost-statechart-viewer
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBboost-statechart-viewer\fP is a program that...
+.SH OPTIONS
+This program takes no options.
+\" These programs follow the usual GNU command line syntax, with long
+\" options starting with two dashes (`-').
+\" A summary of options is included below.
+\" For a complete description, see the Info files.
+\" .TP
+\" .B \-h, \-\-help
+\" Show summary of options.
+\" .TP
+\" .B \-v, \-\-version
+\" Show version of program.
+.SH SEE ALSO
+.BR clang++ (1).
--- /dev/null
+Document: boost-statechart-viewer
+Title: Debian boost-statechart-viewer Manual
+Author: <insert document author here>
+Abstract: This manual describes what boost-statechart-viewer is
+ and how it can be used to
+ manage online manuals on Debian systems.
+Section: unknown
+
+Format: debiandoc-sgml
+Files: /usr/share/doc/boost-statechart-viewer/boost-statechart-viewer.sgml.gz
+
+Format: postscript
+Files: /usr/share/doc/boost-statechart-viewer/boost-statechart-viewer.ps.gz
+
+Format: text
+Files: /usr/share/doc/boost-statechart-viewer/boost-statechart-viewer.text.gz
+
+Format: HTML
+Index: /usr/share/doc/boost-statechart-viewer/html/index.html
+Files: /usr/share/doc/boost-statechart-viewer/html/*.html
--- /dev/null
+debian/boost-statechart-viewer.1
--- /dev/null
+boost-statechart-viewer (20121215) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Michal Sojka <sojkam1@fel.cvut.cz> Sat, 15 Dec 2012 16:49:39 +0100
--- /dev/null
+Source: boost-statechart-viewer
+Section: devel
+Priority: extra
+Maintainer: Michal Sojka <sojkam1@fel.cvut.cz>
+Build-Depends: debhelper (>= 8.0.0), autotools-dev, libclang-dev (>= 3.1), llvm-3.1-dev
+Standards-Version: 3.9.3
+Homepage: https://rtime.felk.cvut.cz/statechart-viewer/
+#Vcs-Git: git://git.debian.org/collab-maint/boost-statechart-viewer.git
+#Vcs-Browser: http://git.debian.org/?p=collab-maint/boost-statechart-viewer.git;a=summary
+
+Package: boost-statechart-viewer
+Architecture: any
+Depends: clang (>= 3.1), ${shlibs:Depends}, ${misc:Depends}
+Description: Visualization of state machines written with boost/statechart library
+ Boost-statechart-viewer is a program for visualization of state
+ machines written in C++ with boost/statechart library. The program
+ itself is written in C++ and uses clang from LLVM project for
+ analyzing the source code.
--- /dev/null
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: boost-statechart-viewer
+Source: <url://example.com>
+
+Files: *
+Copyright: <years> <put author's name and email here>
+ <years> <likewise for another author>
+License: GPL-3.0+
+
+Files: debian/*
+Copyright: 2012 Michal Sojka <sojkam1@fel.cvut.cz>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
+# Please avoid to pick license terms that are more restrictive than the
+# packaged work, as it may make Debian's contributions unacceptable upstream.
--- /dev/null
+Readme.txt
+Readme.txt
--- /dev/null
+?package(boost-statechart-viewer):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\
+ title="boost-statechart-viewer" command="/usr/bin/boost-statechart-viewer"
--- /dev/null
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ echo "LLVM_CONFIG := llvm-config-3.1" > Makefile.config
+ echo "LIBDIR := /usr/lib/boost-statechart-viewer" >> Makefile.config
+
+override_dh_auto_build:
+ $(MAKE) -C src
--- /dev/null
+3.0 (native)
--- /dev/null
+shlibs:Depends=libc6 (>= 2.2.5), libffi5 (>= 3.0.4), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.6)
--- /dev/null
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# See uscan(1) for format
+
+# Compulsory line, this is a version 3 file
+version=3
+
+# Uncomment to examine a Webpage
+# <Webpage URL> <string match>
+#http://www.example.com/downloads.php boost-statechart-viewer-(.*)\.tar\.gz
+
+# Uncomment to examine a Webserver directory
+#http://www.example.com/pub/boost-statechart-viewer-(.*)\.tar\.gz
+
+# Uncommment to examine a FTP server
+#ftp://ftp.example.com/pub/boost-statechart-viewer-(.*)\.tar\.gz debian uupdate
+
+# Uncomment to find new files on sourceforge, for devscripts >= 2.9
+# http://sf.net/boost-statechart-viewer/boost-statechart-viewer-(.*)\.tar\.gz
+
+# Uncomment to find new files on GooglePages
+# http://example.googlepages.com/foo.html boost-statechart-viewer-(.*)\.tar\.gz
-include ../Makefile.config
-.PHONY: all
-all: test.pdf StopWatch.pdf main.pdf Camera/Main.pdf Keyboard.pdf
+.PHONY: all clean
+
+PDF = test.pdf StopWatch.pdf main.pdf Camera/Main.pdf Keyboard.pdf
+
+all: $(PDF)
+
+clean:
+ rm -f $(PDF)
CLANG++ ?= $(shell $(LLVM_CONFIG) --bindir)/clang++
ifeq ($(wildcard $(CLANG++)),)
LLVM_FLAGS := $(shell $(LLVM_CONFIG) --cxxflags --ldflags --libs jit core)
LLVM_FLAGS := $(filter-out -DNDEBUG,$(LLVM_FLAGS))
+LIBDIR ?= $(CURDIR)
+
CLANG_LIBS := -lclangParse -lclangFrontend -lclangSerialization \
-lclangDriver -lclangCodeGen -lclangSema -lclangAnalysis \
-lclangRewrite -lclangAST -lclangLex -lclangBasic -lclangEdit
+all: visualizer.so boost-statechart-viewer
+
visualizer.so: visualizer.cpp
$(CXX) -g -fno-rtti -shared -Wall $(CLANG_LIBS) $(LLVM_FLAGS) -o $@ $<
+
+boost-statechart-viewer: boost-statechart-viewer.sh
+ sed -e s,@libdir@,$(LIBDIR), $< > $@
+
+clean:
+ rm -f boost-statechart-viewer visualizer.so
for src in "$@"; do
s=${src%.cpp}
- clang -Xclang -load -Xclang ../src/visualizer.so -Xclang -plugin -Xclang visualize-statechart -c $src
+ clang++ -Xclang -load -Xclang @libdir@/visualizer.so -Xclang -plugin -Xclang visualize-statechart -c $src
dot -Tps $s.dot > $s.eps
epstopdf $s.eps > $s.pdf
rm $s.dot $s.eps