From 5ce02b41181fb618c5e49fe17caef92801d39fb3 Mon Sep 17 00:00:00 2001 From: Alain D D Williams Date: Mon, 17 Aug 2020 18:41:15 +0100 Subject: [PATCH] PDFs are created in the directory output/ make clean - now removes intermediate files, leaves the PDFs make clean-all removed everything including PDFs --- powerpc-add/Makefile | 1 + powerpc-add/build/Makefile | 83 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 120000 powerpc-add/Makefile create mode 100644 powerpc-add/build/Makefile diff --git a/powerpc-add/Makefile b/powerpc-add/Makefile new file mode 120000 index 0000000..dddfc45 --- /dev/null +++ b/powerpc-add/Makefile @@ -0,0 +1 @@ +build/Makefile \ No newline at end of file diff --git a/powerpc-add/build/Makefile b/powerpc-add/build/Makefile new file mode 100644 index 0000000..cca1f5d --- /dev/null +++ b/powerpc-add/build/Makefile @@ -0,0 +1,83 @@ +#======================================================================= +# Makefile for generating LaTeX documents +#----------------------------------------------------------------------- +# +# This is a simple makefile for generating LaTeX documents. It will +# run bibtex, generate eps from xfig figures, and make pdfs. The +# makefile supports builds in non-source directories: just make a +# build directory, copy the makefile there, and change the srcdir +# variable accordingly. +# +# Note that the makefile assumes that the default dvips/ps2pdfwr +# commands "do the right thing" for fonts in pdfs. This is true on +# Athena/Linux and Fedora Core but is not true for older redhat installs ... +# +# At a minimum you should just change the main variable to be +# the basename of your toplevel tex file. If you use a bibliography +# then you should set the bibfile variable to be the name of your +# .bib file (assumed to be in the source directory). +# + +# Targets: +# (none) makes PDFs in output/ +# clean removed everything except PDFs in output/ +# clean-all removed everything in output/ + +# Directories relative to the top level: +outdir = output +srcdir = src +# Relative to output: +relsrcdir = ../$(srcdir) + +docs_with_bib = power-spec +docs_without_bib = + +srcs = $(wildcard $(srcdir)/*.tex) +figs = $(wildcard $(srcdir)/figs/*) +bibs = $(srcdir)/power-spec.bib + +#======================================================================= +# You shouldn't need to change anything below this +#======================================================================= + +PDFLATEX := TEXINPUTS=$(relsrcdir): pdflatex -interaction=nonstopmode -halt-on-error +BIBTEX := BIBINPUTS=$(relsrcdir): bibtex + +default : $(outdir) pdf + +#------------------------------------------------------------ +# PDF + +pdfs_with_bib = $(addsuffix .pdf, $(docs_with_bib)) +pdfs_without_bib = $(addsuffix .pdf, $(docs_without_bib)) +pdfs = $(pdfs_with_bib) $(pdfs_without_bib) + +pdf : $(pdfs) +.PHONY: pdf open + +$(outdir): + mkdir $@ + +open: $(pdfs) + open $(pdfs) + +$(pdfs_with_bib): %.pdf: $(srcdir)/%.tex $(srcs) $(figs) $(bibs) + cd $(outdir); $(PDFLATEX) $* + cd $(outdir); $(BIBTEX) $* + cd $(outdir); $(PDFLATEX) $* + cd $(outdir); $(PDFLATEX) $* + +$(pdfs_without_bib): %.pdf: $(srcdir)/%.tex $(srcs) $(figs) + cd $(outdir); $(PDFLATEX) $* + cd $(outdir); $(PDFLATEX) $* + +junk += *.aux *.log *.bbl *.blg *.toc *.out + +#------------------------------------------------------------ +# Other Targets + +clean : + rm -rf $(addprefix $(outdir)/, $(junk)) + +clean-all: clean + rm -rf $(addprefix $(outdir)/, $(pdfs)) -- 2.30.2