X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/95c163711abd03542c623e452e29c73b5e009d93..cd227c58b8d327be1a4d78787055ec4c8d9d0c75:/GNUmakefile diff --git a/GNUmakefile b/GNUmakefile index 256aa06..764db47 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,6 +9,8 @@ man1dir=${mandir}/man1 catdir=${mandir} cat1dir=${catdir}/cat1 +TAGLIBFLAGS= `pkg-config --cflags --libs taglib` + INSTALL= install INSTALL_DATA= ${INSTALL} -m 444 INSTALL_DIRECTORY=${INSTALL} -d -m 755 @@ -19,44 +21,56 @@ ROFF= nroff -Tascii -mandoc SCRIPTS=\ fa-flacd \ fa-rip \ - fa-tags + flac2mp3 \ MAN=\ - fa-flacd.1 fa-flacd.0 + fa-flacd.1 fa-flacd.0 \ + fa-rip.1 fa-rip.0 \ + flac2mp3.1 flac2mp3.0 \ + +all: apic-read apic-write strip-tags ${SCRIPTS} ${MAN} -all: ${SCRIPTS} ${MAN} +#CXX= /opt/llvm-3.3.src/bin/clang -std=c++11 -g -Wall +CXX= g++ -std=c++0x -g -Wall -fa-flacd.1: fa-flacd - ${POD2MAN} fa-flacd > $@ +%: %.cc + ${CXX} -o $@ $< ${TAGLIBFLAGS} -.SUFFIXES: .1 .0 -.1.0: +.PRECIOUS: %.1 +%.1: % + ${POD2MAN} $< > $@ + +%.0: %.1 ${ROFF} $< > $@ 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}: + rm -f ${MAN} apic-read apic-write strip-tags id3v2-grep + +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}${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