qi: doc: added 'Order files' section to the manual
[dragora.git] / qi / Makefile
blob4b1b6640f65abfc6eeea0f8a0c62ca77cefea5aa
1 # Makefile for Qi.
3 # Copyright (c) 2015-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 project = qi
18 version = 1.0-rc59
20 ## DO NOT MAKE CHANGES HERE.
22 # Use config.mak to override any of the following variables:
23 prefix = /usr/local
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 sbindir = $(exec_prefix)/sbin
27 libexecdir = $(exec_prefix)/libexec
28 sysconfdir = $(prefix)/etc
29 localstatedir = $(prefix)/var
30 datarootdir = $(prefix)/share
31 infodir = $(datarootdir)/info
32 mandir = $(datarootdir)/man
33 docdir = $(datarootdir)/doc
34 packagedir = /usr/local/pkgs
35 targetdir = /usr/local
37 DISTNAME = ${project}-${version}
39 MAKEINFO = makeinfo
40 INSTALL = install
41 INSTALL_PROGRAM = ${INSTALL} -p -m 755
42 INSTALL_DATA = ${INSTALL} -p -m 644
43 INSTALL_DIR = mkdir -p -m 755
44 HELP2MAN_OPTS = --version-option=-V
46 .PHONY: all \
47 doc info man html \
48 dist distclean clean \
49 install install-info \
50 uninstall uninstall-info
52 -include config.mak
55 all : $(project) $(project)rc
57 $(project) : src/$(project)
59 src/$(project) : src/$(project).in
60 @echo "Making tool: src/$(project) ..."
61 @sed -e "s|@VERSION@|$(version)|g" \
62 -e "s|@PREFIX@|$(prefix)|g" \
63 -e "s|@BINDIR@|$(bindir)|g" \
64 -e "s|@SBINDIR@|$(sbindir)|g" \
65 -e "s|@LIBEXECDIR@|$(libexecdir)|g" \
66 -e "s|@SYSCONFDIR@|$(sysconfdir)|g" \
67 -e "s|@LOCALSTATEDIR@|$(localstatedir)|g" \
68 -e "s|@INFODIR@|$(infodir)|g" \
69 -e "s|@MANDIR@|$(mandir)|g" \
70 -e "s|@DOCDIR@|$(docdir)|g" \
71 -e "s|@PACKAGEDIR@|$(packagedir)|g" \
72 -e "s|@TARGETDIR@|$(targetdir)|g" \
73 $< > $@ && \
74 chmod 755 $@
76 $(project)rc : etc/$(project)rc
78 etc/$(project)rc : etc/$(project)rc.in
79 @echo "Making config: etc/$(project)rc ..."
80 @sed -e "s|@PREFIX@|$(prefix)|g" \
81 -e "s|@BINDIR@|$(bindir)|g" \
82 -e "s|@SBINDIR@|$(sbindir)|g" \
83 -e "s|@LIBEXECDIR@|$(libexecdir)|g" \
84 -e "s|@SYSCONFDIR@|$(sysconfdir)|g" \
85 -e "s|@LOCALSTATEDIR@|$(localstatedir)|g" \
86 -e "s|@INFODIR@|$(infodir)|g" \
87 -e "s|@MANDIR@|$(mandir)|g" \
88 -e "s|@DOCDIR@|$(docdir)|g" \
89 -e "s|@PACKAGEDIR@|$(packagedir)|g" \
90 -e "s|@TARGETDIR@|$(targetdir)|g" \
91 $< > $@ && \
92 chmod 644 $@
94 doc : info man html
96 info : doc/$(project).info
98 doc/$(project).info : doc/$(project).texi
99 cd doc && LC_ALL=C $(MAKEINFO) $(project).texi
101 man : doc/qi.1
103 doc/qi.1 : src/qi
104 LC_ALL=C help2man ${HELP2MAN_OPTS} \
105 -n 'a user-friendly package manager' -o $@ src/qi
107 html : doc/$(project).html
109 doc/$(project).html : doc/$(project).texi
110 cd doc && LC_ALL=C $(MAKEINFO) --html --no-split \
111 $(project).texi
113 dist : doc
114 ln -sf . $(DISTNAME)
115 tarlz --solid -9 -cvf $(DISTNAME).tar.lz \
116 $(DISTNAME)/AUTHORS \
117 $(DISTNAME)/COPYING \
118 $(DISTNAME)/CREDITS \
119 $(DISTNAME)/Makefile \
120 $(DISTNAME)/NEWS \
121 $(DISTNAME)/README \
122 $(DISTNAME)/TODO \
123 $(DISTNAME)/configure \
124 $(DISTNAME)/doc/recipe \
125 $(DISTNAME)/doc/document*.css \
126 $(DISTNAME)/doc/example.order \
127 $(DISTNAME)/doc/fdl.texi \
128 $(DISTNAME)/doc/qi.1 \
129 $(DISTNAME)/doc/$(project).html \
130 $(DISTNAME)/doc/$(project).info \
131 $(DISTNAME)/doc/$(project).texi \
132 $(DISTNAME)/etc/$(project)rc.in \
133 $(DISTNAME)/src/qi.in
134 rm -f $(DISTNAME)
135 sha256sum $(DISTNAME).tar.lz > $(DISTNAME).tar.lz.sha256
137 distclean : clean
138 -rm -f *.tar *.tar.lz *.tar.lz.*
140 clean :
141 -rm -f src/$(project) etc/$(project)rc config.mak
143 install : all install-info install-man
145 @echo "*** Checking required directories ..."
147 if [ ! -d "$(DESTDIR)${bindir}" ] ; then \
148 $(INSTALL_DIR) "$(DESTDIR)${bindir}" ; \
150 if [ ! -d "$(DESTDIR)${sysconfdir}" ] ; then \
151 $(INSTALL_DIR) "$(DESTDIR)${sysconfdir}" ; \
154 @echo "*** Installing on $(DESTDIR)${bindir} ..."
156 $(INSTALL_PROGRAM) src/$(project) "$(DESTDIR)${bindir}/$(project)"
158 @echo "*** Installing config file on $(DESTDIR)${sysconfdir} ..."
159 $(INSTALL_DATA) etc/$(project)rc "$(DESTDIR)${sysconfdir}/$(project)rc"
161 @echo "Done."
163 install-info :
165 @echo "*** Checking required directory ..."
167 if [ ! -d "$(DESTDIR)${infodir}" ] ; then \
168 $(INSTALL_DIR) "$(DESTDIR)${infodir}" ; \
171 @echo "*** Installing Info document on $(DESTDIR)${infodir} ..."
173 $(INSTALL_DATA) doc/$(project).info \
174 "$(DESTDIR)${infodir}/$(project).info"
176 -install-info --info-dir="$(DESTDIR)${infodir}" \
177 "$(DESTDIR)${infodir}/$(project).info"
179 install-man :
181 if [ ! -d "$(DESTDIR)${mandir}/man1" ] ; then \
182 $(INSTALL_DIR) "$(DESTDIR)${mandir}/man1" ; \
185 @echo "*** Installing manual pages on $(DESTDIR)${mandir}/man1 ..."
187 $(INSTALL_DATA) doc/qi.1 "$(DESTDIR)${mandir}/man1"
189 uninstall : uninstall-info uninstall-man
191 @echo "*** Uninstalling from $(DESTDIR)${bindir} ..."
193 -rm -f "$(DESTDIR)${bindir}/$(project)"
195 -rm -f "$(DESTDIR)${sysconfdir}/$(project)rc"
197 uninstall-info :
199 -install-info \
200 --info-dir="$(DESTDIR)${infodir}" \
201 --remove "$(DESTDIR)${infodir}/$(project).info"
203 -rm -f "$(DESTDIR)${infodir}/$(project).info"
205 uninstall-man :
207 -rm -f "$(DESTDIR)${mandir}/man1/qi.1"