summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile134
1 files changed, 102 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index a409c36..1e7e4e5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,63 +1,133 @@
include config.mk
-default:
+all: build-src build-man build-applications
+
+build-src:
@${MAKE} -C src
+build-man:
+ @${MAKE} -C man
+
+build-applications:
+ @${MAKE} -C share/applications
+
+test: all
+ @if ! uname -m | grep -q -e arm -e mips; then \
+ PACKAGE=${PACKAGE} prove test/feh.t test/mandoc.t; \
+ else \
+ PACKAGE=${PACKAGE} prove test/feh.t test/mandoc.t || cat test/imlib2-bug-notice; \
+ fi
+
+test-x11: all
+ test/run-interactive
+ prove test/feh-bg-i.t
+
install: install-man install-doc install-bin install-font install-img
+install: install-icon install-examples install-applications
-install-man:
+install-man: man/feh.1
@echo installing manuals to ${man_dir}
@mkdir -p ${man_dir}/man1
- @cp man/feh.1 man/feh-cam.1 ${man_dir}/man1
- @chmod 644 $(man_dir)/man1/feh.1 $(man_dir)/man1/feh-cam.1
- @ln -fs feh-cam.1 $(man_dir)/man1/gen-cam-menu.1
+ @cp man/feh.1 ${man_dir}/man1
+ @chmod 644 ${man_dir}/man1/feh.1
-install-doc:
+install-doc: AUTHORS ChangeLog README.md TODO
@echo installing docs to ${doc_dir}
- @mkdir -p ${doc_dir}/feh
- @cp AUTHORS ChangeLog README TODO ${doc_dir}/feh
- @chmod 644 ${doc_dir}/feh/AUTHORS ${doc_dir}/feh/ChangeLog \
- ${doc_dir}/feh/README ${doc_dir}/feh/TODO
+ @mkdir -p ${doc_dir}
+ @cp AUTHORS ChangeLog README.md TODO ${doc_dir}
+ @chmod 644 ${doc_dir}/AUTHORS ${doc_dir}/ChangeLog ${doc_dir}/README.md \
+ ${doc_dir}/TODO
-install-bin:
+install-bin: src/feh
@echo installing executables to ${bin_dir}
@mkdir -p ${bin_dir}
- @cp src/feh cam/feh-cam cam/gen-cam-menu ${bin_dir}
- @chmod 755 ${bin_dir}/feh ${bin_dir}/feh-cam \
- ${bin_dir}/gen-cam-menu
+ @cp src/feh ${bin_dir}/feh.tmp
+ @mv ${bin_dir}/feh.tmp ${bin_dir}/feh
+ @chmod 755 ${bin_dir}/feh
install-font:
@echo installing fonts to ${font_dir}
@mkdir -p ${font_dir}
- @cp src/ttfonts/black.style src/ttfonts/menu.style \
- src/ttfonts/yudit.ttf ${font_dir}
- @chmod 644 ${font_dir}/black.style ${font_dir}/menu.style \
- ${font_dir}/yudit.ttf
+ @chmod 755 ${font_dir}
+ @cp share/fonts/* ${font_dir}
+ @chmod 644 ${font_dir}/*
install-img:
@echo installing images to ${image_dir}
@mkdir -p ${image_dir}
- @cp src/about.png src/menubg_aluminium.png src/menubg_aqua.png \
- src/menubg_black.png src/menubg_brushed.png src/menubg_chrome.png \
- src/menubg_default.png src/menubg_pastel.png src/menubg_sky.png \
- src/menubg_wood.png ${image_dir}
- @chmod 644 ${image_dir}/about.png ${image_dir}/menubg_aluminium.png \
- ${image_dir}/menubg_aqua.png ${image_dir}/menubg_black.png \
- ${image_dir}/menubg_brushed.png ${image_dir}/menubg_chrome.png \
- ${image_dir}/menubg_default.png ${image_dir}/menubg_pastel.png \
- ${image_dir}/menubg_sky.png ${image_dir}/menubg_wood.png
+ @chmod 755 ${image_dir}
+ @cp share/images/* ${image_dir}
+ @chmod 644 ${image_dir}/*
+
+install-icon:
+ @echo installing icon to ${48_icon_dir}
+ @mkdir -p ${48_icon_dir}
+ @cp share/images/feh.png ${48_icon_dir}
+ @chmod 644 ${48_icon_dir}/feh.png
+ @echo installing icon to ${scalable_icon_dir}
+ @mkdir -p ${scalable_icon_dir}
+ @cp share/images/feh.svg ${scalable_icon_dir}
+ @chmod 644 ${scalable_icon_dir}/feh.svg
+ @if test "${app}" = 1 && which gtk-update-icon-cache > /dev/null 2>&1; then \
+ gtk-update-icon-cache ${icon_dir}; \
+ fi
+
+install-examples:
+ @echo installing examples to ${example_dir}
+ @mkdir -p ${example_dir}
+ @cp examples/* ${example_dir}
+ @chmod 644 ${example_dir}/*
+
+install-applications: share/applications/feh.desktop
+ @echo installing desktop file to ${desktop_dir}
+ @mkdir -p ${desktop_dir}
+ @cp share/applications/feh.desktop ${desktop_dir}
+ @chmod 644 ${desktop_dir}/feh.desktop
uninstall:
- rm -f ${man_dir}/man1/feh.1 ${man_dir}/man1/feh-cam.1
- rm -f ${man_dir}/man1/gen-cam-menu.1
+ rm -f ${man_dir}/man1/feh.1
rm -rf ${doc_dir}
- rm -f ${bin_dir}/feh ${bin_dir}/feh-cam ${bin_dir}/gen-cam-menu
+ rm -f ${bin_dir}/feh
+ rm -f ${desktop_dir}/feh.desktop
rm -rf ${font_dir}
rm -rf ${image_dir}
+ @if test -e ${48_icon_dir}/feh.png; then \
+ echo rm -f ${48_icon_dir}/feh.png; \
+ rm -f ${48_icon_dir}/feh.png; \
+ fi
+ @if test -e ${scalable_icon_dir}/feh.svg; then \
+ echo rm -f ${scalable_icon_dir}/feh.svg; \
+ rm -f ${scalable_icon_dir}/feh.svg; \
+ fi
+ @if which gtk-update-icon-cache > /dev/null 2>&1; then \
+ gtk-update-icon-cache ${icon_dir}; \
+ fi
+
+dist:
+ mkdir /tmp/feh-${VERSION}
+ git --work-tree=/tmp/feh-${VERSION} checkout -f
+ cp src/deps.mk /tmp/feh-${VERSION}/src/deps.mk
+ sed -i 's/^VERSION ?= .*$$/VERSION ?= ${VERSION}/' \
+ /tmp/feh-${VERSION}/config.mk
+ sed -i 's/^MAN_DATE ?= .*$$/MAN_DATE ?= ${MAN_DATE}/' \
+ /tmp/feh-${VERSION}/config.mk
+ tar -C /tmp -cjf ../feh-${VERSION}.tar.bz2 feh-${VERSION}
+ rm -r /tmp/feh-${VERSION}
+
+disttest: dist
+ tar -C /tmp -xjf ../feh-${VERSION}.tar.bz2
+ make -C /tmp/feh-${VERSION}
+ make -C /tmp/feh-${VERSION} test
+ make -C /tmp/feh-${VERSION} install DESTDIR=./install
+ make -C /tmp/feh-${VERSION} uninstall DESTDIR=./install
+ rm -r /tmp/feh-${VERSION}
clean:
@${MAKE} -C src clean
+ @${MAKE} -C man clean
+ @${MAKE} -C share/applications clean
-.PHONY: default install uninstall clean install-man install-doc install-bin \
- install-font install-img
+.PHONY: all test test-x11 install uninstall clean install-man install-doc \
+ install-bin install-font install-img install-examples \
+ install-applications dist