some doc cosmetics and improvements
[nobug.git] / Makefile.am
blobf860d825bc6cd11c3a3782d6f0ba5c51a4612c0b
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)
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
94 nobug7.txt: doc/nobug7.conf doc/asciidoc.pawk doc/verbatim.pawk $(manual_ASCIIDOCS) $(wildcard $(top_srcdir)/doc/*.txt)
95         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
96         ( cd $(top_srcdir) ; ./pipadoc doc/nobug7.conf doc/asciidoc.pawk doc/verbatim.pawk      \
97                 $(patsubst $(top_srcdir)/%,%,$(wildcard $(top_srcdir)/doc/*.txt))               \
98                 $(manual_ASCIIDOCS) ) >$(top_builddir)/nobug7.txt
101 nobug.7: nobug7.txt
102         a2x -f manpage nobug7.txt
105 test_manual.txt: doc/asciidoc.pawk tests/test.sh
106         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
107         ( cd $(top_srcdir); COM='#' ./pipadoc doc/asciidoc.pawk tests/test.sh ) >$(top_builddir)/test_manual.txt
109 .txt.html:
110         asciidoc -a toc $<
112 .txt.tex:
113         asciidoc -d book -b latex -f $(top_srcdir)/doc/latex.conf -a toc $<
115 .tex.pdf:
116         pdflatex -interaction batchmode $<
119 .txt.ps: .txt
120         a2x -f ps $<
122 doc: nobug_manual.html nobug_manual.pdf
125 README: nobug_manual.txt
126         grep -v '^//[^/]' < nobug_manual.txt > $(top_srcdir)/README || true
127         git add $(top_srcdir)/README
129 ChangeLog.new:
130         @cd $(top_srcdir);                                                                              \
131         git whatchanged --pretty=format:"%n%ai %h%n%aN <%aE>%n%n%s%n%n%b" latest-release..HEAD |        \
132          sed -e 's/^:.*\.\.\.//' >ChangeLog.new;
135 ChangeLog: ChangeLog.new
136         @cd $(top_srcdir);                                      \
137         mv ChangeLog ChangeLog.bak;                             \
138         echo >.newline;                                         \
139         cat ChangeLog.new .newline ChangeLog.bak >ChangeLog;    \
140         git add ChangeLog
142 NEWS.new:
143         @cd $(top_srcdir);                                                                      \
144         admin/get_version.sh >NEWS.new;                                                         \
145         echo "--------" >>NEWS.new;                                                             \
146         date "+%d %b %Y" >>NEWS.new;                                                            \
147         echo >>NEWS.new;                                                                        \
148         git shortlog latest-release..HEAD >>NEWS.new;                                           \
149         echo -e "\n EDIT NEWS.new (Simple full sentences, first person) and then hit enter\n";  \
150         read;
152 NEWS: NEWS.new
153         @cd $(top_srcdir);                              \
154         mv NEWS NEWS.old;                               \
155         echo >.newline;                                 \
156         cat NEWS.new .newline .newline NEWS.old > NEWS; \
157         git add NEWS;
160 release-tag: NEWS ChangeLog README
161         @cd $(top_srcdir);                                                                      \
162         git commit -m "This is release $$(admin/get_version.sh)";                               \
163         git tag -f -s -m "This is release $$(admin/get_version.sh)" $$(admin/get_version.sh);   \
164         git tag -f latest-release;
167 dist-sign:
168         list='$(DIST_ARCHIVES)'; for i in $$list; do    \
169                 gpg -s $$i;                             \
170         done
173 release:
174         @cd $(top_srcdir); admin/update_version.sh;
175         $(MAKE) release-tag
176         $(MAKE) dist
177         $(MAKE) dist-sign
178         @cd $(top_srcdir); rm .newline NEWS.new NEWS.old ChangeLog.new ChangeLog.bak;
182 # TODO filter a nobug_lgpl out, take care for macros which can't be nop (inject goodbad must inject good)
183 #( 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"; )