[93fbe8]: Makefile Maximize Restore History

Download this file

Makefile    96 lines (84 with data), 3.6 kB

 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
PRJ:=$(shell cat PACKAGES | grep -v '^\#')
PRJ:=$(shell for p in $(PRJ) ; do ls -d $$p* | head -1 ; done)
LIQ:=$(shell ls -d liquidsoap* | head -1)
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-z]\+$$' 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/'` ; \
echo wget $(HTTP)/$$i/$$v/$$i-$$v.tar.gz/download ; \
wget $(HTTP)/$$i/$$v/$$i-$$v.tar.gz ; \
done
# Exceptions for updated libs which are not yet released
rm latest/ocaml-speex-0.1.2.tar.gz
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
@echo Full release ready in subdirectory $(FULL)
# 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
PKGDIRS:=$(shell for p in $(PKGS) ; do ls -d $$p* | head -1 ; done)
LIQDIR:=$(shell ls -d liquidsoap* | head -1)
bootstrap: $(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
%/Makefile:
@echo "*** configuring `dirname $@`"
@cd `dirname $@` ; ./configure > /dev/null || \
echo "Skipping failed configure..."