Commit 59f27880 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Add build-manpages and install-manpages targets.

parent 2acc2769
...@@ -14,3 +14,6 @@ gcov/ ...@@ -14,3 +14,6 @@ gcov/
*.swp *.swp
version.h version.h
doc/ doc/
...@@ -23,7 +23,7 @@ endif ...@@ -23,7 +23,7 @@ endif
OBJECTS = $(patsubst %.c, %.o, $(SOURCE)) OBJECTS = $(patsubst %.c, %.o, $(SOURCE))
DOBJECTS = $(patsubst %.c,, $(SOURCE)) DOBJECTS = $(patsubst %.c,, $(SOURCE))
all: options ${PROJECT} po all: options ${PROJECT} po build-manpages
options: options:
@echo ${PROJECT} build options: @echo ${PROJECT} build options:
...@@ -58,7 +58,7 @@ ${PROJECT}: ${OBJECTS} ...@@ -58,7 +58,7 @@ ${PROJECT}: ${OBJECTS}
clean: clean:
$(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \ $(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc version.h \ ${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc version.h \
*gcda *gcno $(PROJECT).info gcov *gcda *gcno $(PROJECT).info gcov *.tmp ${PROJECT}.1 ${PROJECT}rc.5
$(QUIET)make -C tests clean $(QUIET)make -C tests clean
$(QUIET)make -C po clean $(QUIET)make -C po clean
...@@ -117,6 +117,26 @@ po: ...@@ -117,6 +117,26 @@ po:
update-po: update-po:
$(QUIET)${MAKE} -C po update-po $(QUIET)${MAKE} -C po update-po
ifneq "$(wildcard ${RSTTOMAN})" ""
%.1 %.5:
$(QUIET)sed "s/VERSION/${VERSION}/g" < $@.rst > $@.tmp
$(QUIET)${RSTTOMAN} $@.tmp > $@
$(QUIET)rm $@.tmp
${PROJECT}.1: ${PROJECT}.1.rst
${PROJECT}rc.5: ${PROJECT}rc.5.rst
build-manpages: ${PROJECT}.1 ${PROJECT}rc.5
install-manpages: build-manpages
$(ECHO) installing manual pages
$(QUIET)install -m 644 ${PROJECT}.1 ${DESTDIR}${MANPREFIX}/man1
$(QUIET)install -m 644 ${PROJECT}rc.5 ${DESTDIR}${MANPREFIX}/man5
build-manpages install-manpages:
install-headers: ${PROJECT}.pc install-headers: ${PROJECT}.pc
$(ECHO) installing header files $(ECHO) installing header files
...@@ -125,22 +145,10 @@ install-headers: ${PROJECT}.pc ...@@ -125,22 +145,10 @@ install-headers: ${PROJECT}.pc
$(QUIET)mkdir -p ${DESTDIR}${LIBDIR}/pkgconfig $(QUIET)mkdir -p ${DESTDIR}${LIBDIR}/pkgconfig
$(QUIET)install -m 644 ${PROJECT}.pc ${DESTDIR}${LIBDIR}/pkgconfig $(QUIET)install -m 644 ${PROJECT}.pc ${DESTDIR}${LIBDIR}/pkgconfig
install: all install-headers po install: all install-headers install-manpages
$(ECHO) installing executable file $(ECHO) installing executable file
$(QUIET)mkdir -p ${DESTDIR}${PREFIX}/bin $(QUIET)mkdir -p ${DESTDIR}${PREFIX}/bin
$(QUIET)install -m 755 ${PROJECT} ${DESTDIR}${PREFIX}/bin $(QUIET)install -m 755 ${PROJECT} ${DESTDIR}${PREFIX}/bin
ifneq "$(wildcard ${RSTTOMAN})" ""
$(ECHO) installing manual pages
$(QUIET)sed "s/VERSION/${VERSION}/g" < ${PROJECT}.1.rst > ${PROJECT}-v.1.rst
$(QUIET)rm ${PROJECT}-v.1.rst
$(QUIET)sed "s/VERSION/${VERSION}/g" < ${PROJECT}rc.5.rst > ${PROJECT}rc-v.5.rst
$(QUIET)rm ${PROJECT}rc-v.5.rst
$(QUIET)chmod 644 ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1
$(QUIET)chmod 644 ${DESTDIR}${MANPREFIX}/man5/${PROJECT}rc.5
$(ECHO) installing desktop file $(ECHO) installing desktop file
$(QUIET)install -m 644 ${PROJECT}.desktop ${DESTDIR}${DESKTOPPREFIX} $(QUIET)install -m 644 ${PROJECT}.desktop ${DESTDIR}${DESKTOPPREFIX}
...@@ -165,4 +173,4 @@ uninstall: ...@@ -165,4 +173,4 @@ uninstall:
-include $(wildcard .depend/*.dep) -include $(wildcard .depend/*.dep)
.PHONY: all options clean doc debug valgrind gdb dist doc install uninstall test \ .PHONY: all options clean doc debug valgrind gdb dist doc install uninstall test \
po install-headers uninstall-headers update-po po install-headers uninstall-headers update-po install-manpages build-manpages
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment