123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- # Makefile for Qi.
- #
- # Copyright (c) 2015-2019 Matias Fonzo, <selk@dragora.org>.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- project = qi
- version = 1.3
- ## DO NOT MAKE CHANGES HERE.
- #
- # Use config.mak to override any of the following variables:
- prefix = /usr/local
- exec_prefix = $(prefix)
- bindir = $(exec_prefix)/bin
- sbindir = $(exec_prefix)/sbin
- libexecdir = $(exec_prefix)/libexec
- sysconfdir = $(prefix)/etc
- localstatedir = $(prefix)/var
- datarootdir = $(prefix)/share
- infodir = $(datarootdir)/info
- mandir = $(datarootdir)/man
- docdir = $(datarootdir)/doc
- packagedir = /usr/local/pkgs
- targetdir = /usr/local
- ##
- DISTNAME = ${project}-${version}
- MAKEINFO = makeinfo
- INSTALL = install
- INSTALL_PROGRAM = ${INSTALL} -p -m 755
- INSTALL_DATA = ${INSTALL} -p -m 644
- INSTALL_DIR = mkdir -p -m 755
- HELP2MAN_OPTS = --version-option=-V
- .PHONY: all \
- doc info man html \
- dist distclean clean \
- install install-info \
- uninstall uninstall-info
- -include config.mak
- all : $(project) $(project)rc
- $(project) : src/$(project)
- src/$(project) : src/$(project).in
- @echo "Making tool: src/$(project) ..."
- @sed -e "s|@VERSION@|$(version)|g" \
- -e "s|@PREFIX@|$(prefix)|g" \
- -e "s|@BINDIR@|$(bindir)|g" \
- -e "s|@SBINDIR@|$(sbindir)|g" \
- -e "s|@LIBEXECDIR@|$(libexecdir)|g" \
- -e "s|@SYSCONFDIR@|$(sysconfdir)|g" \
- -e "s|@LOCALSTATEDIR@|$(localstatedir)|g" \
- -e "s|@INFODIR@|$(infodir)|g" \
- -e "s|@MANDIR@|$(mandir)|g" \
- -e "s|@DOCDIR@|$(docdir)|g" \
- -e "s|@PACKAGEDIR@|$(packagedir)|g" \
- -e "s|@TARGETDIR@|$(targetdir)|g" \
- $< > $@ && \
- chmod 755 $@
- $(project)rc : etc/$(project)rc
- etc/$(project)rc : etc/$(project)rc.in
- @echo "Making config: etc/$(project)rc ..."
- @sed -e "s|@PREFIX@|$(prefix)|g" \
- -e "s|@BINDIR@|$(bindir)|g" \
- -e "s|@SBINDIR@|$(sbindir)|g" \
- -e "s|@LIBEXECDIR@|$(libexecdir)|g" \
- -e "s|@SYSCONFDIR@|$(sysconfdir)|g" \
- -e "s|@LOCALSTATEDIR@|$(localstatedir)|g" \
- -e "s|@INFODIR@|$(infodir)|g" \
- -e "s|@MANDIR@|$(mandir)|g" \
- -e "s|@DOCDIR@|$(docdir)|g" \
- -e "s|@PACKAGEDIR@|$(packagedir)|g" \
- -e "s|@TARGETDIR@|$(targetdir)|g" \
- $< > $@ && \
- chmod 644 $@
- doc : info man html
- info : doc/$(project).info
- doc/$(project).info : doc/$(project).texi
- cd doc && LC_ALL=C $(MAKEINFO) $(project).texi
- man : doc/qi.1
- doc/qi.1 : src/qi
- LC_ALL=C help2man ${HELP2MAN_OPTS} \
- -n 'a simple but well-integrated package manager' \
- -o $@ src/qi
- html : doc/$(project).html
- doc/$(project).html : doc/$(project).texi
- cd doc && LC_ALL=C $(MAKEINFO) --html --no-split \
- $(project).texi
- dist : doc
- ln -sf . $(DISTNAME)
- tarlz --solid -9 -cvf $(DISTNAME).tar.lz \
- $(DISTNAME)/AUTHORS \
- $(DISTNAME)/COPYING \
- $(DISTNAME)/CREDITS \
- $(DISTNAME)/Makefile \
- $(DISTNAME)/NEWS \
- $(DISTNAME)/README \
- $(DISTNAME)/configure \
- $(DISTNAME)/doc/example.order \
- $(DISTNAME)/doc/fdl.txt \
- $(DISTNAME)/doc/qi.1 \
- $(DISTNAME)/doc/$(project).html \
- $(DISTNAME)/doc/$(project).info \
- $(DISTNAME)/doc/$(project).texi \
- $(DISTNAME)/doc/recipe1 \
- $(DISTNAME)/doc/recipe2 \
- $(DISTNAME)/doc/recipe3 \
- $(DISTNAME)/etc/$(project)rc.in \
- $(DISTNAME)/src/qi.in
- rm -f $(DISTNAME)
- sha256sum $(DISTNAME).tar.lz > $(DISTNAME).tar.lz.sha256
- distclean : clean
- -rm -f *.tar *.tar.lz *.tar.lz.*
- clean :
- -rm -f src/$(project) etc/$(project)rc config.mak
- install : all install-info install-man
- @echo "*** Checking required directories ..."
- if [ ! -d "$(DESTDIR)${bindir}" ] ; then \
- $(INSTALL_DIR) "$(DESTDIR)${bindir}" ; \
- fi
- if [ ! -d "$(DESTDIR)${sysconfdir}" ] ; then \
- $(INSTALL_DIR) "$(DESTDIR)${sysconfdir}" ; \
- fi
- @echo "*** Installing on $(DESTDIR)${bindir} ..."
- $(INSTALL_PROGRAM) src/$(project) "$(DESTDIR)${bindir}/$(project)"
- @echo "*** Installing config file on $(DESTDIR)${sysconfdir} ..."
- $(INSTALL_DATA) etc/$(project)rc "$(DESTDIR)${sysconfdir}/$(project)rc"
- @echo "Done."
- install-info :
- @echo "*** Checking required directory ..."
- if [ ! -d "$(DESTDIR)${infodir}" ] ; then \
- $(INSTALL_DIR) "$(DESTDIR)${infodir}" ; \
- fi
- @echo "*** Installing Info document on $(DESTDIR)${infodir} ..."
- $(INSTALL_DATA) doc/$(project).info \
- "$(DESTDIR)${infodir}/$(project).info"
- -install-info --info-dir="$(DESTDIR)${infodir}" \
- "$(DESTDIR)${infodir}/$(project).info"
- install-man :
- if [ ! -d "$(DESTDIR)${mandir}/man1" ] ; then \
- $(INSTALL_DIR) "$(DESTDIR)${mandir}/man1" ; \
- fi
-
- @echo "*** Installing manual pages on $(DESTDIR)${mandir}/man1 ..."
- $(INSTALL_DATA) doc/qi.1 "$(DESTDIR)${mandir}/man1"
- uninstall : uninstall-info uninstall-man
- @echo "*** Uninstalling from $(DESTDIR)${bindir} ..."
- -rm -f "$(DESTDIR)${bindir}/$(project)"
- -rm -f "$(DESTDIR)${sysconfdir}/$(project)rc"
- uninstall-info :
- -install-info \
- --info-dir="$(DESTDIR)${infodir}" \
- --remove "$(DESTDIR)${infodir}/$(project).info"
- -rm -f "$(DESTDIR)${infodir}/$(project).info"
- uninstall-man :
- -rm -f "$(DESTDIR)${mandir}/man1/qi.1"
|