diff options
author | Mike Holmes <mike.holmes@linaro.org> | 2015-04-16 16:06:23 -0400 |
---|---|---|
committer | Mike Holmes <mike.holmes@linaro.org> | 2015-04-16 16:53:37 -0400 |
commit | b1829261f38b0cbfc9c36ec636a18335063edb95 (patch) | |
tree | a8b45a2aab8378f9eb81d7fc9ddc82ea4a2d9860 | |
parent | 08e546bd845a50a2a490379ea6d4152dfdf0b6fd (diff) |
add makefile to build pdfs
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | README | 31 |
2 files changed, 40 insertions, 13 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..39d4c49 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +#Copyright (c) 2015, Linaro Limited +#All rights reserved. +# +#SPDX-License-Identifier: BSD-3-Clause + +src_list = $(basename $(wildcard *.odt)) +file_list = $(addsuffix .pdf, $(src_list)) + +all: check_office_is_open $(file_list) + +check_office_is_open: + @if [ ! -z `pidof soffice.bin` ]; \ + then \ + echo "\nlibreoffice is already running, scripting can't run"; \ + exit 1; \ + fi \ + +%.pdf: %.odt + libreoffice --headless --convert-to pdf $< + +clean: + rm -f $(file_list) @@ -1,22 +1,27 @@ +Generating pdfs + + sudo apt-get install libreoffice + make + Getting a plain-text diff for an .odt file -Instruction below copied from [1] Git 1.6.1 or later + Instruction below copied from [1] Git 1.6.1 or later -First, install odt2txt, a simple (and stupid) converter from OpenDocument to -plain text, and configure git to allow it to run it, by adding this to + First, install odt2txt, a simple (and stupid) converter from OpenDocument to + plain text, and configure git to allow it to run it, by adding this to -~/.gitconfig: -[diff "odf"] - textconv=odt2txt + ~/.gitconfig: + [diff "odf"] + textconv=odt2txt -Now, for each project, you just need to ask git to use this driver in + Now, for each project, you just need to ask git to use this driver in -~/.gitattributes like this: -*.ods diff=odf -*.odt diff=odf -*.odp diff=odf + ~/.gitattributes like this: + *.ods diff=odf + *.odt diff=odf + *.odp diff=odf -... and you're done! Enjoy "git diff", "git log -p", "git show" in this project. + ... and you're done! Enjoy "git diff", "git log -p", "git show" in this project. -[1] https://git.wiki.kernel.org/index.php/GitTips#How_to_use_git_to_track_OpenDocument_.28OpenOffice.2C_Koffice.29_files.3F + [1] https://git.wiki.kernel.org/index.php/GitTips#How_to_use_git_to_track_OpenDocument_.28OpenOffice.2C_Koffice.29_files.3F |