3 # Copyright (C) 2014-2016 Xiph.Org Foundation
5 # This file is part the FLAC project. FLAC is comprised of several
6 # components distributed under different licenses. The codec libraries
7 # are distributed under Xiph.Org's BSD-like license (see the file
8 # COPYING.Xiph in this distribution). All other programs, libraries, and
9 # plugins are distributed under the GPL (see COPYING.GPL). The documentation
10 # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
11 # FLAC distribution contains at the top the terms under which it may be
14 # Since this particular file is relevant to all components of FLAC,
15 # it may be distributed under the Xiph.Org license, which is the least
16 # restrictive of those mentioned above. See the file COPYING.Xiph in this
20 ogg_sha256sum
= e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692
22 flac_version
= $(shell grep ^AC_INIT configure.ac | sed
's/[^ ]* \[//;s/\].*//')
24 win_build
= $(shell pwd
)/win-build
26 win32_name
= i686-w64-mingw32
27 win64_name
= x86_64-w64-mingw32
29 win32_target
= --host
=$(win32_name
) --target
=$(win32_name
)
30 win64_target
= --host
=$(win64_name
) --target
=$(win64_name
)
32 flac-
$(flac_version
)-win.zip
: flac-
$(flac_version
)-win
//AUTHORS
33 zip
-r
$@ flac-
$(flac_version
)-win
34 rm -rf flac-
$(flac_version
)-win
38 flac-
$(flac_version
)-win
//AUTHORS
: win-build
/.stamp-flac-win32-install win-build
/.stamp-flac-win64-install
39 mkdir
-p flac-
$(flac_version
)-win
/win32 flac-
$(flac_version
)-win
/win64
40 cp
$(win_build
)/flac32
/bin
/flac.exe flac-
$(flac_version
)-win
/win32
/
41 cp
$(win_build
)/flac32
/bin
/metaflac.exe flac-
$(flac_version
)-win
/win32
/
42 $(win32_name
)-strip flac-
$(flac_version
)-win
/win32
/*.exe
43 cp
$(win_build
)/flac64
/bin
/flac.exe flac-
$(flac_version
)-win
/win64
/
44 cp
$(win_build
)/flac64
/bin
/metaflac.exe flac-
$(flac_version
)-win
/win64
/
45 $(win64_name
)-strip flac-
$(flac_version
)-win
/win64
/*.exe
46 cp
-r doc
/html flac-
$(flac_version
)-win
/
47 rm -rf flac-
$(flac_version
)-win
/html
/api
48 find flac-
$(flac_version
)-win
/ -name Makefile\
* -exec
rm -f
{} \
;
49 cp AUTHORS COPYING.
* README flac-
$(flac_version
)-win
/
52 #-------------------------------------------------------------------------------
53 # Build and install 32 and 64 bit versions of a statically linked flac and
54 # metaflac executable.
56 win-build
/.stamp-flac-win64-install
: win-build
/.stamp-flac-win64-config
57 make
clean all install
60 win-build
/.stamp-flac-win64-config
: win-build
/.stamp-flac-prepare configure
61 mkdir
-p
$(win_build
)/ogg64
62 .
/configure
--disable-shared
$(win64_target
) --with-ogg
=$(win_build
)/ogg64
--prefix=$(win_build
)/flac64
65 win-build
/.stamp-flac-win32-install
: win-build
/.stamp-flac-win32-config
66 make
clean all install
69 win-build
/.stamp-flac-win32-config
: win-build
/.stamp-flac-prepare configure
70 mkdir
-p
$(win_build
)/ogg32
71 .
/configure
--disable-shared
$(win32_target
) --with-ogg
=$(win_build
)/ogg32
--prefix=$(win_build
)/flac32
74 win-build
/.stamp-flac-prepare
: win-build
/.stamp-win32-install win-build
/.stamp-win64-install
77 #-------------------------------------------------------------------------------
78 # Build libogg for win32 and win64.
80 win-build
/.stamp-win64-install
: win-build
/.stamp-win64-configure
81 (cd win-build
/libogg-
$(ogg_version
) && make
clean all check install)
84 win-build
/.stamp-win64-configure
: win-build
/.stamp-source
85 mkdir
-p
$(win_build
)/win64
86 (cd win-build
/libogg-
$(ogg_version
) && .
/configure
--prefix=$(win_build
)/ogg64
$(win32_target
) --disable-shared
)
89 win-build
/.stamp-win32-install
: win-build
/.stamp-win32-configure
90 (cd win-build
/libogg-
$(ogg_version
) && make
clean all check install)
93 win-build
/.stamp-win32-configure
: win-build
/.stamp-source
94 mkdir
-p
$(win_build
)/win32
95 (cd win-build
/libogg-
$(ogg_version
) && .
/configure
--prefix=$(win_build
)/ogg32
$(win32_target
) --disable-shared
)
98 win-build
/.stamp-source
: win-build
/.stamp-sha256sum-checked
99 (cd win-build
&& tar xf libogg-
$(ogg_version
).
tar.gz
)
102 #-------------------------------------------------------------------------------
103 # Retrieve and check libogg tarball.
105 win-build
/.stamp-sha256sum-checked
: win-build
/libogg-
$(ogg_version
).
tar.gz
106 @if
test $$(sha256sum
$+ | sed
's/ .*//') != $(ogg_sha256sum
) ; then exit
1 ; fi
107 @echo
"sha256 sum : ok"
110 win-build
/libogg-
$(ogg_version
).
tar.gz
:
112 wget http
://downloads.xiph.org
/releases
/ogg
/$$(basename $@
) -O
$@
114 #-------------------------------------------------------------------------------
117 configure
: configure.ac autogen.sh
121 rm -rf
$(win_build
) flac-
$(flac_version
)-win