1 # This file is part of the NoBug debugging library.
3 # Copyright (C) 2007, 2008, Christian Thaeter <ct@pipapo.org>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, contact Christian Thaeter <ct@pipapo.org>.
18 include_HEADERS = src/nobug.h
19 pcdir = $(libdir)/pkgconfig
20 pc_DATA = nobug.pc nobugmt.pc
22 ##### single-threading variant
24 lib_LTLIBRARIES = libnobug.la
25 libnobug_la_SOURCES = src/nobug.c src/nobug_env.c src/nobug_ringbuffer.c src/nobug_resources.c
26 libnobug_la_CPPFLAGS = -DNOBUG_USE_PTHREAD=0
28 bin_PROGRAMS = nobug_rbdump
29 nobug_rbdump_SOURCES = src/nobug_rbdump.c
30 nobug_rbdump_LDADD = libnobug.la
32 check_PROGRAMS = example example_alpha example_beta
33 example_SOURCES = tests/example.c
34 example_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DNDEBUG
35 example_LDADD = libnobug.la
36 example_alpha_SOURCES = tests/example.c
37 example_alpha_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
38 example_alpha_LDADD = libnobug.la
39 example_beta_SOURCES = tests/example.c
40 example_beta_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_BETA
41 example_beta_LDADD = libnobug.la
43 check_PROGRAMS += test_nobug_alpha
44 test_nobug_alpha_SOURCES = tests/test_nobug.c
45 test_nobug_alpha_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
46 test_nobug_alpha_LDADD = libnobug.la
48 check_PROGRAMS += test_nobug_resources test_nobug_resources_alpha test_nobug_resources_beta
49 test_nobug_resources_SOURCES = tests/test_nobug_resources.c
50 test_nobug_resources_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DNDEBUG
51 test_nobug_resources_LDADD = libnobug.la
52 test_nobug_resources_alpha_SOURCES = tests/test_nobug_resources.c
53 test_nobug_resources_alpha_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
54 test_nobug_resources_alpha_LDADD = libnobug.la
55 test_nobug_resources_beta_SOURCES = tests/test_nobug_resources.c
56 test_nobug_resources_beta_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_BETA
57 test_nobug_resources_beta_LDADD = libnobug.la
59 check_PROGRAMS += test_nobug_thread test_nobug_thread_alpha test_nobug_thread_beta
60 test_nobug_thread_SOURCES = tests/test_nobug_thread.c
61 test_nobug_thread_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DNDEBUG
62 test_nobug_thread_LDADD = libnobug.la
63 test_nobug_thread_alpha_SOURCES = tests/test_nobug_thread.c
64 test_nobug_thread_alpha_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
65 test_nobug_thread_alpha_LDADD = libnobug.la
66 test_nobug_thread_beta_SOURCES = tests/test_nobug_thread.c
67 test_nobug_thread_beta_CPPFLAGS = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_BETA
68 test_nobug_thread_beta_LDADD = libnobug.la
70 ##### multi-threading variant
74 lib_LTLIBRARIES += libnobugmt.la
75 libnobugmt_la_SOURCES = src/nobug.c src/nobug_env.c src/nobug_ringbuffer.c src/nobug_resources.c src/nobug_thread.c
76 libnobugmt_la_CFLAGS = @PTHREAD_CFLAGS@
78 check_PROGRAMS += example_mt example_mt_alpha example_mt_beta
79 example_mt_SOURCES = tests/example.c
80 example_mt_CPPFLAGS = -I$(top_srcdir)/src -DNDEBUG
81 example_mt_CFLAGS = @PTHREAD_CFLAGS@
82 example_mt_LDFLAGS = @PTHREAD_CFLAGS@
83 example_mt_LDADD = @PTHREAD_LIBS@ libnobugmt.la
84 example_mt_alpha_SOURCES = tests/example.c
85 example_mt_alpha_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_ALPHA
86 example_mt_alpha_CFLAGS = @PTHREAD_CFLAGS@
87 example_mt_alpha_LDFLAGS = @PTHREAD_CFLAGS@
88 example_mt_alpha_LDADD = @PTHREAD_LIBS@ libnobugmt.la
89 example_mt_beta_SOURCES = tests/example.c
90 example_mt_beta_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_BETA
91 example_mt_beta_CFLAGS = @PTHREAD_CFLAGS@
92 example_mt_beta_LDFLAGS = @PTHREAD_CFLAGS@
93 example_mt_beta_LDADD = @PTHREAD_LIBS@ libnobugmt.la
95 check_PROGRAMS += test_nobug_mt_alpha
96 test_nobug_mt_alpha_SOURCES = tests/test_nobug.c
97 test_nobug_mt_alpha_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_ALPHA
98 test_nobug_mt_alpha_CFLAGS = @PTHREAD_CFLAGS@
99 test_nobug_mt_alpha_LDFLAGS = @PTHREAD_CFLAGS@
100 test_nobug_mt_alpha_LDADD = @PTHREAD_LIBS@ libnobugmt.la
102 check_PROGRAMS += test_nobug_deadlock_mt test_nobug_deadlock_mt_alpha test_nobug_deadlock_mt_beta
103 test_nobug_deadlock_mt_SOURCES = tests/test_nobug_deadlock.c
104 test_nobug_deadlock_mt_CPPFLAGS = -I$(top_srcdir)/src -DNDEBUG
105 test_nobug_deadlock_mt_CFLAGS = @PTHREAD_CFLAGS@
106 test_nobug_deadlock_mt_LDFLAGS = @PTHREAD_CFLAGS@
107 test_nobug_deadlock_mt_LDADD = @PTHREAD_LIBS@ libnobugmt.la
108 test_nobug_deadlock_mt_alpha_SOURCES = tests/test_nobug_deadlock.c
109 test_nobug_deadlock_mt_alpha_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_ALPHA
110 test_nobug_deadlock_mt_alpha_CFLAGS = @PTHREAD_CFLAGS@
111 test_nobug_deadlock_mt_alpha_LDFLAGS = @PTHREAD_CFLAGS@
112 test_nobug_deadlock_mt_alpha_LDADD = @PTHREAD_LIBS@ libnobugmt.la
113 test_nobug_deadlock_mt_beta_SOURCES = tests/test_nobug_deadlock.c
114 test_nobug_deadlock_mt_beta_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_BETA
115 test_nobug_deadlock_mt_beta_CFLAGS = @PTHREAD_CFLAGS@
116 test_nobug_deadlock_mt_beta_LDFLAGS = @PTHREAD_CFLAGS@
117 test_nobug_deadlock_mt_beta_LDADD = @PTHREAD_LIBS@ libnobugmt.la
119 check_PROGRAMS += test_nobug_resources_mt test_nobug_resources_mt_alpha test_nobug_resources_mt_beta
120 test_nobug_resources_mt_SOURCES = tests/test_nobug_resources.c
121 test_nobug_resources_mt_CPPFLAGS = -I$(top_srcdir)/src -DNDEBUG
122 test_nobug_resources_mt_CFLAGS = @PTHREAD_CFLAGS@
123 test_nobug_resources_mt_LDFLAGS = @PTHREAD_CFLAGS@
124 test_nobug_resources_mt_LDADD = @PTHREAD_LIBS@ libnobugmt.la
125 test_nobug_resources_mt_alpha_SOURCES = tests/test_nobug_resources.c
126 test_nobug_resources_mt_alpha_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_ALPHA
127 test_nobug_resources_mt_alpha_CFLAGS = @PTHREAD_CFLAGS@
128 test_nobug_resources_mt_alpha_LDFLAGS = @PTHREAD_CFLAGS@
129 test_nobug_resources_mt_alpha_LDADD = @PTHREAD_LIBS@ libnobugmt.la
130 test_nobug_resources_mt_beta_SOURCES = tests/test_nobug_resources.c
131 test_nobug_resources_mt_beta_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_BETA
132 test_nobug_resources_mt_beta_CFLAGS = @PTHREAD_CFLAGS@
133 test_nobug_resources_mt_beta_LDFLAGS = @PTHREAD_CFLAGS@
134 test_nobug_resources_mt_beta_LDADD = @PTHREAD_LIBS@ libnobugmt.la
136 check_PROGRAMS += test_nobug_thread_mt test_nobug_thread_mt_alpha test_nobug_thread_mt_beta
137 test_nobug_thread_mt_SOURCES = tests/test_nobug_thread.c
138 test_nobug_thread_mt_CPPFLAGS = -I$(top_srcdir)/src -DNDEBUG
139 test_nobug_thread_mt_CFLAGS = @PTHREAD_CFLAGS@
140 test_nobug_thread_mt_LDFLAGS = @PTHREAD_CFLAGS@
141 test_nobug_thread_mt_LDADD = @PTHREAD_LIBS@ libnobugmt.la
142 test_nobug_thread_mt_alpha_SOURCES = tests/test_nobug_thread.c
143 test_nobug_thread_mt_alpha_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_ALPHA
144 test_nobug_thread_mt_alpha_CFLAGS = @PTHREAD_CFLAGS@
145 test_nobug_thread_mt_alpha_LDFLAGS = @PTHREAD_CFLAGS@
146 test_nobug_thread_mt_alpha_LDADD = @PTHREAD_LIBS@ libnobugmt.la
147 test_nobug_thread_mt_beta_SOURCES = tests/test_nobug_thread.c
148 test_nobug_thread_mt_beta_CPPFLAGS = -I$(top_srcdir)/src -DEBUG_BETA
149 test_nobug_thread_mt_beta_CFLAGS = @PTHREAD_CFLAGS@
150 test_nobug_thread_mt_beta_LDFLAGS = @PTHREAD_CFLAGS@
151 test_nobug_thread_mt_beta_LDADD = @PTHREAD_LIBS@ libnobugmt.la
153 endif # HAVE_THREADING
155 ##### maintainer targets
157 TESTS = $(check_PROGRAMS)
160 w3m -no-cookie -dump 'http://www.pipapo.org/pipawiki/NoBug/Documentation?action=print' |\
161 (read; read; cat) > $(top_srcdir)/README
162 w3m -no-cookie -dump 'http://www.pipapo.org/pipawiki/NoBug/Authors?action=print' |\
163 (read; read; cat) > $(top_srcdir)/AUTHORS
164 w3m -no-cookie -dump 'http://www.pipapo.org/pipawiki/NoBug/News?action=print' |\
165 (read; read; cat) > $(top_srcdir)/NEWS
168 git whatchanged --max-count=100 | sed -e 's/:.*\.\.\.//' > $(top_srcdir)/ChangeLog
171 list='$(DIST_ARCHIVES)'; for i in $$list; do \