| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# Good info at: info make "Quick Reference" |
| 4 |
# $^ All prerequisites |
| 5 |
# $< First prerequisity |
| 6 |
# $@ Target |
| 7 |
|
| 8 |
# Now we only build HTML |
| 9 |
# Let's just use simple xslt |
| 10 |
# If PDF and epub are needed, we can take script from debian-reference |
| 11 |
|
| 12 |
# version of this Debian package (debian/changelog) |
| 13 |
DEBVERSION ?= $(shell { dpkg-parsechangelog -SVersion || echo "vcs-0.0" ; }) |
| 14 |
# short date of this Debian package (debian/changelog) |
| 15 |
DEBDATE ?= $(shell { date +'%Y-%m-%d' -d"`dpkg-parsechangelog -SDate`" || date +'(No changelog) %Y-%m-%d' ; }) |
| 16 |
|
| 17 |
XSLTPROCH := xsltproc --xinclude $(CURDIR)/style-html.xsl |
| 18 |
XSLTPROCT := xsltproc --xinclude $(CURDIR)/style-txt.xsl |
| 19 |
|
| 20 |
all: debian-java-policy/index.html debian-java-faq/index.html \ |
| 21 |
debian-java-policy.txt debian-java-faq.txt |
| 22 |
|
| 23 |
binary: all |
| 24 |
|
| 25 |
%/index.html: %.xml |
| 26 |
mkdir -p $* |
| 27 |
cp debian-java.css $*/ |
| 28 |
cd $* ; \ |
| 29 |
sed \ |
| 30 |
-e "s/@@@debversion@@@/$(DEBVERSION)/g" \ |
| 31 |
-e "s/@@@debdate@@@/$(DEBDATE)/g" \ |
| 32 |
< $(CURDIR)/$< | \ |
| 33 |
$(XSLTPROCH) - |
| 34 |
|
| 35 |
%.txt: %.xml |
| 36 |
sed \ |
| 37 |
-e "s/@@@debversion@@@/$(DEBVERSION)/g" \ |
| 38 |
-e "s/@@@debdate@@@/$(DEBDATE)/g" \ |
| 39 |
< $< | \ |
| 40 |
$(XSLTPROCT) - | \ |
| 41 |
LC_ALL=en_US.UTF-8 w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html \ |
| 42 |
> $@ |
| 43 |
|
| 44 |
distclean: clean |
| 45 |
|
| 46 |
clean: |
| 47 |
-rm -rf debian-java-policy |
| 48 |
-rm -rf debian-java-faq |
| 49 |
-rm -f debian-java-policy.txt |
| 50 |
-rm -f debian-java-faq.txt |
| 51 |
|