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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
.PHONY: doc upload all-subdirs
SUBDIRS = content liqi
DISTFILES = liquidsoap.1 Makefile protocols_to_liqi.pl reference_to_liqi.pl no-ref.txt \
template.html snippet.html
DISTDIRS = orig
PERL_DOM = $(shell perl -MXML::DOM -e1 > /dev/null 2>&1 && echo yes)
CONTENT=$(wildcard content/*.txt)
PRE_HTML=$(shell echo $(CONTENT:.txt=.html) | sed -e 's/content\//html\//g') \
html/reference.html html/settings.html html/protocols.html
HTML=html/scripts/index.html
TEX=$(shell echo $(CONTENT:.txt=.tex) | sed -e 's/content\//tex\//g')
PDF=$(TEX:.tex=.pdf)
LIQI = cd html && ../liqi/liqi \
--template ../template.html --snippet-template ../snippet.html \
--subst rel:
LIQI_DEPS = liqi/liqi template.html snippet.html
# PDF is not ready for end-users yet.
doc: html
html: $(HTML)
pdf: liqref.pdf
liqref.pdf: tex/liqref.tex $(TEX)
@echo Compiling liqref.pdf...
@cd tex; pdflatex -interaction nonstopmode liqref.tex
html/scripts/index.html: html/scripts/index.txt $(LIQI_DEPS)
@echo Generating $(@)...
@#Has to be called from html to put scripts in the right place
$(LIQI) --subst rel:../ -i ../$(<) -o ../$(@)
# I have to tell make that index.txt will be there
# once the HTML have been generated.
# Also ensures that the index is built last even with a concurrent make run.
html/scripts/index.txt: $(PRE_HTML)
html/%.html: content/%.txt $(LIQI_DEPS)
@echo Converting $(<) to $(@)...
@test -d html || (mkdir -p html/scripts ; cp -RfL orig/* html)
@#Has to be called from html to put scripts in the right place
@$(LIQI) -i ../$(<) -o ../$(@)
tex/%.tex: content/%.txt liqi/liqi
@echo Converting $(<) to $(@)...
@test -d tex || mkdir tex
@./liqi/liqi --latex -i $(<) -o $(@)
tex/%.pdf: tex/%.tex
@echo Converting $(<) to $(@)...
@cd tex; pdflatex ../$(<)
liqi/liqi: all-subdirs
@# If I don't put anything here, make tries to build liqi/liqi
@# from liqi/liqi.o by using gcc
../src/liquidsoap:
@echo "Liquidsoap does not seem to be built. You have to build it before."
@echo "Go to the toplevel and type 'make'"
exit 1
content/reference.txt: reference_to_liqi.pl ../src/liquidsoap ../scripts/utils.liq
ifeq ($(PERL_DOM),yes)
CAML_LD_LIBRARY_PATH=../src:../src/plugins ../src/liquidsoap --dynamic-plugins-dir ../src/plugins \
--no-pervasives ../scripts/pervasives.liq --list-plugins-xml | \
./reference_to_liqi.pl > $(@)
else
@echo "-> You don't seem to have perl XML::DOM module installed."
@echo "-> Language reference cannot be generated."
@cp no-ref.txt content/reference.txt
endif
content/protocols.txt: protocols_to_liqi.pl ../src/liquidsoap ../scripts/utils.liq
ifeq ($(PERL_DOM),yes)
CAML_LD_LIBRARY_PATH=../src:../src/plugins ../src/liquidsoap --dynamic-plugins-dir ../src/plugins \
--no-pervasives ../scripts/pervasives.liq --list-plugins-xml | \
./protocols_to_liqi.pl > $(@)
else
@echo "-> You don't seem to have perl XML::DOM module installed."
@echo "-> protocols reference cannot be generated."
@cp no-protocols.txt content/protocols.txt
endif
content/settings.txt: ../src/liquidsoap
CAML_LD_LIBRARY_PATH=../src:../src/plugins ../src/liquidsoap --no-pervasives ../scripts/pervasives.liq \
--dynamic-plugins-dir ../src/plugins --conf-descr-liqi > $(@)
VERSION="`../src/liquidsoap --version | head -n 1`"
test: html
@echo "Testing code snippets with \033[1m$(VERSION)\033[0m"
@echo ""
@find html/scripts | grep '\.liq' | sort \
| ./scripts/test_snippets "`pwd`/../src/liquidsoap -p"
@echo ""
@echo "Testing shell scripts.."
@echo "Please remember that it does not test liq syntax used inline.."
@echo ""
@find html/scripts | grep '\.sh' | sort | ./scripts/test_snippets "sh -n"
@echo ""
@echo "Testing perl scripts.."
@echo ""
@find html/scripts | grep '\.pl' | sort | ./scripts/test_snippets "perl -c"
spell-check: $(CONTENT:.txt=.txt.spell)
content/%.txt.spell: content/%.txt
-aspell -d en_US-w_accents -c $(<)
touch $(@)
doc-install:
$(INSTALL) -d $(datadir)/doc/$(DISTDIR)/html
if [ -f html/index.html ] ; then \
cp -RfL html/* $(datadir)/doc/$(DISTDIR)/html ; \
fi
$(INSTALL) -d $(mandir)/man1
$(INSTALL_DATA) liquidsoap.1 $(mandir)/man1
clean-local:
rm -rf html $(TEX) content/reference.txt content/protocols.txt content/settings.txt content/*.txt.spell
RCP=rsync -rLtCP --include="*.exe" --exclude="*.swp" --exclude="*.svn" \
--delete --stats
RHOST=shell.sf.net:/home/groups/s/sa/savonet/htdocs/new/liq-svn
upload: update
cd html ; $(RCP) . $(RHOST)
ssh $(USER)@shell.sf.net "chgrp -R savonet \
/home/groups/s/sa/savonet/htdocs \
> /dev/null 2>&1"
ssh $(USER)@shell.sf.net "find /home/groups/s/sa/savonet/htdocs \
-type d -exec chmod 2775 '{}' ';' \
> /dev/null 2>&1"
ssh $(USER)@shell.sf.net "find /home/groups/s/sa/savonet/htdocs \
-type f -exec chmod 664 '{}' ';' \
> /dev/null 2>&1"
top_srcdir=..
include $(top_srcdir)/Makefile.rules
|