Allow EXTRA_OPTS to override --cpu-used for aom.
[daala.git] / Makefile.am
1 # Libraries
2
3 # Provide the full test output for failed tests when using the parallel
4 # test suite (which is enabled by default with automake 1.13+).
5 export VERBOSE = yes
6
7 lib_LTLIBRARIES = src/libdaalabase.la src/libdaaladec.la src/libdaalaenc.la
8
9 AM_CPPFLAGS = -I$(srcdir)/include
10
11 noinst_HEADERS = \
12         src/block_size.h \
13         src/block_size_enc.h \
14         src/dct.h \
15         src/decint.h \
16         src/dering.h \
17         src/encint.h \
18         src/entcode.h \
19         src/entdec.h \
20         src/entenc.h \
21         src/filter.h \
22         src/generic_code.h \
23         src/internal.h \
24         src/intra.h \
25         src/logging.h \
26         src/mc.h \
27         src/mcenc.h \
28         src/odintrin.h \
29         src/partition.h \
30         src/pvq.h \
31         src/pvq_decoder.h \
32         src/pvq_encoder.h \
33         src/quantizer.h \
34         src/state.h \
35         src/tf.h \
36         src/util.h \
37         src/zigzag.h \
38         src/accounting.h \
39         src/x86/cpu.h \
40         src/x86/x86enc.h \
41         src/x86/x86dct.h \
42         src/x86/x86int.h \
43         src/arm/cpu.h \
44         src/arm/armint.h
45
46 src_dct_SOURCES = src/dct.c src/internal.c
47 if ENABLE_X86ASM
48 src_dct_SOURCES += src/x86/cpu.c
49 if ENABLE_SSE2_INTRINSICS
50 src_dct_SOURCES += src/x86/sse2dct.c
51 %sse2dct.o %sse2dct.lo: CFLAGS += -msse2
52 endif
53 if ENABLE_SSE41_INTRINSICS
54 src_dct_SOURCES += src/x86/sse41dct.c
55 %sse41dct.o %sse41dct.lo: CFLAGS += -msse4.1
56 endif
57 if ENABLE_AVX2_INTRINSICS
58 src_dct_SOURCES += src/x86/avx2dct.c
59 %avx2dct.o %avx2dct.lo: CFLAGS += -mavx2
60 endif
61 endif
62 if ENABLE_ARMASM
63 src_dct_SOURCES += src/arm/cpu.c
64 endif
65
66
67 src_libdaalabase_la_LIBADD = $(LIBM)
68 if DUMP_IMAGES
69   src_libdaalabase_la_LIBADD += $(PNG_LIBS)
70 endif
71 src_libdaalabase_la_LDFLAGS = -no-undefined \
72  -version-info @OD_LT_CURRENT@:@OD_LT_REVISION@:@OD_LT_AGE@
73 src_libdaalabase_la_LDFLAGS +=
74 src_libdaalabase_la_SOURCES = \
75         src/accounting.c \
76         src/entcode.c \
77         src/entdec.c \
78         src/dering.c \
79         src/filter.c \
80         src/generic_code.c \
81         src/generic_decoder.c \
82         src/info.c \
83         src/intra.c \
84         src/laplace_decoder.c \
85         src/laplace_tables.c \
86         src/logging.c \
87         src/mc.c \
88         src/partition.c \
89         src/pvq.c \
90         src/pvq_decoder.c \
91         src/quantizer.c \
92         src/state.c \
93         src/switch_table.c \
94         src/tf.c \
95         src/util.c \
96         src/zigzag4.c \
97         src/zigzag8.c \
98         src/zigzag16.c \
99         src/zigzag32.c \
100         src/zigzag64.c \
101         $(src_dct_SOURCES)
102 if ENABLE_X86ASM
103 src_libdaalabase_la_SOURCES += \
104         src/x86/sse2dering.c \
105         src/x86/sse2mc.c \
106         src/x86/sse2util.c \
107         src/x86/x86state.c
108 endif
109
110 src_libdaaladec_la_LIBADD = src/libdaalabase.la $(LIBM)
111 src_libdaaladec_la_LDFLAGS = -no-undefined \
112  -version-info @OD_LT_CURRENT@:@OD_LT_REVISION@:@OD_LT_AGE@
113 src_libdaaladec_la_SOURCES = \
114         src/decode.c \
115         src/infodec.c
116
117 src_libdaalaenc_la_LIBADD = src/libdaalabase.la $(LIBM)
118 if ENCODER_CHECK
119   src_libdaalaenc_la_LIBADD += src/libdaaladec.la
120 endif
121 src_libdaalaenc_la_LDFLAGS = -no-undefined \
122  -version-info @OD_LT_CURRENT@:@OD_LT_REVISION@:@OD_LT_AGE@
123 src_libdaalaenc_la_SOURCES = \
124         src/block_size_enc.c \
125         src/encode.c \
126         src/entenc.c \
127         src/generic_encoder.c \
128         src/infoenc.c \
129         src/laplace_encoder.c \
130         src/mcenc.c \
131         src/pvq_encoder.c \
132         src/rate.c
133 if ENABLE_X86ASM
134 src_libdaalaenc_la_SOURCES += \
135         src/x86/x86enc.c \
136         src/x86/x86mcenc.c
137 if ENABLE_SSE2_INTRINSICS
138 src_libdaalaenc_la_SOURCES += \
139         src/x86/sse2mcenc.c
140 %sse2mcenc.o %sse2mcenc.lo: CFLAGS += -msse2
141 endif
142 endif
143
144 # Example programs
145
146 noinst_PROGRAMS =
147
148 if ENABLE_EXAMPLES
149   noinst_PROGRAMS += \
150         examples/dump_video \
151         examples/encoder_example
152 endif
153
154
155 if ENABLE_PLAYER_EXAMPLE
156   noinst_PROGRAMS += examples/player_example
157 endif
158
159 if ENABLE_ANALYZER
160   noinst_PROGRAMS += examples/analyzer
161 endif
162
163 examples_dump_video_SOURCES = examples/dump_video.c
164 examples_dump_video_CFLAGS = $(OGG_CFLAGS)
165 examples_dump_video_LDADD = src/libdaalabase.la src/libdaaladec.la  $(OGG_LIBS)
166
167 examples_encoder_example_SOURCES = examples/encoder_example.c
168 examples_encoder_example_CFLAGS = $(OGG_CFLAGS)
169 examples_encoder_example_LDADD = src/libdaalabase.la src/libdaalaenc.la $(OGG_LIBS) $(LIBM)
170
171 if ENABLE_PLAYER_EXAMPLE
172 examples_player_example_SOURCES = examples/player_example.c
173 examples_player_example_CFLAGS = $(OGG_CFLAGS) $(SDL_CFLAGS)
174 examples_player_example_LDADD = src/libdaalabase.la src/libdaaladec.la $(OGG_LIBS) $(SDL_LIBS)
175 endif
176
177 if ENABLE_ANALYZER
178 examples_analyzer_SOURCES = examples/analyzer.cc
179 examples_analyzer_CXXFLAGS = $(OGG_CFLAGS) $(WX_CPPFLAGS)
180 examples_analyzer_LDADD = src/libdaalabase.la src/libdaaladec.la $(OGG_LIBS) $(WX_LIBS)
181 endif
182
183 # Includes
184
185 daalaincludedir = $(includedir)/daala
186 daalainclude_HEADERS = \
187         include/daala/codec.h \
188         include/daala/daaladec.h \
189         include/daala/daalaenc.h \
190         include/daala/daala_integer.h
191
192 # Tools
193
194 CLEANFILES =
195 EXTRA_PROGRAMS =
196
197 if ENABLE_TOOLS
198
199 tools_TARGETS = \
200         tools/png2y4m \
201         tools/y4m2png \
202         tools/dump_psnrhvs \
203         tools/block_size_analysis \
204         tools/to_monochrome \
205         tools/downsample \
206         tools/upsample \
207         tools/divu_const \
208         tools/trans \
209         tools/trans2d \
210         tools/trans_gain \
211         tools/gen_cdf \
212         tools/gen_sqrt_tbl \
213         tools/compute_basis \
214         tools/compute_haar_basis \
215         tools/cos_search \
216         tools/gen_laplace_tables \
217         tools/daalainfo \
218         tools/dump_ssim \
219         tools/dump_fastssim \
220         tools/bjontegaard \
221         tools/yuvjpeg \
222         tools/jpegyuv \
223         tools/yuv2yuv4mpeg \
224         tools/dump_psnr \
225         tools/vq_train \
226         tools/draw_zigzags \
227   tools/dump_msssim \
228   tools/y4m2yuv
229
230 noinst_HEADERS += \
231         tools/cholesky.h \
232         tools/int_search.h \
233         tools/kiss99.h \
234         tools/matidx.h \
235         tools/od_defs.h \
236         tools/od_filter.h \
237         tools/pythag.h \
238         tools/svd.h \
239         tools/trans_tools.h \
240         tools/vidinput.h
241
242 EXTRA_PROGRAMS += $(tools_TARGETS)
243 CLEANFILES += $(tools_TARGETS)
244
245 tools_daalainfo_SOURCES = tools/daalainfo.c
246 tools_daalainfo_CFLAGS = $(OGG_CFLAGS)
247 tools_daalainfo_LDADD = $(OGG_LIBS) src/libdaalabase.la src/libdaaladec.la
248
249 # png2y4m
250 tools_png2y4m_SOURCES = \
251         tools/kiss99.c \
252         tools/png2y4m.c
253 tools_png2y4m_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS)
254 tools_png2y4m_LDADD = $(OGG_LIBS) $(PNG_LIBS)
255
256 # y4m2png
257 tools_y4m2png_SOURCES = \
258         tools/vidinput.c \
259         tools/y4m_input.c \
260         tools/y4m2png.c
261 tools_y4m2png_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS)
262 tools_y4m2png_LDADD = $(OGG_LIBS) $(PNG_LIBS)
263
264 # dump_psnrhvs
265 tools_dump_psnrhvs_SOURCES = \
266         tools/vidinput.c \
267         tools/y4m_input.c \
268         $(src_dct_SOURCES) \
269         tools/dump_psnrhvs.c
270 tools_dump_psnrhvs_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS)
271 tools_dump_psnrhvs_LDADD = $(OGG_LIBS) $(LIBM)
272
273 # dump_ssim
274 tools_dump_ssim_SOURCES = \
275         tools/vidinput.c \
276         tools/y4m_input.c \
277         tools/dump_ssim.c
278 tools_dump_ssim_CFLAGS = $(OGG_CFLAGS)
279 tools_dump_ssim_LDADD = $(OGG_LIBS) $(LIBM)
280
281 # dump_msssim
282 tools_dump_msssim_SOURCES = \
283         tools/vidinput.c \
284         tools/y4m_input.c \
285         tools/dump_msssim.c
286 tools_dump_msssim_CFLAGS = $(OGG_CFLAGS)
287 tools_dump_msssim_LDADD = $(OGG_LIBS) $(LIBM)
288
289 # dump_fastssim
290 tools_dump_fastssim_SOURCES = \
291         tools/vidinput.c \
292         tools/y4m_input.c \
293         tools/dump_fastssim.c
294 tools_dump_fastssim_CFLAGS = $(OGG_CFLAGS)
295 tools_dump_fastssim_LDADD = $(OGG_LIBS) $(LIBM)
296
297 # dump_psnr
298 tools_dump_psnr_SOURCES = \
299         tools/vidinput.c \
300         tools/y4m_input.c \
301         tools/dump_psnr.c
302 tools_dump_psnr_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS)
303 tools_dump_psnr_LDADD = $(OGG_LIBS) $(LIBM)
304
305 # block_size_analysis
306 tools_block_size_analysis_SOURCES = \
307         tools/block_size_analysis.c \
308         src/block_size_enc.c \
309         tools/vidinput.c \
310         tools/y4m_input.c \
311         $(src_dct_SOURCES) \
312         src/logging.c \
313         src/entcode.c \
314         src/entenc.c \
315         src/filter.c \
316         src/switch_table.c
317 tools_block_size_analysis_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS)
318 tools_block_size_analysis_LDADD = $(OGG_LIBS) $(PNG_LIBS) $(LIBM)
319
320 # to_monochrome
321 tools_to_monochrome_SOURCES = \
322         tools/vidinput.c \
323         tools/y4m_input.c \
324         tools/to_monochrome.c
325 tools_to_monochrome_CFLAGS = $(THEORA_CFLAGS) $(OGG_CFLAGS) $(PNG_CFLAGS)
326 tools_to_monochrome_LDADD = $(THEORA_LIBS) $(OGG_LIBS) $(PNG_LIBS)
327
328 # downsample
329 tools_downsample_SOURCES = \
330         tools/vidinput.c \
331         tools/y4m_input.c \
332         tools/downsample.c
333 tools_downsample_CFLAGS = $(THEORA_CFLAGS) $(OGG_CFLAGS) $(PNG_CFLAGS)
334 tools_downsample_LDADD = $(THEORA_LIBS) $(OGG_LIBS) $(PNG_LIBS)
335
336 # upsample
337 tools_upsample_SOURCES = \
338         $(src_dct_SOURCES) \
339         src/dering.c \
340         src/filter.c \
341         src/generic_code.c \
342         src/switch_table.c \
343         src/logging.c \
344         src/info.c \
345         src/mc.c \
346         src/partition.c \
347         src/pvq.c \
348         src/state.c \
349         src/util.c \
350         src/zigzag4.c \
351         src/zigzag8.c \
352         src/zigzag16.c \
353         src/zigzag32.c \
354         src/zigzag64.c \
355         tools/vidinput.c \
356         tools/y4m_input.c \
357         tools/upsample.c
358 if ENABLE_X86ASM
359 tools_upsample_SOURCES += \
360         src/x86/sse2dering.c \
361         src/x86/sse2mc.c \
362         src/x86/sse2util.c \
363         src/x86/x86state.c
364 endif
365 tools_upsample_CFLAGS = $(THEORA_CFLAGS) $(OGG_CFLAGS) $(PNG_CFLAGS)
366 tools_upsample_LDADD = $(THEORA_LIBS) $(OGG_LIBS) $(PNG_LIBS) $(LIBM)
367
368 # divu_const
369 tools_divu_const_SOURCES = \
370         tools/divu_const.c
371 tools_divu_const_CFLAGS = $(OGG_CFLAGS)
372 tools_divu_const_LDADD = $(OGG_LIBS) $(LIBM)
373
374 # trans
375 tools_trans_SOURCES = \
376         tools/trans.c \
377         tools/vidinput.c \
378         tools/y4m_input.c \
379         tools/od_filter.c \
380         tools/trans_tools.c \
381         tools/int_search.c \
382         tools/trans_data.c \
383         tools/kiss99.c \
384         tools/svd.c \
385         tools/cholesky.c \
386         src/filter.c \
387         $(src_dct_SOURCES)
388 tools_trans_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS) $(OPENMP_CFLAGS)
389 tools_trans_LDADD = $(OGG_LIBS) $(PNG_LIBS) $(LIBM)
390
391 # trans_gain
392 tools_trans_gain_SOURCES = \
393         tools/trans_gain.c \
394         tools/vidinput.c \
395         tools/y4m_input.c \
396         tools/od_filter.c \
397         tools/trans_tools.c \
398         src/filter.c \
399         $(src_dct_SOURCES)
400 tools_trans_gain_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS) $(OPENMP_CFLAGS)
401 tools_trans_gain_LDADD = $(OGG_LIBS) $(PNG_LIBS) $(LIBM)
402
403 #trans2d
404 tools_trans2d_SOURCES = \
405         tools/trans2d.c \
406         tools/vidinput.c \
407         tools/y4m_input.c \
408         tools/od_filter.c \
409         tools/trans_tools.c \
410         tools/int_search.c \
411         tools/trans_data.c \
412         tools/kiss99.c \
413         tools/svd.c \
414         tools/cholesky.c \
415         src/filter.c \
416         $(src_dct_SOURCES)
417 tools_trans2d_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS) $(OPENMP_CFLAGS)
418 tools_trans2d_LDADD = $(OGG_LIBS) $(PNG_LIBS) $(LIBM)
419
420 # gen_cdf
421 tools_gen_cdf_SOURCES = \
422         tools/gen_cdf.c
423 tools_gen_cdf_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS)
424 tools_gen_cdf_LDADD = $(OGG_LIBS) $(PNG_LIBS) $(LIBM)
425
426 # gen_sqrt_tbl
427 tools_gen_sqrt_tbl_SOURCES = \
428         tools/gen_sqrt_tbl.c
429 tools_gen_sqrt_tbl_LDADD = $(LIBM)
430
431 # compute_basis
432 tools_compute_basis_SOURCES = \
433         tools/compute_basis.c \
434         src/dct.c \
435         src/filter.c \
436         src/internal.c
437 tools_compute_basis_CFLAGS = $(OGG_CFLAGS)
438 tools_compute_basis_LDADD = $(OGG_LIBS) $(LIBM)
439
440 # compute_haar_basis
441 tools_compute_haar_basis_SOURCES = \
442         tools/compute_haar_basis.c \
443         src/dct.c \
444         src/filter.c \
445         src/internal.c
446 tools_compute_haar_basis_CFLAGS = $(OGG_CFLAGS)
447 tools_compute_haar_basis_LDADD = $(OGG_LIBS) $(LIBM)
448
449 # cos_search
450 tools_cos_search_SOURCES = \
451         tools/cos_search.c
452 tools_cos_search_LDADD = $(LIBM)
453
454 # gen_laplace_tables
455 tools_gen_laplace_tables_SOURCES = \
456         tools/gen_laplace_tables.c
457 tools_gen_laplace_tables_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS)
458 tools_gen_laplace_tables_LDADD = $(OGG_LIBS) $(PNG_LIBS) $(LIBM)
459
460 # bjontegaard
461 tools_bjontegaard_SOURCES = \
462         tools/bjontegaard.c \
463         tools/cholesky.c \
464         tools/qr.c \
465         tools/svd.c
466 tools_bjontegaard_CFLAGS =
467 tools_bjontegaard_LDADD = $(LIBM)
468
469 # yuvjpeg
470 tools_yuvjpeg_SOURCES = \
471         tools/yuvjpeg.c
472 tools_yuvjpeg_CFLAGS =
473 tools_yuvjpeg_LDADD = $(JPEG_LIBS)
474
475 # jpegyuv
476 tools_jpegyuv_SOURCES = \
477         tools/jpegyuv.c
478 tools_jpegyuv_CFLAGS =
479 tools_jpegyuv_LDADD = $(JPEG_LIBS)
480
481 # yuv2yuv4mpeg
482 tools_yuv2yuv4mpeg_SOURCES = \
483         tools/yuv2yuv4mpeg.c
484 tools_yuv2yuv4mpeg_CFLAGS =
485 tools_yuv2yuv4mpeg_LDADD =
486
487 # y4m2yuv
488 tools_y4m2yuv_SOURCES = \
489   tools/vidinput.c \
490   tools/y4m_input.c \
491   tools/y4m2yuv.c
492 tools_y4m2yuv_CFLAGS =
493 tools_y4m2yuv_LDADD =
494
495 # vq_train
496 tools_vq_train_SOURCES = \
497         tools/vq_train.c
498 tools_vq_train_CFLAGS = $(OPENMP_CFLAGS)
499 tools_vq_train_LDADD = $(LIBM)
500
501 # draw_zigzags
502 tools_draw_zigzags_SOURCES = \
503         tools/draw_zigzags.c \
504         src/zigzag4.c \
505         src/zigzag8.c \
506         src/zigzag16.c \
507         src/zigzag32.c \
508         src/zigzag64.c
509 tools_draw_zigzags_CFLAGS =
510 tools_draw_zigzags_LDADD =
511
512
513 endif # ENABLE_TOOLS
514
515 # Tests
516
517 if ENABLE_UNIT_TESTS
518 noinst_PROGRAMS += \
519         src/tests/dcttest \
520         src/tests/ectest \
521         src/tests/test_coef_coder \
522         src/tests/logging_test \
523         src/tests/test_divu_small \
524         src/tests/check_tests
525
526 TESTS = \
527         src/tests/dcttest \
528         src/tests/ectest \
529         src/tests/test_coef_coder \
530         src/tests/logging_test \
531         src/tests/test_divu_small \
532         src/tests/check_tests
533
534 src_tests_dcttest_SOURCES = $(src_dct_SOURCES) src/filter.c
535 src_tests_dcttest_CFLAGS = $(OGG_CFLAGS) \
536  -DOD_DCT_CHECK_OVERFLOW -DOD_DCT_TEST -DOD_ENABLE_ASSERTIONS
537 src_tests_dcttest_LDADD = $(LIBM)
538
539 src_tests_ectest_SOURCES = src/tests/ectest.c
540 src_tests_ectest_CFLAGS = $(OGG_CFLAGS)
541 src_tests_ectest_LDADD = \
542  src/libdaalaenc.la \
543  src/libdaalabase.la \
544  $(LIBM)
545
546 src_tests_test_coef_coder_SOURCES = src/tests/test_coef_coder.c
547 src_tests_test_coef_coder_CFLAGS = $(OGG_CFLAGS)
548 src_tests_test_coef_coder_LDADD = \
549  src/libdaalabase.la \
550  src/libdaaladec.la \
551  src/libdaalaenc.la \
552  $(OGG_LIBS) \
553  $(LIBM)
554
555 src_tests_logging_test_SOURCES = src/tests/logging_test.c
556 src_tests_logging_test_CFLAGS = $(OGG_CFLAGS)
557 src_tests_logging_test_LDADD = \
558  src/libdaalabase.la \
559  src/libdaalaenc.la \
560  $(OGG_LIBS)
561
562 src_tests_test_divu_small_SOURCES = src/tests/test_divu_small.c
563 src_tests_test_divu_small_CFLAGS = $(OGG_CFLAGS)
564 src_tests_test_divu_small_LDADD = \
565  src/libdaalabase.la \
566  $(OGG_LIBS)
567
568 src_tests_check_tests_SOURCES = \
569  src/tests/check_main.c \
570  src/tests/headerencode_test.c
571 src_tests_check_tests_CFLAGS = $(OGG_CFLAGS) $(CHECK_CFLAGS) -Wno-variadic-macros
572 src_tests_check_tests_LDADD = \
573  src/libdaalabase.la \
574  src/libdaaladec.la \
575  src/libdaalaenc.la \
576  $(OGG_LIBS) \
577  $(CHECK_LIBS) \
578  $(LIBM)
579
580 endif
581
582 SUBDIRS=doc
583
584 ACLOCAL_AMFLAGS = -I m4
585
586 AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)
587
588 dist_doc_DATA = COPYING AUTHORS
589
590 pkgconfigdir = $(libdir)/pkgconfig
591 pkgconfig_DATA = daalaenc.pc daaladec.pc
592
593 debug: DEBUG_OPTIONS = -DOD_ENABLE_ASSERTIONS -DOD_LOGGING_ENABLED
594 debug:
595         $(MAKE) CFLAGS="$(CFLAGS) -O0 -ggdb3 $(DEBUG_OPTIONS)" all
596
597 EXTRA_DIST = \
598         daalaenc.pc.in \
599         daaladec.pc.in \
600         daalaenc-uninstalled.pc.in \
601         daaladec-uninstalled.pc.in \
602         tools/unix/Makefile \
603         unix/Makefile
604
605 # Targets to build and install just the library without the docs
606 daala install-daala: NO_DOXYGEN = 1
607
608 daala: all
609 install-daala: install
610
611 if ENABLE_TOOLS
612 tools: $(tools_TARGETS)
613 else
614 tools:
615         @echo "error: Tools support not enabled. Try running 'configure --enable-tools'."
616 endif
617
618 # Or just the docs
619 docs: doc/doxygen-build.stamp
620
621 install-docs:
622         @if [ -z "$(NO_DOXYGEN)" ]; then \
623           ( cd doc && \
624             echo "Installing documentation in $(DESTDIR)$(docdir)"; \
625             $(INSTALL) -d $(DESTDIR)$(docdir)/html/search; \
626             for f in `find html -type f \! -name "installdox"` ; do \
627               $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f;     \
628             done ) \
629         fi
630
631 doc/doxygen-build.stamp: doc/Doxyfile $(daalainclude_HEADERS)
632         @[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
633
634 if HAVE_DOXYGEN
635
636 # Or everything (by default)
637 all-local: docs
638
639 install-data-local: install-docs
640
641 clean-local:
642         $(RM) -r doc/html
643         $(RM) -r doc/latex
644         $(RM) -r doc/man
645         $(RM) doc/doxygen-build.stamp
646         $(RM) doc/doxygen_sqlite3.db
647
648 uninstall-local:
649         $(RM) -r $(DESTDIR)$(docdir)/html
650
651 endif
652
653 # We check this every time make is run, with configure.ac being touched to
654 # trigger an update of the build system files if update_version changes the
655 # current PACKAGE_VERSION (or if package_version was modified manually by a
656 # user with either AUTO_UPDATE=no or no update_version script present - the
657 # latter being the normal case for tarball releases).
658 #
659 # We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
660 # simply running autoconf will not actually regenerate configure for us when
661 # the content of that file changes (due to autoconf dependency checking not
662 # knowing about that without us creating yet another file for it to include).
663 #
664 # The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
665 # makes that don't support it.  The only loss of functionality is not forcing
666 # an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
667 # unlikely to be a real problem for any real user.
668 $(top_srcdir)/configure.ac: force
669         @case "$(MAKECMDGOALS)" in \
670             dist-hook)                             exit 0       ;; \
671             dist-* | dist | distcheck | distclean) _arg=release ;; \
672         esac; \
673         if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
674             if [ ! -e $(top_srcdir)/package_version ]; then \
675                 echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
676             fi; \
677             . $(top_srcdir)/package_version || exit 1; \
678             [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
679         fi; \
680         touch $@
681
682 force:
683
684 # Create a minimal package_version file when make dist is run.
685 dist-hook:
686         echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
687
688 .PHONY: daala install-daala docs install-docs figures tools