3 # Copyright (c) 2015-2022 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.
20 ## DO NOT MAKE CHANGES HERE.
22 # Use config.mak to override any of the following variables:
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
36 arch
= $(shell uname
-m
)
38 DISTNAME
= ${project}-${version}
42 INSTALL_PROGRAM
= ${INSTALL} -p
-m
755
43 INSTALL_DATA
= ${INSTALL} -p
-m
644
44 INSTALL_DIR
= mkdir
-p
-m
755
45 HELP2MAN_OPTS
= --locale
=C
--version-string
=${version}
49 dist distclean clean \
50 install install-info \
51 uninstall uninstall-info
56 all : $(project
) $(project
)rc
58 $(project
) : src
/$(project
)
60 src
/$(project
) : src
/$(project
).in
62 @echo
"Making src/$(project) ..."
64 sed
-e
"s|@VERSION@|$(version)|g" \
65 -e
"s|@PREFIX@|$(prefix)|g" \
66 -e
"s|@BINDIR@|$(bindir)|g" \
67 -e
"s|@SBINDIR@|$(sbindir)|g" \
68 -e
"s|@LIBEXECDIR@|$(libexecdir)|g" \
69 -e
"s|@SYSCONFDIR@|$(sysconfdir)|g" \
70 -e
"s|@LOCALSTATEDIR@|$(localstatedir)|g" \
71 -e
"s|@INFODIR@|$(infodir)|g" \
72 -e
"s|@MANDIR@|$(mandir)|g" \
73 -e
"s|@DOCDIR@|$(docdir)|g" \
74 -e
"s|@PACKAGEDIR@|$(packagedir)|g" \
75 -e
"s|@TARGETDIR@|$(targetdir)|g" \
76 -e
"s|@ARCH@|$(arch)|g" \
80 $(project
)rc
: etc
/$(project
)rc
82 etc
/$(project
)rc
: etc
/$(project
)rc.in
84 @echo
"Making config: etc/$(project)rc ..."
86 sed
-e
"s|@PREFIX@|$(prefix)|g" \
87 -e
"s|@BINDIR@|$(bindir)|g" \
88 -e
"s|@SBINDIR@|$(sbindir)|g" \
89 -e
"s|@LIBEXECDIR@|$(libexecdir)|g" \
90 -e
"s|@SYSCONFDIR@|$(sysconfdir)|g" \
91 -e
"s|@LOCALSTATEDIR@|$(localstatedir)|g" \
92 -e
"s|@INFODIR@|$(infodir)|g" \
93 -e
"s|@MANDIR@|$(mandir)|g" \
94 -e
"s|@DOCDIR@|$(docdir)|g" \
95 -e
"s|@PACKAGEDIR@|$(packagedir)|g" \
96 -e
"s|@TARGETDIR@|$(targetdir)|g" \
97 -e
"s|@ARCH@|$(arch)|g" \
103 info : doc
/$(project
).
info
105 doc
/$(project
).
info : doc
/$(project
)-header.texi doc
/$(project
)-content.texi
106 cd doc
&& env LANG
=C
$(MAKEINFO
) $(project
)-header.texi
-o
$(project
).
info
108 man
: doc
/$(project
).1
110 doc
/qi
.1 : doc
/$(project
).1.in src
/$(project
).in
111 env LANG
=C help2man
${HELP2MAN_OPTS} \
112 --name
="a simple but well-integrated package manager" \
114 --output
=$@ doc
/$(project
).1.in
115 sed
-e
"s#QI.1.IN#QI#g" -e
"s#qi.1.in#qi#g" -i
$@
117 html
: doc
/$(project
).html
119 doc
/$(project
).html
: doc
/$(project
)-header.texi doc
/$(project
)-content.texi
120 cd doc
&& env LANG
=C
$(MAKEINFO
) --html
--no-split \
121 $(project
)-header.texi
-o
$(project
).html
126 tarlz
--solid
-9 -cvf
$(DISTNAME
).
tar.lz \
127 $(DISTNAME
)/AUTHORS \
128 $(DISTNAME
)/COPYING \
129 $(DISTNAME
)/CREDITS \
130 $(DISTNAME
)/Makefile \
132 $(DISTNAME
)/README.md \
133 $(DISTNAME
)/configure \
134 $(DISTNAME
)/doc
/example.order \
135 $(DISTNAME
)/doc
/fdl.txt \
136 $(DISTNAME
)/doc
/qi
.1 \
137 $(DISTNAME
)/doc
/qi
.1.in \
138 $(DISTNAME
)/doc
/$(project
).html \
139 $(DISTNAME
)/doc
/$(project
).
info \
140 $(DISTNAME
)/doc
/$(project
)-header.texi \
141 $(DISTNAME
)/doc
/$(project
)-content.texi \
142 $(DISTNAME
)/doc
/recipe1 \
143 $(DISTNAME
)/doc
/recipe2 \
144 $(DISTNAME
)/doc
/recipe3 \
145 $(DISTNAME
)/etc
/$(project
)rc.in \
146 $(DISTNAME
)/src
/qi.in
148 sha256sum
$(DISTNAME
).
tar.lz
> $(DISTNAME
).
tar.lz.sha256
151 -rm -f
*.
tar *.
tar.lz
*.
tar.lz.
*
154 -rm -f src
/$(project
) etc
/$(project
)rc config.mak
156 install : all install-info install-man
159 @echo
"* Checking required directories ..."
160 if
[ ! -d
"$(DESTDIR)${bindir}" ] ; then \
161 $(INSTALL_DIR
) "$(DESTDIR)${bindir}" ; \
163 if
[ ! -d
"$(DESTDIR)${sysconfdir}" ] ; then \
164 $(INSTALL_DIR
) "$(DESTDIR)${sysconfdir}" ; \
168 @echo
"* Installing on $(DESTDIR)${bindir} ..."
169 $(INSTALL_PROGRAM
) src
/$(project
) "$(DESTDIR)${bindir}/$(project)"
172 @echo
"* Installing config file on $(DESTDIR)${sysconfdir} ..."
173 $(INSTALL_DATA
) etc
/$(project
)rc
"$(DESTDIR)${sysconfdir}/$(project)rc"
176 @echo
"* Creating package and target directory (if needed) ..."
177 if
[ ! -d
"$(DESTDIR)${packagedir}" ] ; then \
178 $(INSTALL_DIR
) "$(DESTDIR)${packagedir}" ; \
180 if
[ ! -d
"$(DESTDIR)${targetdir}" ] ; then \
181 $(INSTALL_DIR
) "$(DESTDIR)${targetdir}" ; \
189 @echo
"* Installing Info document on $(DESTDIR)${infodir} ..."
190 if
[ ! -d
"$(DESTDIR)${infodir}" ] ; then \
191 $(INSTALL_DIR
) "$(DESTDIR)${infodir}" ; \
194 $(INSTALL_DATA
) doc
/$(project
).
info \
195 "$(DESTDIR)${infodir}/$(project).info"
197 -install-info
--info-dir
="$(DESTDIR)${infodir}" \
198 "$(DESTDIR)${infodir}/$(project).info"
203 @echo
"* Installing manual pages on $(DESTDIR)${mandir}/man1 ..."
204 if
[ ! -d
"$(DESTDIR)${mandir}/man1" ] ; then \
205 $(INSTALL_DIR
) "$(DESTDIR)${mandir}/man1" ; \
208 $(INSTALL_DATA
) doc
/$(project
).1 "$(DESTDIR)${mandir}/man1"
210 uninstall : uninstall-info uninstall-man
213 @echo
"* Uninstalling from $(DESTDIR)${bindir} ..."
214 -rm -f
"$(DESTDIR)${bindir}/$(project)"
216 -rm -f
"$(DESTDIR)${sysconfdir}/$(project)rc"
221 --info-dir
="$(DESTDIR)${infodir}" \
222 --remove
"$(DESTDIR)${infodir}/$(project).info"
224 -rm -f
"$(DESTDIR)${infodir}/$(project).info"
228 -rm -f
"$(DESTDIR)${mandir}/man1/$(project).1"