-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile.am
482 lines (400 loc) · 13.7 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
TRACE_LEVEL=@TRACE_VAR@
RPMBUILD ?= $(PWD)/rpmbuild
#Some old versions of automake don't define builddir
builddir ?= .
# Workaround for gettext whinging
SUBDIRS =
dist_noinst_DATA = \
m4 \
COPYING \
COPYING.LESSER \
path_utils/libpath_utils.sym \
dhash/libdhash.sym \
collection/libcollection.sym \
refarray/libref_array.sym \
basicobjects/libbasicobjects.sym \
ini/libini_config.sym
##############################################################################
# Common
##############################################################################
AM_CFLAGS =
if HAVE_GCC
AM_CFLAGS += \
-Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \
-Wcast-align -Wwrite-strings -Wextra -Wno-unused-parameter \
-Wno-sign-compare -Wformat-security -Wmissing-prototypes -Wundef
endif
AM_CPPFLAGS = \
-I$(srcdir)/collection \
-I$(srcdir)/path_utils \
-I$(srcdir)/refarray \
-I$(srcdir)/dhash \
-I$(srcdir)/ini \
-I$(srcdir)/basicobjects \
-I$(srcdir) \
-I$(srcdir)/trace \
$(TRACE_LEVEL)
ACLOCAL_AMFLAGS = -I m4
DOXYGEN = @DOXYGEN@
pkgconfigdir = $(libdir)/pkgconfig
dist_pkgconfig_DATA =
dist_doc_DATA =
dist_examples_DATA =
dist_include_HEADERS =
lib_LTLIBRARIES =
check_PROGRAMS =
TESTS =
examplesdir = $(docdir)/examples
##############################################################################
# Path Utils
##############################################################################
lib_LTLIBRARIES += libpath_utils.la
dist_pkgconfig_DATA += path_utils/path_utils.pc
dist_include_HEADERS += path_utils/path_utils.h
libpath_utils_la_SOURCES = path_utils/path_utils.c
libpath_utils_la_DEPENDENCIES = path_utils/libpath_utils.sym
libpath_utils_la_LIBADD = $(LTLIBICONV) \
$(LTLIBINTL)
libpath_utils_la_LDFLAGS = \
-version-info 1:1:0
if HAVE_LD_VERSION_SCRIPT
libpath_utils_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/path_utils/libpath_utils.sym
endif
if HAVE_CHECK
check_PROGRAMS += path_utils_ut \
ini_augment_ut_check \
ini_configmod_ut_check \
ini_parse_ut_check \
ini_validators_ut_check \
$(NULL)
TESTS += path_utils_ut \
ini_augment_ut_check \
ini_configmod_ut_check \
ini_parse_ut_check \
ini_validators_ut_check \
$(NULL)
endif
path_utils_ut_SOURCES = path_utils/path_utils_ut.c
path_utils_ut_CFLAGS = \
$(AM_CFLAGS) \
$(CHECK_CFLAGS)
path_utils_ut_LDADD = \
$(CHECK_LIBS) \
libpath_utils.la
path_utils-docs:
if HAVE_DOXYGEN
cd path_utils; \
$(DOXYGEN) path_utils.cfg.doxy;
endif
dist_doc_DATA += path_utils/README.path_utils
##############################################################################
# dhash
##############################################################################
lib_LTLIBRARIES += libdhash.la
dist_pkgconfig_DATA += dhash/dhash.pc
dist_include_HEADERS += dhash/dhash.h
libdhash_la_SOURCES = dhash/dhash.c
libdhash_la_DEPENDENCIES = dhash/libdhash.sym
libdhash_la_LDFLAGS = \
-version-info 2:0:1
if HAVE_LD_VERSION_SCRIPT
libdhash_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/dhash/libdhash.sym
endif
check_PROGRAMS += dhash_test dhash_example
TESTS += dhash_test dhash_example
if HAVE_CHECK
check_PROGRAMS += dhash_ut_check
TESTS += dhash_ut_check
endif
dhash_test_SOURCES = dhash/examples/dhash_test.c
dhash_test_LDADD = libdhash.la
dhash_example_SOURCES = dhash/examples/dhash_example.c
dhash_example_LDADD = libdhash.la
dhash_ut_check_SOURCES = dhash/dhash_ut_check.c
dhash_ut_chech_CFLAGS = $(AM_CFLAGS) \
$(CHECK_CFLAGS) \
$(NULL)
dhash_ut_check_LDADD = libdhash.la \
$(CHECK_LIBS) \
$(NULL)
dist_examples_DATA += \
dhash/examples/dhash_test.c \
dhash/examples/dhash_example.c
dist_doc_DATA += dhash/README.dhash
##############################################################################
# collection
##############################################################################
lib_LTLIBRARIES += libcollection.la
dist_pkgconfig_DATA += collection/collection.pc
dist_include_HEADERS += \
collection/collection.h \
collection/collection_tools.h \
collection/collection_queue.h \
collection/collection_stack.h
libcollection_la_SOURCES = \
collection/collection.c \
collection/collection_tools.c \
collection/collection_cnv.c \
collection/collection_queue.c \
collection/collection_stack.c \
collection/collection_cmp.c \
collection/collection_iter.c \
collection/collection_priv.h \
trace/trace.h
libcollection_la_DEPENDENCIES = collection/libcollection.sym
libcollection_la_LDFLAGS = \
-version-info 5:1:1
if HAVE_LD_VERSION_SCRIPT
libcollection_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/collection/libcollection.sym
endif
check_PROGRAMS += \
collection_ut \
collection_stack_ut \
collection_queue_ut
TESTS += \
collection_ut \
collection_stack_ut \
collection_queue_ut
collection_ut_SOURCES = collection/collection_ut.c
collection_ut_LDADD = libcollection.la
collection_stack_ut_SOURCES = collection/collection_stack_ut.c
collection_stack_ut_LDADD = libcollection.la
collection_queue_ut_SOURCES = collection/collection_queue_ut.c
collection_queue_ut_LDADD = libcollection.la
collection-docs:
if HAVE_DOXYGEN
cd collection; \
$(DOXYGEN) collection.cfg.doxy
endif
##############################################################################
# refarray
##############################################################################
lib_LTLIBRARIES += libref_array.la
dist_pkgconfig_DATA += refarray/ref_array.pc
dist_include_HEADERS += refarray/ref_array.h
libref_array_la_SOURCES = \
refarray/ref_array.c \
trace/trace.h
libref_array_la_DEPENDENCIES = refarray/libref_array.sym
libref_array_la_LDFLAGS = \
-version-info 3:1:2
if HAVE_LD_VERSION_SCRIPT
libref_array_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/refarray/libref_array.sym
endif
check_PROGRAMS += ref_array_ut
TESTS += ref_array_ut
ref_array_ut_SOURCES = refarray/ref_array_ut.c
ref_array_ut_LDADD = libref_array.la
dist_doc_DATA += refarray/README.ref_array
ref_array-docs:
if HAVE_DOXYGEN
cd refarray; \
$(DOXYGEN) ref_array.cfg.doxy
endif
##############################################################################
# basicobjects
##############################################################################
lib_LTLIBRARIES += libbasicobjects.la
dist_pkgconfig_DATA += basicobjects/basicobjects.pc
dist_include_HEADERS += basicobjects/simplebuffer.h
libbasicobjects_la_SOURCES = \
basicobjects/simplebuffer.c \
trace/trace.h
libbasicobjects_la_DEPENDENCIES = basicobjects/libbasicobjects.sym
libbasicobjects_la_LDFLAGS = \
-version-info 1:0:1
if HAVE_LD_VERSION_SCRIPT
libbasicobjects_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/basicobjects/libbasicobjects.sym
endif
check_PROGRAMS += simplebuffer_ut
TESTS += simplebuffer_ut
simplebuffer_ut_SOURCES = basicobjects/simplebuffer_ut.c
simplebuffer_ut_LDADD = libbasicobjects.la
basicobjects-docs:
if HAVE_DOXYGEN
cd basicobjects; \
$(DOXYGEN) basicobjects.cfg.doxy
endif
##############################################################################
# ini_config
##############################################################################
lib_LTLIBRARIES += libini_config.la
dist_pkgconfig_DATA += ini/ini_config.pc
dist_include_HEADERS += ini/ini_config.h ini/ini_configobj.h \
ini/ini_valueobj.h ini/ini_comment.h \
ini/ini_configmod.h
libini_config_la_SOURCES = \
ini/ini_config.c \
ini/ini_config.h \
ini/ini_get_value.c \
ini/ini_get_array.c \
ini/ini_list.c \
ini/ini_print.c \
ini/ini_parse.c \
ini/ini_metadata.c \
ini/ini_metadata.h \
ini/ini_defines.h \
ini/ini_comment.c \
ini/ini_comment.h \
ini/ini_valueobj.c \
ini/ini_valueobj.h \
ini/ini_serialize.c \
ini/ini_fileobj.c \
ini/ini_configobj.c \
ini/ini_configobj.h \
ini/ini_configmod.h \
ini/ini_configmod.c \
ini/ini_config_priv.h \
ini/ini_get_valueobj.c \
ini/ini_get_array_valueobj.c \
ini/ini_list_valueobj.c \
ini/ini_augment.c \
trace/trace.h
EXTRA_libini_config_la_DEPENDENCIES = ini/libini_config.sym
libini_config_la_LIBADD = \
libcollection.la \
libpath_utils.la \
libref_array.la \
libbasicobjects.la \
$(LTLIBICONV) \
$(LTLIBINTL)
libini_config_la_LDFLAGS = \
-version-info 7:1:2
if HAVE_LD_VERSION_SCRIPT
libini_config_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/ini/libini_config.sym
endif
dist_noinst_DATA += \
ini/ini.conf \
ini/ini.d/real.conf \
ini/ini.d/test.conf \
ini/ini.d/ipa.conf \
ini/ini.d/foo.conf.in \
ini/ini.d/mysssd.conf \
ini/ini.d/smerge.conf \
ini/ini.d/sexpect.conf \
ini/ini.d/first.conf \
ini/ini.d/second.conf \
ini/ini.d/space.conf \
ini/ini.d/mergecheck.conf \
ini/ini.d/comment.conf \
ini/ini.d/real8.conf \
ini/ini.d/real16be.conf \
ini/ini.d/real16le.conf \
ini/ini.d/real32be.conf \
ini/ini.d/real32le.conf \
ini/ini.d/symbols.conf \
ini/ini.d/new_line.conf \
ini/ini.d/merge.validator \
ini/ini2.d/real8.conf \
ini/ini2.d/real16be.conf \
ini/ini2.d/real16le.conf \
ini/ini2.d/real32be.conf \
ini/ini2.d/real32le.conf
check_PROGRAMS += \
ini_config_ut \
ini_comment_ut \
ini_valueobj_ut \
ini_parse_ut \
ini_augment_ut \
ini_configmod_ut \
ini_save_ut
TESTS += \
ini_config_ut \
ini_comment_ut \
ini_valueobj_ut \
ini_parse_ut \
ini_augment_ut \
ini_configmod_ut \
ini_save_ut
ini_config_ut_SOURCES = ini/ini_config_ut.c
ini_config_ut_LDADD = \
libini_config.la \
libcollection.la
ini_comment_ut_SOURCES = ini/ini_comment_ut.c
ini_comment_ut_LDADD = libini_config.la
ini_valueobj_ut_SOURCES = ini/ini_valueobj_ut.c
ini_valueobj_ut_LDADD = libini_config.la libbasicobjects.la
ini_parse_ut_SOURCES = ini/ini_parse_ut.c
ini_parse_ut_LDADD = libini_config.la libcollection.la libbasicobjects.la
ini_augment_ut_SOURCES = ini/ini_augment_ut.c
ini_augment_ut_LDADD = libini_config.la libcollection.la \
libbasicobjects.la libpath_utils.la libref_array.la
ini_configmod_ut_SOURCES = ini/ini_configmod_ut.c
ini_configmod_ut_LDADD = libini_config.la libcollection.la \
libbasicobjects.la libpath_utils.la libref_array.la
ini_augment_ut_check_SOURCES = ini/ini_augment_ut_check.c
ini_augment_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS)
ini_augment_ut_check_LDADD = libini_config.la $(CHECK_LIBS) \
libref_array.la
ini_configmod_ut_check_SOURCES = ini/ini_configmod_ut_check.c
ini_configmod_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS)
ini_configmod_ut_check_LDADD = libini_config.la libcollection.la \
libbasicobjects.la libpath_utils.la \
libref_array.la \
$(CHECK_LIBS)
ini_parse_ut_check_SOURCES = ini/ini_parse_ut_check.c
ini_parse_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS)
ini_parse_ut_check_LDADD = libini_config.la \
libref_array.la \
$(CHECK_LIBS)
ini_validators_ut_check_SOURCES = ini/ini_validators_ut_check.c
ini_validators_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS)
ini_validators_ut_check_LDADD = libini_config.la $(CHECK_LIBS)
ini_save_ut_SOURCES = ini/ini_save_ut.c
ini_save_ut_LDADD = libini_config.la libcollection.la \
libbasicobjects.la libpath_utils.la libref_array.la
ini_config-docs:
if HAVE_DOXYGEN
cd ini; \
$(DOXYGEN) ini_config.cfg.doxy
endif
clean-local-ini_config:
rm -f ./*.out
rm -f test.ini
rm -f ./foo.conf ./bom* #From ini_parse_ut
rm -f ./merge.validator.* #From ini_augment_ut
rm -f ./real.conf.manual
rm -f ./modtest.conf.real
rm -f ./modtest.conf.exp
rm -f ./test_*
##############################################################################
# Additional rules
##############################################################################
rpmroot:
mkdir -p $(RPMBUILD)/BUILD
mkdir -p $(RPMBUILD)/RPMS
mkdir -p $(RPMBUILD)/SOURCES
mkdir -p $(RPMBUILD)/SPECS
mkdir -p $(RPMBUILD)/SRPMS
rpms: dist-gzip rpmroot
cp $(builddir)/contrib/ding-libs.spec $(RPMBUILD)/SPECS
cp $(distdir).tar.gz $(RPMBUILD)/SOURCES
cd $(RPMBUILD); \
rpmbuild --define "_topdir $(RPMBUILD)" -ba SPECS/ding-libs.spec
if GIT_CHECKOUT
prerelease-rpms:
cp $(srcdir)/version.m4 $(srcdir)/version.m4.orig
sed -e "s/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.*\])/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.`date +%Y%m%d%H`git`git log -1 --pretty=format:%h`\])/" < $(srcdir)/version.m4.orig > $(srcdir)/version.m4
$(MAKE) rpms
mv $(srcdir)/version.m4.orig $(srcdir)/version.m4
endif
# make srpms will use the old digest algorithm to be compatible
# with RHEL5
srpm: dist-gzip rpmroot
cp $(builddir)/contrib/ding-libs.spec $(RPMBUILD)/SPECS
cp $(distdir).tar.gz $(RPMBUILD)/SOURCES
cd $(RPMBUILD); \
rpmbuild --define "_topdir $(RPMBUILD)" \
--define _source_filedigest_algorithm=1 \
-bs SPECS/ding-libs.spec
if GIT_CHECKOUT
prerelease-srpm:
cp $(srcdir)/version.m4 $(srcdir)/version.m4.orig
sed -e "s/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.*\])/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.`date +%Y%m%d%H`git`git log -1 --pretty=format:%h`\])/" < $(srcdir)/version.m4.orig > $(srcdir)/version.m4
$(MAKE) srpm
mv $(srcdir)/version.m4.orig $(srcdir)/version.m4
endif
tests: all $(check_PROGRAMS)
docs: path_utils-docs collection-docs ref_array-docs ini_config-docs basicobjects-docs
clean-local: clean-local-ini_config
rm -Rf doc