Skip to content
This repository

Makefile changes to make out-of-source build reasonable #24

Merged
merged 2 commits into from over 1 year ago

1 participant

pettter
pettter
Collaborator

This includes changes to the make scripts that enhance the ability to partition stuff into
a) the source code
b) the build files, and
c) the build artifacts
through the use of Makefile variables.

pettter pettter merged commit a6ca3e3 into from
pettter pettter closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
27  src/Makefile
... ...
@@ -1,10 +1,25 @@
1  
-all: tex combined
  1
+BUILD_DIR=build
  2
+INSTALL_DIR=/path/to/install
  3
+
  4
+TEX_DIR=${BUILD_DIR}/tex
  5
+BOOK_DIR=${BUILD_DIR}/.
  6
+
  7
+all: latex-pdf combined
2 8
 
3 9
 tex:
4  
-	./convert_to_tex.sh
5  
-	pdflatex main.tex
6  
-	pdflatex main.tex
  10
+	./convert_to_tex.sh ${TEX_DIR}
  11
+	cp main.tex ${TEX_DIR}
  12
+
  13
+latex-pdf: tex
  14
+	pdflatex --output-dir=${TEX_DIR} ${TEX_DIR}/main.tex
  15
+	pdflatex --output-dir=${TEX_DIR} ${TEX_DIR}/main.tex
  16
+
  17
+book.md:
  18
+	cat chapter*/*.md > ${BOOK_DIR}/book.md
  19
+
  20
+combined: book.md
7 21
 
8  
-combined:
9  
-	cat */*.md > book.md
  22
+install: book.md latex-pdf
  23
+	cp ${TEX_DIR}/main.pdf ${INSTALL_DIR}/cryptoparty-handbook-`date +%F`.pdf
  24
+	cp ${BOOK_DIR}/book.md ${INSTALL_DIR}/cryptoparty-handbook-`date +%F`.md
10 25
 
12  src/convert_to_tex.sh
... ...
@@ -1,3 +1,13 @@
  1
+#!/bin/bash
  2
+if [ -z $1 ] ; then
  3
+	DIR=.
  4
+else
  5
+	DIR=$1
  6
+fi
  7
+mkdir $DIR
  8
+for d in chapter*; do
  9
+	mkdir $DIR/$d
  10
+done
1 11
 for f in */*.md; do 
2  
-	pandoc -f markdown -t latex $f -o $f.tex
  12
+	pandoc -f markdown -t latex $f -o $DIR/$f.tex
3 13
 done
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.