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
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
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
114 asciidoc -d book -b latex -f $(top_srcdir)/doc/latex.conf -a toc $<
117 pdflatex -draftmode -interaction batchmode $< || true
120 pdflatex -interaction batchmode $<
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
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
140 mv ChangeLog ChangeLog.bak; \
142 cat ChangeLog.new .newline ChangeLog.bak >ChangeLog; \
147 admin/get_version.sh >NEWS.new; \
148 echo "--------" >>NEWS.new; \
149 date "+%d %b %Y" >>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"; \
159 cat NEWS.new .newline .newline NEWS.old > NEWS; \
163 release-tag: NEWS ChangeLog README
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;
171 list='$(DIST_ARCHIVES)'; for i in $$list; do \
177 @cd $(top_srcdir); admin/update_version.sh;
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"; )