1 # This file is part of the NoBug debugging library.
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
32 ##### single-threading variant
34 lib_LTLIBRARIES = libnobug.la
35 libnobug_la_SOURCES = \
38 src/nobug_ringbuffer.c \
39 src/nobug_nothread.c \
40 src/nobug_resources.c \
41 src/nobug_coverage.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
59 lib_LTLIBRARIES += libnobugmt.la
60 libnobugmt_la_SOURCES = \
63 src/nobug_ringbuffer.c \
64 src/nobug_resources.c \
66 src/nobug_coverage.c \
68 libnobugmt_la_CFLAGS = $(AM_CFLAGS) @PTHREAD_CFLAGS@ @VALGRIND_CFLAGS@
69 libnobugmt_la_LDFLAGS = -version-info $(libnobug_version)
71 endif # HAVE_THREADING
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
85 $(libnobugmt_la_SOURCES) \
86 $(nobug_rbdump_SOURCES)
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
94 .PRECIOUS: nobug_manual.tex nobug_manual.toc
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
104 a2x -f manpage nobug7.txt
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
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
119 asciidoc -d book -b latex -f $(top_srcdir)/doc/latex.conf -a toc $<
122 pdflatex -draftmode -interaction batchmode $< || true
125 pdflatex -interaction batchmode $<
130 doc: nobug_manual.html nobug_manual.pdf
133 README: nobug_manual.txt
134 grep -v '^//[^/]' < nobug_manual.txt > $(top_srcdir)/README || true
135 git add $(top_srcdir)/README
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;
143 ChangeLog: ChangeLog.new
145 mv ChangeLog ChangeLog.bak; \
147 cat ChangeLog.new .newline ChangeLog.bak >ChangeLog; \
152 admin/get_version.sh >NEWS.new; \
153 echo "--------" >>NEWS.new; \
154 date "+%d %b %Y" >>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"; \
164 cat NEWS.new .newline .newline NEWS.old > NEWS; \
168 release-tag: NEWS ChangeLog README
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;
176 list='$(DIST_ARCHIVES)'; for i in $$list; do \
182 @cd $(top_srcdir); admin/update_version.sh;
186 @cd $(top_srcdir); rm .newline NEWS.new NEWS.old ChangeLog.new ChangeLog.bak;
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"; )