Merge branch 'devel' into latex
[nobug.git] / Makefile.am
blob8f06707aad083f12cc054f14b10294fdc2c31f90
1 # This file is part of the NoBug debugging library.
3 # Copyright (C)
4 #   2007, 2008, 2009,   Christian Thaeter <ct@pipapo.org>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, contact Christian Thaeter <ct@pipapo.org>.
19 include_HEADERS                         = src/nobug.h
20 pcdir                                   = $(libdir)/pkgconfig
21 pc_DATA                                 = nobug.pc nobugmt.pc
23 ACLOCAL_AMFLAGS = -I m4
25 AM_CFLAGS = $(CONF_CFLAGS) -D_GNU_SOURCE
27 libnobug_version = 2:0:0
29 CLEANFILES =
30 EXTRA_DIST =
32 ##### single-threading variant
34 lib_LTLIBRARIES                         = libnobug.la
35 libnobug_la_SOURCES                     =                               \
36                                         src/nobug.c                     \
37                                         src/nobug_env.c                 \
38                                         src/nobug_ringbuffer.c          \
39                                         src/nobug_nothread.c            \
40                                         src/nobug_resources.c           \
41                                         src/nobug_coverage.c            \
42                                         src/mpool.c
43 libnobug_la_CFLAGS                      = $(AM_CFLAGS) @VALGRIND_CFLAGS@
44 libnobug_la_CPPFLAGS                    = -DNOBUG_USE_PTHREAD=0
45 libnobug_la_LDFLAGS                     = -version-info $(libnobug_version)
48 bin_PROGRAMS                            = nobug_rbdump
49 nobug_rbdump_SOURCES                    = src/nobug_rbdump.c
50 nobug_rbdump_LDADD                      = libnobug.la
51 nobug_rbdump_CFLAGS                     = $(AM_CFLAGS) @VALGRIND_CFLAGS@
53 noinst_HEADERS                          = src/llist.h src/mpool.h
55 ##### multi-threading variant
57 if HAVE_THREADING
59 lib_LTLIBRARIES                         += libnobugmt.la
60 libnobugmt_la_SOURCES                   =                               \
61                                         src/nobug.c                     \
62                                         src/nobug_env.c                 \
63                                         src/nobug_ringbuffer.c          \
64                                         src/nobug_resources.c           \
65                                         src/nobug_thread.c              \
66                                         src/nobug_coverage.c            \
67                                         src/mpool.c
68 libnobugmt_la_CFLAGS                    = $(AM_CFLAGS) @PTHREAD_CFLAGS@ @VALGRIND_CFLAGS@
69 libnobugmt_la_LDFLAGS                   = -version-info $(libnobug_version)
71 endif   # HAVE_THREADING
73 ##### Testsuite
75 include tests/Makefile.am
78 ##### maintainer targets
79 CLEANFILES      += nobug_manual.txt
80 EXTRA_DIST      += pipadoc doc/nobug_manual.conf doc/asciidoc.pawk doc/verbatim.pawk
82 manual_ASCIIDOCS = \
83         $(include_HEADERS) \
84         $(libnobugmt_la_SOURCES) \
85         $(nobug_rbdump_SOURCES)
87 nobug_manual.txt: doc/nobug_manual.conf doc/asciidoc.pawk doc/verbatim.pawk $(manual_ASCIIDOCS) $(wildcard $(top_srcdir)/doc/*.txt) $(wildcard $(top_srcdir)/doc/*.conf)
88         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
89         ( cd $(top_srcdir) ; ./pipadoc doc/nobug_manual.conf doc/asciidoc.pawk doc/verbatim.pawk        \
90                 $(patsubst $(top_srcdir)/%,%,$(wildcard $(top_srcdir)/doc/*.txt))               \
91                 $(manual_ASCIIDOCS) ) >$(top_builddir)/nobug_manual.txt
93 .PRECIOUS: nobug_manual.tex nobug_manual.toc
95 nobug7.txt: doc/nobug7.conf doc/asciidoc.pawk doc/verbatim.pawk $(manual_ASCIIDOCS) $(wildcard $(top_srcdir)/doc/*.txt)
96         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
97         ( cd $(top_srcdir) ; ./pipadoc doc/nobug7.conf doc/asciidoc.pawk doc/verbatim.pawk      \
98                 $(patsubst $(top_srcdir)/%,%,$(wildcard $(top_srcdir)/doc/*.txt))               \
99                 $(manual_ASCIIDOCS) ) >$(top_builddir)/nobug7.txt
102 nobug.7: nobug7.txt
103         a2x -f manpage nobug7.txt
106 test_manual.txt: doc/asciidoc.pawk tests/test.sh
107         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
108         ( cd $(top_srcdir); COM='#' ./pipadoc doc/asciidoc.pawk tests/test.sh ) >$(top_builddir)/test_manual.txt
110 %.html: %.txt
111         asciidoc -a toc $<
113 %.tex: %.txt
114         asciidoc -d book -b latex -f $(top_srcdir)/doc/latex.conf -a toc $<
116 %.toc: %.tex
117         pdflatex -draftmode -interaction batchmode $< || true
119 %.pdf: %.tex %.toc
120         pdflatex -interaction batchmode $<
122 .txt.ps: .txt
123         a2x -f ps $<
125 doc: nobug_manual.html nobug_manual.pdf
128 README: nobug_manual.txt
129         grep -v '^//[^/]' < nobug_manual.txt > $(top_srcdir)/README || true
130         git add $(top_srcdir)/README
132 ChangeLog.new:
133         @cd $(top_srcdir);                                                                              \
134         git whatchanged --pretty=format:"%n%ai %h%n%aN <%aE>%n%n%s%n%n%b" latest-release..HEAD |        \
135          sed -e 's/^:.*\.\.\.//' >ChangeLog.new;
138 ChangeLog: ChangeLog.new
139         @cd $(top_srcdir);                                      \
140         mv ChangeLog ChangeLog.bak;                             \
141         echo >.newline;                                         \
142         cat ChangeLog.new .newline ChangeLog.bak >ChangeLog;    \
143         git add ChangeLog
145 NEWS.new:
146         @cd $(top_srcdir);                                                                      \
147         admin/get_version.sh >NEWS.new;                                                         \
148         echo "--------" >>NEWS.new;                                                             \
149         date "+%d %b %Y" >>NEWS.new;                                                            \
150         echo >>NEWS.new;                                                                        \
151         git shortlog latest-release..HEAD >>NEWS.new;                                           \
152         echo -e "\n EDIT NEWS.new (Simple full sentences, first person) and then hit enter\n";  \
153         read;
155 NEWS: NEWS.new
156         @cd $(top_srcdir);                              \
157         mv NEWS NEWS.old;                               \
158         echo >.newline;                                 \
159         cat NEWS.new .newline .newline NEWS.old > NEWS; \
160         git add NEWS;
163 release-tag: NEWS ChangeLog README
164         @cd $(top_srcdir);                                                                      \
165         git commit -m "This is release $$(admin/get_version.sh)";                               \
166         git tag -f -s -m "This is release $$(admin/get_version.sh)" $$(admin/get_version.sh);   \
167         git tag -f latest-release;
170 dist-sign:
171         list='$(DIST_ARCHIVES)'; for i in $$list; do    \
172                 gpg -s $$i;                             \
173         done
176 release:
177         @cd $(top_srcdir); admin/update_version.sh;
178         $(MAKE) release-tag
179         $(MAKE) dist
180         $(MAKE) dist-sign
181         @cd $(top_srcdir); rm .newline NEWS.new NEWS.old ChangeLog.new ChangeLog.bak;
185 # TODO filter a nobug_lgpl out, take care for macros which can't be nop (inject goodbad must inject good)
186 #( echo -e "#ifndef NOBUG_LGPL_H\n#define NOBUG_LGPL_H\n"; sed 's/^\(#define NOBUG_[^(]*([^)]*)\).*/\1/p;  s/^\(#define [^( ]* [^( ]*\).*/\1/p   ;d' ../src/nobug.h; echo "#endif"; )