X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/95c163711abd03542c623e452e29c73b5e009d93..c8b869029c4f57a17bdea5d7fd2ba613a67a02d9:/GNUmakefile diff --git a/GNUmakefile b/GNUmakefile index 256aa06..0ae6f02 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -36,27 +36,37 @@ fa-flacd.1: fa-flacd clean: rm -f ${MAN} -install: ${SCRIPTS} ${bindir} ${man1dir} ${cat1dir} ${SCRIPTS} ${MAN} - ${INSTALL_SCRIPT} ${SCRIPTS} ${bindir} - ${INSTALL_DATA} fa-flacd.1 ${man1dir} - ln -sf fa-flacd.1 ${man1dir}/fa-rip.1 - ln -sf fa-flacd.1 ${man1dir}/fa-tags.1 - ${INSTALL_DATA} fa-flacd.0 ${cat1dir} - ln -sf fa-flacd.0 ${cat1dir}/fa-rip.0 - ln -sf fa-flacd.0 ${cat1dir}/fa-tags.0 - -${bindir}: +install: $(addprefix ${DESTDIR}${bindir}/, ${SCRIPTS}) +install: $(addprefix ${DESTDIR}${man1dir}/, $(addsuffix .1, ${SCRIPTS})) +install: $(addprefix ${DESTDIR}${cat1dir}/, $(addsuffix .0, ${SCRIPTS})) + +${DESTDIR}${bindir}/%: % ${DESTDIR}${bindir} + ${INSTALL_SCRIPT} $< $@ + +${DESTDIR}${man1dir}/%: % ${DESTDIR}${man1dir} + ${INSTALL_DATA} $< $@ + +${DESTDIR}${cat1dir}/%: % ${DESTDIR}${cat1dir} + ${INSTALL_DATA} $< $@ + +${DESTDIR}${man1dir}/fa-rip.1 ${DESTDIR}${man1dir}/fa-tags.1: + ln -sf fa-flacd.1 $@ + +${DESTDIR}${cat1dir}/fa-rip.0 ${DESTDIR}${cat1dir}/fa-tags.0: + ln -sf fa-flacd.0 $@ + +${DESTDIR}${bindir}: ${INSTALL_DIRECTORY} $@ -${man1dir}: +${DESTDIR}${man1dir}: ${INSTALL_DIRECTORY} $@ -${cat1dir}: +${DESTDIR}${cat1dir}: ${INSTALL_DIRECTORY} $@ uninstall: - cd ${bindir} && rm -f ${SCRIPTS} - cd ${man1dir} && rm -f ${MAN} fa-rip.1 fa-tags.1 - cd ${cat1dir} && rm -f ${MAN} fa-rip.0 fa-tags.0 + rm -f $(addprefix ${DESTDIR}${bindir}/, ${SCRIPTS}) + rm -f $(addprefix ${DESTDIR}${man1dir}/, $(addsuffix .1, ${SCRIPTS})) + rm -f $(addprefix ${DESTDIR}${cat1dir}/, $(addsuffix .0, ${SCRIPTS})) .PHONY: all clean install uninstall