ignore pdftex errors
[nobug] / Makefile.am
1 # This file is part of the NoBug debugging library.
2 #
3 # Copyright (C)
4 #   2007, 2008, 2009,   Christian Thaeter <ct@pipapo.org>
5 #
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.
10 #
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.
15 #
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>.
18
19 include_HEADERS                         = src/nobug.h
20 pcdir                                   = $(libdir)/pkgconfig
21 pc_DATA                                 = nobug.pc nobugmt.pc
22
23 ACLOCAL_AMFLAGS = -I m4
24
25 AM_CFLAGS = $(CONF_CFLAGS) -D_GNU_SOURCE
26
27 libnobug_version = 3:0:1
28
29 CLEANFILES =
30 EXTRA_DIST =
31
32 ##### single-threading variant
33
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)
46
47
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@
52
53 noinst_HEADERS                          = src/llist.h src/mpool.h
54
55 ##### multi-threading variant
56
57 if HAVE_THREADING
58
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)
70
71 endif   # HAVE_THREADING
72
73 ##### Testsuite
74
75 include tests/Makefile.am
76
77
78 ##### maintainer targets
79 CLEANFILES      += nobug_manual.txt
80 EXTRA_DIST      += pipadoc doc/nobug_manual.conf doc/asciidoc.pawk doc/verbatim.pawk
81
82 manual_ASCIIDOCS =                              \
83         tests/test.sh                           \
84         $(include_HEADERS)                      \
85         $(libnobugmt_la_SOURCES)                \
86         $(nobug_rbdump_SOURCES)
87
88 nobug_manual.txt: test_inc.txt doc/nobug_manual.conf doc/asciidoc.pawk doc/verbatim.pawk $(manual_ASCIIDOCS) $(wildcard $(top_srcdir)/doc/*.txt) $(wildcard $(top_srcdir)/doc/*.conf)
89         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
90         ( cd $(top_srcdir) ; COMRE='//' ./pipadoc doc/nobug_manual.conf doc/asciidoc.pawk doc/verbatim.pawk     \
91                 $(patsubst $(top_srcdir)/%,%,$(wildcard $(top_srcdir)/doc/*.txt))               \
92                 $(manual_ASCIIDOCS) ) >$(top_builddir)/nobug_manual.txt
93
94 .PRECIOUS: nobug_manual.tex nobug_manual.toc
95
96 nobug7.txt: doc/nobug7.conf doc/asciidoc.pawk doc/verbatim.pawk $(manual_ASCIIDOCS) $(wildcard $(top_srcdir)/doc/*.txt)
97         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
98         ( cd $(top_srcdir) ; ./pipadoc doc/nobug7.conf doc/asciidoc.pawk doc/verbatim.pawk      \
99                 $(patsubst $(top_srcdir)/%,%,$(wildcard $(top_srcdir)/doc/*.txt))               \
100                 $(manual_ASCIIDOCS) ) >$(top_builddir)/nobug7.txt
101
102
103 nobug.7: nobug7.txt
104         a2x -f manpage nobug7.txt
105
106 test_inc.txt: doc/asciidoc.pawk doc/test_inc.conf tests/test.sh
107         @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
108         ( cd $(top_srcdir);     \
109         COM='#' ./pipadoc doc/asciidoc.pawk doc/test_inc.conf tests/test.sh ) >$(top_builddir)/test_inc.txt
110
111 #test_manual.txt: doc/asciidoc.pawk tests/test.sh
112 #       @which gawk >/dev/null || ( echo "gawk not installed!"; exit 1; )
113 #       ( cd $(top_srcdir); COM='#' ./pipadoc doc/asciidoc.pawk tests/test.sh ) >$(top_builddir)/test_manual.txt
114
115 %.html: %.txt
116         asciidoc -a toc $<
117
118 %.tex: %.txt
119         asciidoc -d book -b latex -f $(top_srcdir)/doc/latex.conf -a toc $<
120
121 %.toc: %.tex
122         pdflatex -draftmode -interaction batchmode $< || true
123
124 %.pdf: %.tex %.toc
125         pdflatex -interaction batchmode $< || true
126
127 .txt.ps: .txt
128         a2x -f ps $<
129
130 doc: nobug_manual.html nobug_manual.pdf
131
132
133 README: nobug_manual.txt
134         grep -v '^\(\(// .*//\)\|\([a-z]\+:\+.*\[.*\]\(::.*\)*\)\)$$' < nobug_manual.txt > $(top_srcdir)/README || true
135         git add $(top_srcdir)/README
136
137 ChangeLog.new:
138         @cd $(top_srcdir);                                                                              \
139         git whatchanged --pretty=format:"%n%ai %h%n%aN <%aE>%n%n%s%n%n%b" latest-release..HEAD |        \
140          sed -e 's/^:.*\.\.\.//' >ChangeLog.new;
141
142
143 ChangeLog: ChangeLog.new
144         @cd $(top_srcdir);                                      \
145         mv ChangeLog ChangeLog.bak;                             \
146         echo >.newline;                                         \
147         cat ChangeLog.new .newline ChangeLog.bak >ChangeLog;    \
148         git add ChangeLog
149
150 NEWS.new:
151         @cd $(top_srcdir);                                                                      \
152         admin/get_version.sh >NEWS.new;                                                         \
153         echo "--------" >>NEWS.new;                                                             \
154         date "+%d %b %Y" >>NEWS.new;                                                            \
155         echo >>NEWS.new;                                                                        \
156         git shortlog latest-release..HEAD >>NEWS.new;                                           \
157         echo -e "\n EDIT NEWS.new (Simple full sentences, first person) and then hit enter\n";  \
158         read;
159
160 NEWS: NEWS.new
161         @cd $(top_srcdir);                              \
162         mv NEWS NEWS.old;                               \
163         echo >.newline;                                 \
164         cat NEWS.new .newline .newline NEWS.old > NEWS; \
165         git add NEWS;
166
167
168 release-tag: NEWS ChangeLog README
169         @cd $(top_srcdir);                                                                      \
170         git commit -m "This is release $$(admin/get_version.sh)";                               \
171         git tag -f -s -m "This is release $$(admin/get_version.sh)" $$(admin/get_version.sh);   \
172         git tag -f latest-release;
173
174
175 dist-sign:
176         list='$(DIST_ARCHIVES)'; for i in $$list; do    \
177                 gpg -s $$i;                             \
178         done
179
180
181 release:
182         @cd $(top_srcdir); admin/update_version.sh;
183         $(MAKE) release-tag
184         $(MAKE) dist
185         $(MAKE) dist-sign
186         @cd $(top_srcdir); rm .newline NEWS.new NEWS.old ChangeLog.new ChangeLog.bak;
187
188
189
190 # TODO filter a nobug_lgpl out, take care for macros which can't be nop (inject goodbad must inject good)
191 #( 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"; )