MKDIR = mkdir -p RMDIR = rmdir INSTALL = @INSTALL@ $(INSTALL_FLAGS) INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS) INSTALL_LIBRARY = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS) INSTALL_SCRIPT = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS) INSTALL_DATA = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS) XMLTO = @XMLTO@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ SCRIPTS = \ xdg-menu \ xdg-desktop \ xdg-email \ xdg-mime \ xdg-su \ xdg-open \ xdg-copy do_subst = sed -e '/[@]xdg-utils-common[@]/ r xdg-utils-common.in' | sed -e '/LICENSE:/ r ../LICENSE' all: scripts: README $(SCRIPTS) release: scripts rm -f xdg-*.in *~ HACKING rm -rf desc/ distclean: clean rm -f Makefile clean: scripts-clean: rm -f $(SCRIPTS) README man/xdg-*.1 html/xdg-*.html README: $(SCRIPTS) echo > $@ @for x in $(SCRIPTS) ; do \ sh ./$$x | grep -B 100 Synopsis | head -n-1 >> $@ ; \ done install: $(MKDIR) $(bindir) for x in $(SCRIPTS) ; do \ $(INSTALL_SCRIPT) $$x $(bindir) ; \ done uninstall: for x in $(SCRIPTS) ; do \ rm -f $(bindir)/$$x ; \ done -$(RMDIR) $(bindir) %: %.in %.usage %.1 %.html cat $@.in | $(do_subst) | sed -e '/<< _USAGE/ r '$@.usage >$@ chmod a+x $@ xdg-menu: xdg-menu.in xdg-utils-common.in xdg-desktop: xdg-desktop.in xdg-utils-common.in xdg-email: xdg-email.in xdg-utils-common.in xdg-mime: xdg-mime.in xdg-utils-common.in xdg-su: xdg-su.in xdg-utils-common.in xdg-open: xdg-open.in xdg-utils-common.in xdg-copy: xdg-copy.in xdg-utils-common.in %.1: desc/%.xml (cd man;$(XMLTO) man ../$<) %.html: desc/%.xml (cd html;$(XMLTO) html-nochunks ../$<) %.txt: desc/%.xml $(XMLTO) txt $< %.usage: %.txt grep -B 100 Description $< | (read;read;read a;echo $$a;head -n-1) > $@