forked from savonet/liquidsoap-full
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
112 lines (97 loc) · 4.14 KB
/
Makefile
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
PRJ:=$(shell (cat PACKAGES 2>/dev/null || echo "") | grep -v '^\#')
PRJ:=$(shell for p in $(PRJ) ; do ls -d $$p* | head -1 ; done)
LIQ:=$(shell ls -d liquidsoap* | head -1)
LIQDIR:=$(shell ls -d liquidsoap* | head -1)
SED:=$(shell which gsed || which sed)
default: all
all:
for i in $(PRJ); do $(MAKE) -C $$i || exit 1; done
clean:
for i in $(PRJ); do $(MAKE) -C $$i $@; done
doc:
$(MAKE) -C $(LIQ) doc
install:
$(MAKE) -C $(LIQ) install
# Display current version numbers of all components
versions:
@for i in ocaml-* liquidsoap ; do \
if [ -f $$i/configure.ac ] ; then \
v=`grep AC_INIT $$i/configure.ac | $(SED) -e 's/AC_INIT([^,]\+,\s*\[\?\([0-9.a-z-]\+\).*/\1/'` ; \
echo $$i-$$v ; \
fi ; \
done
PKGS:=$(shell grep '^\#\?\s*ocaml-[a-z0-9]\+$$' PACKAGES.default | $(SED) -e 's/\#//')
VERSION:=`grep AC_INIT liquidsoap/configure.ac | $(SED) -e 's/AC_INIT([^,]\+,\s*\[\?\([0-9.a-z-]\+\).*/\1/'`
FULL:=liquidsoap-$(VERSION)-full
# $i = package name
# $v = version
# wget $(HTTP)/$$i/$$v/$$i-$$v.tar.gz
HTTP=http://downloads.sourceforge.net/project/savonet
download_latest:
mkdir -p latest
@cd latest ; \
for i in $(PKGS) ; do \
v=`grep AC_INIT ../$$i/configure.ac | $(SED) -e 's/AC_INIT([^,]\+,\s*\[\?\([0-9.a-z-]\+\).*/\1/'` ; \
if test ! -s $$i-$$v.tar.gz; then \
echo wget $(HTTP)/$$i/$$v/$$i-$$v.tar.gz/download -O $$i-$$v.tar.gz --tries=2; \
wget $(HTTP)/$$i/$$v/$$i-$$v.tar.gz -O $$i-$$v.tar.gz --tries=2 || rm -f $$i-$$v.tar.gz; \
fi \
done
full: bootstrap makefiles
@rm -rf $(FULL) ; mkdir $(FULL)
@cp bootstrap configure Makefile PACKAGES.default PACKAGES.minimal \
README LICENSE INSTALL $(FULL)
@echo Did you run \"make download_latest\" to get official tarballs?
@for i in $(PKGS) ; do \
v=`grep AC_INIT $$i/configure.ac | $(SED) -e 's/AC_INIT([^,]\+,\s*\[\?\([0-9.a-z-]\+\).*/\1/'` ; \
if [ -f latest/$$i-$$v.tar.gz ] ; then \
cp latest/$$i-$$v.tar.gz $(FULL) ; else \
echo " *** Latest tarball not found for $$i-$$v: building it..." ; \
make -C $$i dist > /dev/null ; \
if [ -f $$i-$$v.tar.gz ] ; then \
mv $$i-$$v.tar.gz $(FULL) ; else \
mv $$i/$$i-$$v.tar.gz $(FULL) ; \
fi ; \
fi ; \
done
@if [ -f latest/liquidsoap-$(VERSION).tar.bz2 ] ; then \
cp latest/liquidsoap-$(VERSION).tar.bz2 $(FULL) ; else \
echo " *** Latest tarball not found for liquidsoap-$(VERSION): building..." ; \
make -C liquidsoap tarball > /dev/null && \
mv liquidsoap/liquidsoap-$(VERSION).tar.bz2 $(FULL) ; \
fi
@cd $(FULL) ; for a in *tar.gz ; do tar zxf $$a && rm $$a ; done ; \
tar jxf liquidsoap*tar.bz2 && rm liquidsoap*tar.bz2
@tar cjf $(FULL).tar.bz2 $(FULL)
@echo Full release ready in subdirectory $(FULL)
check-init:
@if [ ! -e $(LIQDIR)/configure.ac ] ; then \
echo "Liquidsoap directory seems empty. I assume that submodules were not downloaded. Hold on, I'm doing it for you!"; \
$(MAKE) init; \
fi
# The bootstrap target creates/updates */configure as needed
# It is more efficient than ./bootstrap, avoiding to regenerate
# everything when only one configure.ac was changed. However,
# it also bootstraps libraries which are commented out in PACKAGES.
# We use PKGDIRS and LIQDIRS which have -$(version) prefixes,
# so that the target will work in -full archives.
.PHONY: bootstrap check-init
PKGDIRS:=$(shell for p in $(PKGS) ; do ls -d $$p* | head -1 ; done)
bootstrap: check-init $(PKGDIRS:=/configure) $(LIQDIR)/configure
%/configure: %/configure.ac
@echo "*** bootstrapping `dirname $@`"
@cd `dirname $@` ; ./bootstrap
# Generate each PKG/Makefile by running configure script
# This may fail for some packages because specific configure options are
# needed, in which case they should simply be ran manually
makefiles: $(PKGDIRS:=/Makefile) $(LIQDIR)/Makefile.defs
%/Makefile:
@echo "*** configuring `dirname $@`"
@cd `dirname $@` ; ./configure --with-ogg-dir=../ocaml-ogg/src --with-ladspa-dir=../ocaml-ladspa/src > /dev/null || \
echo "Skipping failed configure..."
liquidsoap/Makefile.defs: liquidsoap/configure
@echo "*** configuring `dirname $@`"
@cd `dirname $@` ; `cat configure-with-options` > /dev/null || \
echo "Skipping failed configure..."
.PHONY: install
-include Makefile.git