1#  FLAC - Free Lossless Audio Codec
2#  Copyright (C) 2001,2002,2003,2004,2005,2006,2007  Josh Coalson
3#
4#  This file is part the FLAC project.  FLAC is comprised of several
5#  components distributed under difference licenses.  The codec libraries
6#  are distributed under Xiph.Org's BSD-like license (see the file
7#  COPYING.Xiph in this distribution).  All other programs, libraries, and
8#  plugins are distributed under the GPL (see COPYING.GPL).  The documentation
9#  is distributed under the Gnu FDL (see COPYING.FDL).  Each file in the
10#  FLAC distribution contains at the top the terms under which it may be
11#  distributed.
12#
13#  Since this particular file is relevant to all components of FLAC,
14#  it may be distributed under the Xiph.Org license, which is the least
15#  restrictive of those mentioned above.  See the file COPYING.Xiph in this
16#  distribution.
17
18#
19# GNU Makefile
20#
21# Useful targets
22#
23# all     : build all libraries and programs in the default configuration (currently 'release')
24# debug   : build all libraries and programs in debug mode
25# valgrind: build all libraries and programs in debug mode, dynamically linked and ready for valgrind
26# release : build all libraries and programs in release mode
27# test    : run the unit and stream tests
28# clean   : remove all non-distro files
29#
30
31topdir = .
32
33.PHONY: all doc src examples libFLAC libFLAC++ share plugin_common plugin_xmms flac metaflac test_grabbag test_libFLAC test_libFLAC++ test_seeking test_streams
34all: doc src examples
35
36DEFAULT_CONFIG = release
37
38CONFIG = $(DEFAULT_CONFIG)
39
40debug   : CONFIG = debug
41valgrind: CONFIG = valgrind
42release : CONFIG = release
43
44debug   : all
45valgrind: all
46release : all
47
48doc:
49	(cd $@ && $(MAKE) -f Makefile.lite)
50
51src:
52	(cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
53
54examples: src
55	(cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
56
57libFLAC:
58	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
59
60libFLAC++: libFLAC
61	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
62
63share: libFLAC
64	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
65
66flac: libFLAC share
67	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
68
69metaflac: libFLAC share
70	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
71
72plugin_common: libFLAC
73	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
74
75plugin_xmms: libFLAC plugin_common
76	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
77
78test_seeking: libFLAC
79	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
80
81test_streams: libFLAC
82	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
83
84test_grabbag: share
85	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
86
87test_libFLAC: libFLAC
88	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
89
90test_libFLAC++: libFLAC libFLAC++
91	(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
92
93test: debug
94	(cd test && $(MAKE) -f Makefile.lite debug)
95
96testv: valgrind
97	(cd test && $(MAKE) -f Makefile.lite valgrind)
98
99testr: release
100	(cd test && $(MAKE) -f Makefile.lite release)
101
102clean:
103	-(cd doc && $(MAKE) -f Makefile.lite clean)
104	-(cd src && $(MAKE) -f Makefile.lite clean)
105	-(cd examples && $(MAKE) -f Makefile.lite clean)
106	-(cd test && $(MAKE) -f Makefile.lite clean)
107