ACX_PTHREAD needs LDFLAGS=PTHREAD_CFLAGS
[nobug.git] / Makefile.am
blob93a985fa5031c2a89ece395133f1d5c807c4193f
1 # This file is part of the NoBug debugging library.
3 # Copyright (C) 2007, 2008, Christian Thaeter <chth@gmx.net>
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
20 ##### single-threading variant
22 lib_LIBRARIES                           = libnobug.a
23 libnobug_a_SOURCES                      = src/nobug.c src/nobug_env.c src/nobug_ringbuffer.c src/nobug_resources.c
24 libnobug_a_CPPFLAGS                     = -DNOBUG_USE_PTHREAD=0
26 bin_PROGRAMS                            = nobug_rbdump
27 nobug_rbdump_SOURCES                    = src/nobug_rbdump.c
28 nobug_rbdump_LDADD                      = libnobug.a
30 check_PROGRAMS                          = example example_alpha example_beta
31 example_SOURCES                         = tests/example.c
32 example_CPPFLAGS                        = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DNDEBUG
33 example_LDADD                           = libnobug.a
34 example_alpha_SOURCES                   = tests/example.c
35 example_alpha_CPPFLAGS                  = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
36 example_alpha_LDADD                     = libnobug.a
37 example_beta_SOURCES                    = tests/example.c
38 example_beta_CPPFLAGS                   = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_BETA
39 example_beta_LDADD                      = libnobug.a
41 check_PROGRAMS                          += test_nobug_alpha
42 test_nobug_alpha_SOURCES                = tests/test_nobug.c
43 test_nobug_alpha_CPPFLAGS               = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
44 test_nobug_alpha_LDADD                  = libnobug.a
46 check_PROGRAMS                          += test_nobug_resources test_nobug_resources_alpha test_nobug_resources_beta
47 test_nobug_resources_SOURCES            = tests/test_nobug_resources.c
48 test_nobug_resources_CPPFLAGS           = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DNDEBUG
49 test_nobug_resources_LDADD              = libnobug.a
50 test_nobug_resources_alpha_SOURCES      = tests/test_nobug_resources.c
51 test_nobug_resources_alpha_CPPFLAGS     = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
52 test_nobug_resources_alpha_LDADD        = libnobug.a
53 test_nobug_resources_beta_SOURCES       = tests/test_nobug_resources.c
54 test_nobug_resources_beta_CPPFLAGS      = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_BETA
55 test_nobug_resources_beta_LDADD         = libnobug.a
57 check_PROGRAMS                          += test_nobug_thread test_nobug_thread_alpha test_nobug_thread_beta
58 test_nobug_thread_SOURCES               = tests/test_nobug_thread.c
59 test_nobug_thread_CPPFLAGS              = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DNDEBUG
60 test_nobug_thread_LDADD                 = libnobug.a
61 test_nobug_thread_alpha_SOURCES         = tests/test_nobug_thread.c
62 test_nobug_thread_alpha_CPPFLAGS        = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_ALPHA
63 test_nobug_thread_alpha_LDADD           = libnobug.a
64 test_nobug_thread_beta_SOURCES          = tests/test_nobug_thread.c
65 test_nobug_thread_beta_CPPFLAGS         = -I$(top_srcdir)/src -DNOBUG_USE_PTHREAD=0 -DEBUG_BETA
66 test_nobug_thread_beta_LDADD            = libnobug.a
68 ##### multi-threading variant
70 if HAVE_THREADING
72 lib_LIBRARIES                           += libnobugmt.a
73 libnobugmt_a_SOURCES                    = src/nobug.c src/nobug_env.c src/nobug_ringbuffer.c src/nobug_resources.c src/nobug_thread.c
74 libnobugmt_a_CFLAGS                     = @PTHREAD_CFLAGS@
76 check_PROGRAMS                          += example_mt example_mt_alpha example_mt_beta
77 example_mt_SOURCES                      = tests/example.c
78 example_mt_CPPFLAGS                     = -I$(top_srcdir)/src -DNDEBUG
79 example_mt_CFLAGS                       = @PTHREAD_CFLAGS@
80 example_mt_LDFLAGS                      = @PTHREAD_CFLAGS@
81 example_mt_LDADD                        = @PTHREAD_LIBS@ libnobugmt.a
82 example_mt_alpha_SOURCES                = tests/example.c
83 example_mt_alpha_CPPFLAGS               = -I$(top_srcdir)/src -DEBUG_ALPHA
84 example_mt_alpha_CFLAGS                 = @PTHREAD_CFLAGS@
85 example_mt_alpha_LDFLAGS                        = @PTHREAD_CFLAGS@
86 example_mt_alpha_LDADD                  = @PTHREAD_LIBS@ libnobugmt.a
87 example_mt_beta_SOURCES                 = tests/example.c
88 example_mt_beta_CPPFLAGS                = -I$(top_srcdir)/src -DEBUG_BETA
89 example_mt_beta_CFLAGS                  = @PTHREAD_CFLAGS@
90 example_mt_beta_LDFLAGS                 = @PTHREAD_CFLAGS@
91 example_mt_beta_LDADD                   = @PTHREAD_LIBS@ libnobugmt.a
93 check_PROGRAMS                          += test_nobug_mt_alpha
94 test_nobug_mt_alpha_SOURCES             = tests/test_nobug.c
95 test_nobug_mt_alpha_CPPFLAGS            = -I$(top_srcdir)/src -DEBUG_ALPHA
96 test_nobug_mt_alpha_CFLAGS              = @PTHREAD_CFLAGS@
97 test_nobug_mt_alpha_LDFLAGS             = @PTHREAD_CFLAGS@
98 test_nobug_mt_alpha_LDADD               = @PTHREAD_LIBS@ libnobugmt.a
100 check_PROGRAMS                          += test_nobug_deadlock_mt test_nobug_deadlock_mt_alpha test_nobug_deadlock_mt_beta
101 test_nobug_deadlock_mt_SOURCES          = tests/test_nobug_deadlock.c
102 test_nobug_deadlock_mt_CPPFLAGS         = -I$(top_srcdir)/src -DNDEBUG
103 test_nobug_deadlock_mt_CFLAGS           = @PTHREAD_CFLAGS@
104 test_nobug_deadlock_mt_LDFLAGS          = @PTHREAD_CFLAGS@
105 test_nobug_deadlock_mt_LDADD            = @PTHREAD_LIBS@ libnobugmt.a
106 test_nobug_deadlock_mt_alpha_SOURCES    = tests/test_nobug_deadlock.c
107 test_nobug_deadlock_mt_alpha_CPPFLAGS   = -I$(top_srcdir)/src -DEBUG_ALPHA
108 test_nobug_deadlock_mt_alpha_CFLAGS     = @PTHREAD_CFLAGS@
109 test_nobug_deadlock_mt_alpha_LDFLAGS    = @PTHREAD_CFLAGS@
110 test_nobug_deadlock_mt_alpha_LDADD      = @PTHREAD_LIBS@ libnobugmt.a
111 test_nobug_deadlock_mt_beta_SOURCES     = tests/test_nobug_deadlock.c
112 test_nobug_deadlock_mt_beta_CPPFLAGS    = -I$(top_srcdir)/src -DEBUG_BETA
113 test_nobug_deadlock_mt_beta_CFLAGS      = @PTHREAD_CFLAGS@
114 test_nobug_deadlock_mt_beta_LDFLAGS     = @PTHREAD_CFLAGS@
115 test_nobug_deadlock_mt_beta_LDADD       = @PTHREAD_LIBS@ libnobugmt.a
117 check_PROGRAMS                          += test_nobug_resources_mt test_nobug_resources_mt_alpha test_nobug_resources_mt_beta
118 test_nobug_resources_mt_SOURCES         = tests/test_nobug_resources.c
119 test_nobug_resources_mt_CPPFLAGS        = -I$(top_srcdir)/src -DNDEBUG
120 test_nobug_resources_mt_CFLAGS          = @PTHREAD_CFLAGS@
121 test_nobug_resources_mt_LDFLAGS         = @PTHREAD_CFLAGS@
122 test_nobug_resources_mt_LDADD           = @PTHREAD_LIBS@ libnobugmt.a
123 test_nobug_resources_mt_alpha_SOURCES   = tests/test_nobug_resources.c
124 test_nobug_resources_mt_alpha_CPPFLAGS  = -I$(top_srcdir)/src -DEBUG_ALPHA
125 test_nobug_resources_mt_alpha_CFLAGS    = @PTHREAD_CFLAGS@
126 test_nobug_resources_mt_alpha_LDFLAGS   = @PTHREAD_CFLAGS@
127 test_nobug_resources_mt_alpha_LDADD     = @PTHREAD_LIBS@ libnobugmt.a
128 test_nobug_resources_mt_beta_SOURCES    = tests/test_nobug_resources.c
129 test_nobug_resources_mt_beta_CPPFLAGS   = -I$(top_srcdir)/src -DEBUG_BETA
130 test_nobug_resources_mt_beta_CFLAGS     = @PTHREAD_CFLAGS@
131 test_nobug_resources_mt_beta_LDFLAGS    = @PTHREAD_CFLAGS@
132 test_nobug_resources_mt_beta_LDADD      = @PTHREAD_LIBS@ libnobugmt.a
134 check_PROGRAMS                          += test_nobug_thread_mt test_nobug_thread_mt_alpha test_nobug_thread_mt_beta
135 test_nobug_thread_mt_SOURCES            = tests/test_nobug_thread.c
136 test_nobug_thread_mt_CPPFLAGS           = -I$(top_srcdir)/src -DNDEBUG
137 test_nobug_thread_mt_CFLAGS             = @PTHREAD_CFLAGS@
138 test_nobug_thread_mt_LDFLAGS            = @PTHREAD_CFLAGS@
139 test_nobug_thread_mt_LDADD              = @PTHREAD_LIBS@ libnobugmt.a
140 test_nobug_thread_mt_alpha_SOURCES      = tests/test_nobug_thread.c
141 test_nobug_thread_mt_alpha_CPPFLAGS     = -I$(top_srcdir)/src -DEBUG_ALPHA
142 test_nobug_thread_mt_alpha_CFLAGS       = @PTHREAD_CFLAGS@
143 test_nobug_thread_mt_alpha_LDFLAGS      = @PTHREAD_CFLAGS@
144 test_nobug_thread_mt_alpha_LDADD        = @PTHREAD_LIBS@ libnobugmt.a
145 test_nobug_thread_mt_beta_SOURCES       = tests/test_nobug_thread.c
146 test_nobug_thread_mt_beta_CPPFLAGS      = -I$(top_srcdir)/src -DEBUG_BETA
147 test_nobug_thread_mt_beta_CFLAGS        = @PTHREAD_CFLAGS@
148 test_nobug_thread_mt_beta_LDFLAGS       = @PTHREAD_CFLAGS@
149 test_nobug_thread_mt_beta_LDADD         = @PTHREAD_LIBS@ libnobugmt.a
151 endif   # HAVE_THREADING
153 ##### maintainer targets
155 TESTS = $(check_PROGRAMS)
157 meta: ChangeLog
158         w3m -no-cookie -dump 'http://www.pipapo.org/pipawiki/NoBug/Documentation?action=print' |\
159         (read; read; cat) > $(top_srcdir)/README
160         w3m -no-cookie -dump 'http://www.pipapo.org/pipawiki/NoBug/Authors?action=print' |\
161         (read; read; cat) > $(top_srcdir)/AUTHORS
162         w3m -no-cookie -dump 'http://www.pipapo.org/pipawiki/NoBug/News?action=print' |\
163         (read; read; cat) > $(top_srcdir)/NEWS
165 ChangeLog:
166         git whatchanged --max-count=100 | sed -e 's/:.*\.\.\.//' > $(top_srcdir)/ChangeLog
168 release: dist
169         list='$(DIST_ARCHIVES)'; for i in $$list; do \
170                 gpg -s $$i;\
171                 rm $$i;\
172         done