File: Makefile

package info (click to toggle)
acmetool 0.2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 792 kB
  • sloc: sh: 349; makefile: 105
file content (36 lines) | stat: -rw-r--r-- 1,000 bytes parent folder | download | duplicates (3)
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
ifneq ($(NIX_PATH),)
  # NixOS
  DOCBOOK_XSL := $(shell echo "$(buildInputs)" | tr ' ' '\n' | grep docbook)/xml/xsl/docbook
else
  # Alpine
  DOCBOOK_XSL := $(shell echo /usr/share/xml/docbook/xsl-stylesheets-*)
endif

all: out/index.xhtml out/img out/style.css

clean:
	rm -rf tmp out

deploy:
	rsync -rltv --perms=D755,F644 out/ drone@rem.devever.net::doc/acmetool/

out/img: img
	rsync -a "$<"/ "$@"/

out/style.css: style.css out/index.xhtml
	cat out/docbook.css style.css > "$@"

out/index.xhtml: out/index.docbook tmp/acmetool.8.docbook include-man.xsl to-xhtml.xsl
	rm -f docbook-xsl
	ln -s "$(DOCBOOK_XSL)" docbook-xsl
	xsltproc \
	  --stringparam html.stylesheet style.css \
	  --nonet --output "$@" \
	  to-xhtml.xsl "$<"

out/index.docbook: tmp/index.docbook tmp/acmetool.8.docbook include-man.xsl to-xhtml.xsl
	xsltproc --xinclude --xincludestyle --nonet --output "$@" include-man.xsl "$<"

tmp/%.docbook: %.adoc
	mkdir -p tmp
	asciidoctor -r asciidoctor-diagram -b docbook5 -o "$@" "$<"